Page MenuHomeFreeBSD

readelf: Handle note types from different operating systems
ClosedPublic

Authored by emaste on Jan 3 2015, 6:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:14 AM
Unknown Object (File)
Wed, Nov 6, 2:32 AM
Unknown Object (File)
Oct 16 2024, 8:52 AM
Unknown Object (File)
Oct 9 2024, 12:46 AM
Unknown Object (File)
Oct 3 2024, 5:49 AM
Unknown Object (File)
Oct 1 2024, 2:53 PM
Unknown Object (File)
Sep 18 2024, 8:28 AM
Unknown Object (File)
Sep 12 2024, 12:05 AM

Details

Summary

Previously elftoolchain readelf(1) only displayed correct names for Linux note types.
Upstream elftoolchain ticket #473 https://sourceforge.net/p/elftoolchain/tickets/473/

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to readelf: Handle note types from different operating systems.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a subscriber: Unknown Object (MLST).

This looks odd. Why are we relying on magic numbers instead of constants/enums like before?

In D1428#3, @rpaulo wrote:

This looks odd. Why are we relying on magic numbers instead of constants/enums like before?

Some of the constants in the previous version are Linux-specific, and don't exist in our ELF headers.

We could make up our own constants (e.g. NT_LINUX_AUXV) but it doesn't seem like that would provide much value. The same constant name may have different values on different OSes.

In D1428#5, @emaste wrote:
In D1428#3, @rpaulo wrote:

This looks odd. Why are we relying on magic numbers instead of constants/enums like before?

Some of the constants in the previous version are Linux-specific, and don't exist in our ELF headers.

We could make up our own constants (e.g. NT_LINUX_AUXV) but it doesn't seem like that would provide much value. The same constant name may have different values on different OSes.

The Linux note types are Linux specific. Are you saying that FreeBSD reuses them ?

In D1428#6, @rpaulo wrote:

The Linux note types are Linux specific. Are you saying that FreeBSD reuses them ?

Not quite, just that the note types are vendor-specific and in a namespace specific to the note name (vendor). NT_PRSTATUS, NT_FPREGSET, and NT_FPREGSET happen to have the same value on Linux and FreeBSD. We don't currently have definitions in our ELF headers for Linux-specific note types like NT_LWPSTATUS, and I'd find it somewhat odd to add them without somehow putting them in a namespace in the header.

kib added a reviewer: kib.
This revision is now accepted and ready to land.Jan 4 2015, 2:32 PM
emaste updated this revision to Diff 3002.

Closed by commit rS276705 (authored by @emaste).