Re: readelf reporting of e_shstrndx is slightly wrong

2018-08-21 Thread Alan Modra
On Tue, Aug 21, 2018 at 11:09:04PM +, Mike Murphy wrote: > I think an example would help explain this. Below is part of the > output from readelf -h on an elf object I have which has 210016 > sections, but puts the section header string table at section 1. So > e_shstrndx is 1, but e_shnum is

RE: readelf reporting of e_shstrndx is slightly wrong

2018-08-21 Thread Mike Murphy
; bug-binutils@gnu.org Subject: Re: readelf reporting of e_shstrndx is slightly wrong Hi Mike, > If the file has no section name string table, this member holds the value > |SHN_UNDEF|. > If the section name string table section index is greater than or > equal to |SHN_LORESERVE|

Re: readelf reporting of e_shstrndx is slightly wrong

2018-08-21 Thread Egeyar Bagcioglu
Hi, On 08/21/2018 05:31 PM, Nick Clifton wrote: if (filedata->section_headers != NULL && header->e_shstrndx == (SHN_XINDEX & 0x)) printf (" (%u)", filedata->section_headers[0].sh_link); else if (header->e_shstrndx != SHN_UNDEF && header->e_shst

Re: readelf reporting of e_shstrndx is slightly wrong

2018-08-21 Thread Nick Clifton
Hi Mike, > If the file has no section name string table, this member holds the value > |SHN_UNDEF|. > If the section name string table section index is greater than or equal to > |SHN_LORESERVE| (|0xff00|), this member has the value |SHN_XINDEX| (|0x|) > The current readelf -h seems to as

readelf reporting of e_shstrndx is slightly wrong

2018-08-17 Thread Mike Murphy
According to the ELF standard: e_shstrndx This member holds the section header table index of the entry associated with the section name string table. If the file has no section name string table, this member holds the value SHN_UNDEF. See ``Sections''