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 {
33113311/// Resources:
33123312/// * https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html#hash
33133313/// * https://flapenguin.me/elf-dt-hash
3314/// * https://github.com/IBM/s390x-abi
33143315pub const hash = struct {
33153316 pub fn calculate(name: []const u8) u32 {
33163317 var h: u32 = 0;
......@@ -3322,7 +3323,7 @@ pub const hash = struct {
33223323 return h;
33233324 }
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:
33263327 /// * `buckets: [nbucket]u32`
33273328 /// * `chains: [nchain]u32`
33283329 ///
......@@ -3333,10 +3334,22 @@ pub const hash = struct {
33333334 ///
33343335 /// `chain[sym_index]` is the index of the next symbol in the same bucket as `sym_index`. If
33353336 /// `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 {
33373340 nbucket: u32,
33383341 nchain: u32,
33393342 };
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 };
33403353};
33413354
33423355pub const EhdrFlags = packed union(Word) {