diff --git a/crates/examples/src/readobj/elf.rs b/crates/examples/src/readobj/elf.rs index a8c0a56e..ad1f2a46 100644 --- a/crates/examples/src/readobj/elf.rs +++ b/crates/examples/src/readobj/elf.rs @@ -1443,6 +1443,9 @@ const FLAGS_SHF: &[Flag] = &flags!( SHF_GROUP, SHF_TLS, SHF_COMPRESSED, + SHF_GNU_RETAIN, + SHF_GNU_MBIND, + SHF_EXCLUDE, ); const FLAGS_SHF_MIPS: &[Flag] = &flags!( SHF_MIPS_GPREL, diff --git a/crates/examples/testfiles/elf/nostd-mipsel.o.readobj b/crates/examples/testfiles/elf/nostd-mipsel.o.readobj index d5fe089e..0cd14723 100644 --- a/crates/examples/testfiles/elf/nostd-mipsel.o.readobj +++ b/crates/examples/testfiles/elf/nostd-mipsel.o.readobj @@ -203,6 +203,7 @@ SectionHeader { Name: ".llvm_addrsig" (0x4B) Type: 0x6FFF4C03 Flags: 0x80000000 + SHF_EXCLUDE (0x80000000) SHF_MIPS_STRINGS (0x80000000) Address: 0x0 Offset: 0x118 diff --git a/src/elf.rs b/src/elf.rs index c9c53bf1..541658f3 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -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.