summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-01-28 02:21:35 +0000
committernorly <ny-git@enpas.org>2013-02-11 01:32:32 +0000
commitf54dc5b5697207093a70416a665eddf8c0970a0a (patch)
tree7ca68d27da45ecf60ae9978395b56fef74e18224
parenta78f477fc5a2327118bb129026e18ba8302ec7aa (diff)
Ugly section alignment fix
...until I figure out how to align entire sections. The program runs, but the sections are slightly moved around and thus the entry point cannot be right. Seems this is because libelf loses some dynamic symbols (???)
-rw-r--r--src/copy/section.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/copy/section.c b/src/copy/section.c
index 5a62593..e096b2b 100644
--- a/src/copy/section.c
+++ b/src/copy/section.c
@@ -57,7 +57,8 @@ void elfu_copySection(Elf *eo, Elf_Scn *scn)
fprintf(stderr, "elf_newdata() failed: %s\n", elf_errmsg(-1));
}
- dataOut->d_align = data->d_align;
+ //dataOut->d_align = data->d_align;
+ dataOut->d_align = shdr.sh_addralign;
dataOut->d_buf = data->d_buf;
/* dataOut->d_off = data->d_off; */
dataOut->d_type = data->d_type;