From f54dc5b5697207093a70416a665eddf8c0970a0a Mon Sep 17 00:00:00 2001 From: norly Date: Mon, 28 Jan 2013 02:21:35 +0000 Subject: [PATCH] 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 (???) --- src/copy/section.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.30.2