summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2015-04-16 00:59:52 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2015-04-16 01:02:55 +0300
commit1f0cb0f2c1ba632c0fab02424928cfb756a9160c (patch)
treed092b9a806c3142bdd1e56a9ea24ddeeabf2500f
parent8fa0fe16408afc76ce1ae4387e1a9d46893cfda6 (diff)
downloadnasm-1f0cb0f2c1ba632c0fab02424928cfb756a9160c.tar.gz
output: elf64 -- increase .symtab and .rel* alignment to 8
Discovered while working on ELF Tool Chain elfcopy (strip), which originally crashed on an assert while processing a nasm-generated ELF object. The .symtab and .rela.text sections report 4 byte alignment, but require 8. As an aside, see https://sourceforge.net/p/elftoolchain/tickets/485/ for a discussion of the ELF Tool Chain issue that this bug exposed. With my WIP elfcopy change and nasm-assembled jccolss2-64.o from libjpeg-turbo: % strip -o /dev/null --strip-debug jccolss2-64.o strip: section .symtab alignment 4 increased to 8 strip: section .rela.text alignment 4 increased to 8 http://bugzilla.nasm.us/show_bug.cgi?id=3392307 Signed-off-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outelf64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/output/outelf64.c b/output/outelf64.c
index 241e345f..19bd8459 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -1084,7 +1084,7 @@ static void elf_write(void)
/* .symtab */
elf_section_header(p - shstrtab, SHT_SYMTAB, 0, symtab, true,
- symtablen, sec_strtab, symtablocal, 4, 24);
+ symtablen, sec_strtab, symtablocal, 8, 24);
p += strlen(p) + 1;
/* .strtab */
@@ -1096,7 +1096,7 @@ static void elf_write(void)
for (i = 0; i < nsects; i++)
if (sects[i]->head) {
elf_section_header(p - shstrtab, SHT_RELA, 0, sects[i]->rel, true,
- sects[i]->rellen, sec_symtab, i + 1, 4, 24);
+ sects[i]->rellen, sec_symtab, i + 1, 8, 24);
p += strlen(p) + 1;
}