lkml.org 
[lkml]   [2020]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-09-03 17:36    [W:0.072 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site