BFD ELF symtab strtab section header ordering

Carl van Schaik carl@cog.systems
Thu Jun 14 12:41:00 GMT 2018


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



More information about the Binutils mailing list