Page MenuHomeFreeBSD

readelf(1) -S: Include zero index and match binutils' no-name

Authored by cem on Dec 4 2016, 2:39 AM.



Include the SHN_UNDEF (zero) index special section in extended-attribute
ELF files, like GNU binutils' readelf.

Additionally, print "<no-name>" for sections without names, like GNU

Test Plan

This is the last change needed to elftoolchain to match binutils behavior for
the coredump_phnum test case.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cem retitled this revision from to readelf(1) -S: Include zero index and match binutils' no-name.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added a reviewer: emaste.
6560 ↗(On Diff #22696)

For parity with binutils.

6566 ↗(On Diff #22696)

(Only skip sections if there was actually an error — it's valid for ELF files to have a SHN_UNDEX index section.)

kaiw edited edge metadata.

Patch looks good to me!

This revision is now accepted and ready to land.Dec 7 2016, 5:41 PM
This revision was automatically updated to reflect the committed changes.