authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-14 04:12:05+02:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-08-16 10:37:20+01:00
log4f15073e4ffd095832fe3b25fcc89099a3c2e5a2
treecf27d2737f5d28441b663873e72f72dc6afbfd3f
parent45ad4aab95cf1916a0c63915584d8e1c12dccdc7
signaturelock-open Commit is signed but in an unrecognized format.

std.elf: update hash structures for the 64-bit variant


1 files changed, 15 insertions(+), 2 deletions(-)

lib/std/elf.zig+15-2
...@@ -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#hash3312/// * https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html#hash
3313/// * https://flapenguin.me/elf-dt-hash3313/// * https://flapenguin.me/elf-dt-hash
3314/// * https://github.com/IBM/s390x-abi
3314pub const hash = struct {3315pub 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 }
33243325
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`. If3335 /// `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};
33413354
3342pub const EhdrFlags = packed union(Word) {3355pub const EhdrFlags = packed union(Word) {