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
F82401927: D1428.diff
Sun, Apr 28, 5:17 AM
Unknown Object (File)
Feb 29 2024, 5:24 AM
Unknown Object (File)
Feb 12 2024, 5:19 PM
Unknown Object (File)
Dec 31 2023, 11:52 PM
Unknown Object (File)
Dec 31 2023, 11:52 PM
Unknown Object (File)
Dec 19 2023, 11:28 PM
Unknown Object (File)
Dec 12 2023, 6:04 AM
Unknown Object (File)
Sep 29 2023, 12:09 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).