| ... | @@ -3311,6 +3311,7 @@ pub const gnu_hash = struct { | ... | @@ -3311,6 +3311,7 @@ pub const gnu_hash = struct { |
| 3311 | /// Resources: | 3311 | /// Resources: |
| 3312 | /// * https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html#hash | 3312 | /// * https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html#hash |
| 3313 | /// * https://flapenguin.me/elf-dt-hash | 3313 | /// * https://flapenguin.me/elf-dt-hash |
| | 3314 | /// * https://github.com/IBM/s390x-abi |
| 3314 | pub const hash = struct { | 3315 | pub const hash = struct { |
| 3315 | pub fn calculate(name: []const u8) u32 { | 3316 | pub fn calculate(name: []const u8) u32 { |
| 3316 | var h: u32 = 0; | 3317 | var h: u32 = 0; |
| ... | @@ -3322,7 +3323,7 @@ pub const hash = struct { | ... | @@ -3322,7 +3323,7 @@ pub const hash = struct { |
| 3322 | return h; | 3323 | return h; |
| 3323 | } | 3324 | } |
| 3324 | | 3325 | |
| 3325 | /// The header of a `SHT.HASH` section. Immediately followed by: | 3326 | /// The header of a `SHT.HASH` section on most architectures. Immediately followed by: |
| 3326 | /// * `buckets: [nbucket]u32` | 3327 | /// * `buckets: [nbucket]u32` |
| 3327 | /// * `chains: [nchain]u32` | 3328 | /// * `chains: [nchain]u32` |
| 3328 | /// | 3329 | /// |
| ... | @@ -3333,10 +3334,22 @@ pub const hash = struct { | ... | @@ -3333,10 +3334,22 @@ pub const hash = struct { |
| 3333 | /// | 3334 | /// |
| 3334 | /// `chain[sym_index]` is the index of the next symbol in the same bucket as `sym_index`. If | 3335 | /// `chain[sym_index]` is the index of the next symbol in the same bucket as `sym_index`. If |
| 3335 | /// `sym_index` is the last symbol in its bucket then the value is 0 (`STN_UNDEF`). | 3336 | /// `sym_index` is the last symbol in its bucket then the value is 0 (`STN_UNDEF`). |
| 3336 | pub const Header = extern struct { | 3337 | /// |
| | 3338 | /// See also `Header64`. |
| | 3339 | pub const Header32 = extern struct { |
| 3337 | nbucket: u32, | 3340 | nbucket: u32, |
| 3338 | nchain: u32, | 3341 | nchain: u32, |
| 3339 | }; | 3342 | }; |
| | 3343 | |
| | 3344 | /// The header of a `SHT.HASH` section on alpha and s390x. Immediately followed by: |
| | 3345 | /// * `buckets: [nbucket]u64` |
| | 3346 | /// * `chains: [nchain]u64` |
| | 3347 | /// |
| | 3348 | /// See also `Header32`. |
| | 3349 | pub const Header64 = extern struct { |
| | 3350 | nbucket: u64, |
| | 3351 | nchain: u64, |
| | 3352 | }; |
| 3340 | }; | 3353 | }; |
| 3341 | | 3354 | |
| 3342 | pub const EhdrFlags = packed union(Word) { | 3355 | pub const EhdrFlags = packed union(Word) { |