Page MenuHomeFreeBSD

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

Authored by cem on Dec 4 2016, 2:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 19, 12:03 PM
Unknown Object (File)
Sun, Aug 10, 2:17 PM
Unknown Object (File)
Sat, Aug 9, 1:55 PM
Unknown Object (File)
Fri, Aug 8, 2:45 PM
Unknown Object (File)
Fri, Aug 1, 7:57 PM
Unknown Object (File)
Jul 1 2025, 2:54 AM
Unknown Object (File)
Jun 24 2025, 8:51 AM
Unknown Object (File)
Jun 19 2025, 7:40 AM
Subscribers
None

Details

Summary

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
binutils.

Test Plan

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
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.
contrib/elftoolchain/readelf/readelf.c
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.