Skip to content

elf: add newtypes#878

Draft
philipc wants to merge 9 commits intogimli-rs:mainfrom
philipc:newtype
Draft

elf: add newtypes#878
philipc wants to merge 9 commits intogimli-rs:mainfrom
philipc:newtype

Conversation

@philipc
Copy link
Copy Markdown
Contributor

@philipc philipc commented Apr 11, 2026

Addition of newtypes for some ELF constants, with more to come. Also some related cleanups.

Builds on top of #876. See individual commits.

philipc added 9 commits April 10, 2026 15:54
This module contains a macro to create data structures containing constant names at the same time as the constants are defined. Use this macro to define elf/macho/pe constants, and replace most of the constant names in the readobj example.
Similar for other elf structs. Old names are kept as type aliases. This matches normal ELF naming conventions, and will provide consistency with names for newtypes in future. Non-breaking
SectionKind is format independent, and the Elf variant never belonged there. Fixing this now because adding a newtype for sh_type will also be a breaking change.
This includes the SHF constants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant