You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In ELF files all strings are put into string table sections (SHT_STRTAB type).
Many tools dedicate a separate STRTAB section specifically for the section names, with the number of this section indicated in the main ELF header e_shstrndx field.
However there is no requirement to put these strings in a separate table section. Some compilers generate a single STRTAB section containing all strings, section names and symbol names. In this case the ELF header e_shstrndx field points to this unified section.
To Reproduce
Pass an ELF table object file generated from clang compiler to elf2cfetbl - it fails to identify the symbol names correctly, and it therefore fails to find the CFE_TBL_FileDef symbol.
Expected behavior
elf2cfetbl should work with these ELF files and produce an output.
System observed on:
Ubuntu 20.04 (build host)
Additional context
Note that ELF also doesn't say any maximum number of string table sections either. There could be just one (this bug) or there could be more than two.
As best I can tell, the string table used for the .symtab section should always be named .strtab - so this is probably a better way to identify the right section.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Support ELF files that have all strings, including ELF section names,
in one single ".strtab" section in the ELF file.
This gives preferential treatment to a section named ".strtab" as this
should always be the section which contains the names for the ".symtab"
section.
This should also be true of ELF files that contain other strtab sections,
such as a ".dynstr" section.
Support ELF files that have all strings, including ELF section names,
in one single ".strtab" section in the ELF file.
This gives preferential treatment to a section named ".strtab" as this
should always be the section which contains the names for the ".symtab"
section.
This should also be true of ELF files that contain other strtab sections,
such as a ".dynstr" section.
Describe the bug
In ELF files all strings are put into string table sections (
SHT_STRTAB
type).Many tools dedicate a separate STRTAB section specifically for the section names, with the number of this section indicated in the main ELF header
e_shstrndx
field.However there is no requirement to put these strings in a separate table section. Some compilers generate a single STRTAB section containing all strings, section names and symbol names. In this case the ELF header
e_shstrndx
field points to this unified section.To Reproduce
Pass an ELF table object file generated from
clang
compiler toelf2cfetbl
- it fails to identify the symbol names correctly, and it therefore fails to find theCFE_TBL_FileDef
symbol.Expected behavior
elf2cfetbl should work with these ELF files and produce an output.
System observed on:
Ubuntu 20.04 (build host)
Additional context
Note that ELF also doesn't say any maximum number of string table sections either. There could be just one (this bug) or there could be more than two.
As best I can tell, the string table used for the
.symtab
section should always be named.strtab
- so this is probably a better way to identify the right section.Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: