Skip to content

fix(elf): make Note::type_to_str namespace-aware - #531

Closed
wyf027 wants to merge 1 commit into
m4b:masterfrom
wyf027:fix-note-type-to-str-410
Closed

fix(elf): make Note::type_to_str namespace-aware#531
wyf027 wants to merge 1 commit into
m4b:masterfrom
wyf027:fix-note-type-to-str-410

Conversation

@wyf027

@wyf027 wyf027 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Makes Note::type_to_str resolve note types based on the note namespace (n_name) instead of n_type alone
  • Adds NT_VERSION and NT_ARCH constants for the default/unknown namespace
  • Splits type resolution into GNU, CORE, and default helpers per elf(5)

Fixes #410

Test plan

  • cargo test --features alloc elf::note::tests
  • Added type_to_str_respects_namespace covering GNU/default/CORE disambiguation for type value 1

ELF note type constants such as NT_VERSION (1), NT_GNU_ABI_TAG (1), and
NT_PRSTATUS (1) share the same numeric value but belong to different
namespaces. Resolve the type string based on n_name instead of n_type
alone, following elf(5).

Fixes #410

Co-authored-by: Cursor <cursoragent@cursor.com>
@wyf027 wyf027 closed this by deleting the head repository Jun 23, 2026
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

Successfully merging this pull request may close these issues.

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

1 participant