Messages in this thread | | | Date | Thu, 3 Sep 2020 10:35:45 -0500 | From | Josh Poimboeuf <> | Subject | Re: [PATCH] objtool: support symtab_shndx during dump |
| |
On Wed, Aug 12, 2020 at 10:57:11AM -0700, Kristen Carlson Accardi wrote: > When getting the symbol index number, make sure to use the > extended symbol table information in order to support symbol > index's greater than 64K.
"indexes"
> if (GELF_ST_TYPE(sym.st_info) == STT_SECTION) { > - scn = elf_getscn(elf, sym.st_shndx); > + if ((sym.st_shndx > SHN_UNDEF && > + sym.st_shndx < SHN_LORESERVE) || > + (xsymtab && sym.st_shndx == SHN_XINDEX)) { > + if (sym.st_shndx != SHN_XINDEX) > + shndx = sym.st_shndx;
The sym.st_shndx checks are redundant, if 'sym.st_shndx == SHN_XINDEX' then 'sym.st_shndx != SHN_XINDEX' can't be true.
Actually I think this can be even further simplified to something like
if (!shndx) shndx = sym.st_shndx;
-- Josh
| |