Skip to content

Commit

Permalink
elf: add 2 section flag constants (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin authored Aug 19, 2024
1 parent 112417e commit 3872c29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/examples/src/readobj/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,9 @@ const FLAGS_SHF: &[Flag<u32>] = &flags!(
SHF_GROUP,
SHF_TLS,
SHF_COMPRESSED,
SHF_GNU_RETAIN,
SHF_GNU_MBIND,
SHF_EXCLUDE,
);
const FLAGS_SHF_MIPS: &[Flag<u32>] = &flags!(
SHF_MIPS_GPREL,
Expand Down
1 change: 1 addition & 0 deletions crates/examples/testfiles/elf/nostd-mipsel.o.readobj
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ SectionHeader {
Name: ".llvm_addrsig" (0x4B)
Type: 0x6FFF4C03
Flags: 0x80000000
SHF_EXCLUDE (0x80000000)
SHF_MIPS_STRINGS (0x80000000)
Address: 0x0
Offset: 0x118
Expand Down
4 changes: 4 additions & 0 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,10 @@ pub const SHF_TLS: u32 = 1 << 10;
pub const SHF_COMPRESSED: u32 = 1 << 11;
/// OS-specific section flags.
pub const SHF_MASKOS: u32 = 0x0ff0_0000;
/// Section should not be garbage collected by the linker.
pub const SHF_GNU_RETAIN: u32 = 1 << 21;
/// Mbind section.
pub const SHF_GNU_MBIND: u32 = 1 << 24;
/// Processor-specific section flags.
pub const SHF_MASKPROC: u32 = 0xf000_0000;
/// This section is excluded from the final executable or shared library.
Expand Down

0 comments on commit 3872c29

Please sign in to comment.