pub const SHF = packed struct(Word) WRITE: bool = falseSection data should be writable during execution.
ALLOC: bool = falseSection occupies memory during program execution.
EXECINSTR: bool = falseSection contains executable machine instructions.
unused3: u1 = 0MERGE: bool = falseThe data in this section may be merged.
STRINGS: bool = falseThe data in this section is null-terminated strings.
INFO_LINK: bool = falseA field in this section holds a section header table index.
LINK_ORDER: bool = falseAdds special ordering requirements for link editors.
OS_NONCONFORMING: bool = falseThis section requires special OS-specific processing to avoid incorrect behavior.
GROUP: bool = falseThis section is a member of a section group.
TLS: bool = falseThis section holds Thread-Local Storage.
COMPRESSED: bool = falseIdentifies a section containing compressed data.
unused12: u8 = 0OS: packed union { MASK: u8, GNU: packed struct(u8) { unused0: u1 = 0, /// Not to be GCed by the linker RETAIN: bool = false, unused2: u6 = 0, }, MIPS: packed struct(u8) { unused0: u4 = 0, /// Section contains text/data which may be replicated in other sections. /// Linker must retain only one copy. NODUPES: bool = false, /// Linker must generate implicit hidden weak names. NAMES: bool = false, /// Section data local to process. LOCAL: bool = false, /// Do not strip this section. NOSTRIP: bool = false, }, ARM: packed struct(u8) { unused0: u5 = 0, /// Make code section unreadable when in execute-only mode PURECODE: bool = false, unused6: u2 = 0, }, } = .{ .MASK = 0 }PROC: packed union { MASK: u4, XCORE: packed struct(u4) { /// All sections with the "d" flag are grouped together by the linker to form /// the data section and the dp register is set to the start of the section by /// the boot code. DP_SECTION: bool = false, /// All sections with the "c" flag are grouped together by the linker to form /// the constant pool and the cp register is set to the start of the constant /// pool by the boot code. CP_SECTION: bool = false, unused2: u1 = 0, /// This section is excluded from the final executable or shared library. EXCLUDE: bool = false, }, X86_64: packed struct(u4) { /// If an object file section does not have this flag set, then it may not hold /// more than 2GB and can be freely referred to in objects using smaller code /// models. Otherwise, only objects using larger code models can refer to them. /// For example, a medium code model object can refer to data in a section that /// sets this flag besides being able to refer to data in a section that does /// not set it; likewise, a small code model object can refer only to code in a /// section that does not set this flag. LARGE: bool = false, unused1: u2 = 0, /// This section is excluded from the final executable or shared library. EXCLUDE: bool = false, }, HEX: packed struct(u4) { /// All sections with the GPREL flag are grouped into a global data area /// for faster accesses GPREL: bool = false, unused1: u2 = 0, /// This section is excluded from the final executable or shared library. EXCLUDE: bool = false, }, MIPS: packed struct(u4) { /// All sections with the GPREL flag are grouped into a global data area /// for faster accesses GPREL: bool = false, /// This section should be merged. MERGE: bool = false, /// Address size to be inferred from section entry size. ADDR: bool = false, /// Section data is string data by default. STRING: bool = false, }, } = .{ .MASK = 0 }2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355pub const SHF = packed struct(Word) {
/// Section data should be writable during execution.
WRITE: bool = false,
/// Section occupies memory during program execution.
ALLOC: bool = false,
/// Section contains executable machine instructions.
EXECINSTR: bool = false,
unused3: u1 = 0,
/// The data in this section may be merged.
MERGE: bool = false,
/// The data in this section is null-terminated strings.
STRINGS: bool = false,
/// A field in this section holds a section header table index.
INFO_LINK: bool = false,
/// Adds special ordering requirements for link editors.
LINK_ORDER: bool = false,
/// This section requires special OS-specific processing to avoid incorrect behavior.
OS_NONCONFORMING: bool = false,
/// This section is a member of a section group.
GROUP: bool = false,
/// This section holds Thread-Local Storage.
TLS: bool = false,
/// Identifies a section containing compressed data.
COMPRESSED: bool = false,
unused12: u8 = 0,
OS: packed union {
MASK: u8,
GNU: packed struct(u8) {
unused0: u1 = 0,
/// Not to be GCed by the linker
RETAIN: bool = false,
unused2: u6 = 0,
},
MIPS: packed struct(u8) {
unused0: u4 = 0,
/// Section contains text/data which may be replicated in other sections.
/// Linker must retain only one copy.
NODUPES: bool = false,
/// Linker must generate implicit hidden weak names.
NAMES: bool = false,
/// Section data local to process.
LOCAL: bool = false,
/// Do not strip this section.
NOSTRIP: bool = false,
},
ARM: packed struct(u8) {
unused0: u5 = 0,
/// Make code section unreadable when in execute-only mode
PURECODE: bool = false,
unused6: u2 = 0,
},
} = .{ .MASK = 0 },
PROC: packed union {
MASK: u4,
XCORE: packed struct(u4) {
/// All sections with the "d" flag are grouped together by the linker to form
/// the data section and the dp register is set to the start of the section by
/// the boot code.
DP_SECTION: bool = false,
/// All sections with the "c" flag are grouped together by the linker to form
/// the constant pool and the cp register is set to the start of the constant
/// pool by the boot code.
CP_SECTION: bool = false,
unused2: u1 = 0,
/// This section is excluded from the final executable or shared library.
EXCLUDE: bool = false,
},
X86_64: packed struct(u4) {
/// If an object file section does not have this flag set, then it may not hold
/// more than 2GB and can be freely referred to in objects using smaller code
/// models. Otherwise, only objects using larger code models can refer to them.
/// For example, a medium code model object can refer to data in a section that
/// sets this flag besides being able to refer to data in a section that does
/// not set it; likewise, a small code model object can refer only to code in a
/// section that does not set this flag.
LARGE: bool = false,
unused1: u2 = 0,
/// This section is excluded from the final executable or shared library.
EXCLUDE: bool = false,
},
HEX: packed struct(u4) {
/// All sections with the GPREL flag are grouped into a global data area
/// for faster accesses
GPREL: bool = false,
unused1: u2 = 0,
/// This section is excluded from the final executable or shared library.
EXCLUDE: bool = false,
},
MIPS: packed struct(u4) {
/// All sections with the GPREL flag are grouped into a global data area
/// for faster accesses
GPREL: bool = false,
/// This section should be merged.
MERGE: bool = false,
/// Address size to be inferred from section entry size.
ADDR: bool = false,
/// Section data is string data by default.
STRING: bool = false,
},
} = .{ .MASK = 0 },
}