Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note::type_to_str is only valid when n_name is "GNU" #410

Open
glandium opened this issue May 16, 2024 · 1 comment
Open

Note::type_to_str is only valid when n_name is "GNU" #410

glandium opened this issue May 16, 2024 · 1 comment

Comments

@glandium
Copy link
Contributor

This is what the manual page for elf(5) says:

Keep in mind that the interpretation of n_type depends on the namespace defined by the n_namesz field.

Then later:

n_type Depending on the value of the name field, this member may
have any of the following values:

         Core files (e_type = ET_CORE)
              Notes used by all core files.  These are highly
              operating system or architecture specific and often
              require close coordination with kernels, C libraries,
              and debuggers.  These are used when the namespace is
              the default (i.e., n_namesz will be set to 0), or a
              fallback when the namespace is unknown.

              NT_PRSTATUS
                     prstatus struct
              NT_FPREGSET
                     fpregset struct

(etc.)

          n_name = GNU
              Extensions used by the GNU tool chain.

              NT_GNU_ABI_TAG
                     Operating system (OS) ABI information.  The
                     desc field will be 4 words:

                     [0]  OS descriptor (ELF_NOTE_OS_LINUX,
                          ELF_NOTE_OS_GNU, and so on)`
                     [1]  major version of the ABI
                     [2]  minor version of the ABI
                     [3]  subminor version of the ABI

(etc.)

         Default/unknown namespace (e_type != ET_CORE)
              These are used when the namespace is the default
              (i.e., n_namesz will be set to 0), or a fallback when
              the namespace is unknown.

              NT_VERSION
                     A version string of some sort.
              NT_ARCH
                     Architecture information.

Note that, for instance, NT_VERSION, NT_GNU_ABI_TAG and NT_PRSTATUS all have the same value.

@m4b
Copy link
Owner

m4b commented Jul 28, 2024

@glandium is there a patch you can contribute to fix this issue or make us more compliant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants