Re: object file symbol table generated by gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 Apr 2021, Peng Yu via Gcc-help wrote:

> I have the above object file. If I understand it correctly, the Ndx in
> the following output should be the index of the string in the
> .shstrtab table as shown below?

No, Ndx gives the section index (readelf -SW); 1 is .text, 3 is .data and so on.

> Why these sections are in the symbol table, given that they are
> already in the section headers?

They are needed in case there's a relocation referring to a section rather than
a specific symbol; in fact there is one such relocation in this example, see
output of readelf -r.

Apart from .text, symtab entries for other sections appear unused and could be
eliminated.

Alexander



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux