This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
BFD ELF symtab strtab section header ordering
- From: Carl van Schaik <carl@cog.systems>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 14 Jun 2018 12:41:16 +0000
- Subject: BFD ELF symtab strtab section header ordering
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
Bfd processing looks like it expects to see the symbol table *before* it can handle the strtab section header.
Our ELF generation tools managed to put the .strtab header before the symtab, which causes binutils bfd to fail with "bad value".
Failure comes from bfd/elf.c
case SHT_STRTAB:
...
if (elf_elfsections (abfd)[elf_onesymtab (abfd)]->sh_link == shindex)
where elf_onesymtab (abfd) returns 0, since it hasn't been initialized yet due to the one-pass handling of sections.
Is this by design, or a bug/feature?
Thanks