authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-04 00:50:34+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-04 01:16:23+02:00
loga82f446d91c9e764719d34188de5d794ee24dda8
treed4755d27e9547f683fbcc668cf858d279bc4dcb2
parent9e076d8c7548eacc0bbbad770e5e06c3a427c687
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.elf: change STV enum from u2 to u3

In gABI 4.3, st_other was changed such that the lower 3 bits are reserved for the visibility, up from the previous 2 bits.

3 files changed, 3 insertions(+), 3 deletions(-)

lib/std/Build/Step/CheckObject.zig+1-1
...@@ -2226,7 +2226,7 @@ const ElfDumper = struct {...@@ -2226,7 +2226,7 @@ const ElfDumper = struct {
2226 try writer.print(" {s}", .{sym_bind});2226 try writer.print(" {s}", .{sym_bind});
2227 }2227 }
22282228
2229 const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));2229 const sym_vis = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other))));
2230 try writer.print(" {s}", .{@tagName(sym_vis)});2230 try writer.print(" {s}", .{@tagName(sym_vis)});
22312231
2232 const sym_name = switch (sym.st_type()) {2232 const sym_name = switch (sym.st_type()) {
lib/std/elf.zig+1-1
...@@ -2303,7 +2303,7 @@ pub const R_PPC64 = enum(u32) {...@@ -2303,7 +2303,7 @@ pub const R_PPC64 = enum(u32) {
2303 _,2303 _,
2304};2304};
23052305
2306pub const STV = enum(u2) {2306pub const STV = enum(u3) {
2307 DEFAULT = 0,2307 DEFAULT = 0,
2308 INTERNAL = 1,2308 INTERNAL = 1,
2309 HIDDEN = 2,2309 HIDDEN = 2,
tools/gen_stubs.zig+1-1
...@@ -608,7 +608,7 @@ fn parseElf(parse: Parse, comptime is_64: bool, comptime endian: builtin.Endian)...@@ -608,7 +608,7 @@ fn parseElf(parse: Parse, comptime is_64: bool, comptime endian: builtin.Endian)
608 const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0));608 const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0));
609 const ty = @as(u4, @truncate(sym.st_info));609 const ty = @as(u4, @truncate(sym.st_info));
610 const binding = @as(u4, @truncate(sym.st_info >> 4));610 const binding = @as(u4, @truncate(sym.st_info >> 4));
611 const visib = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));611 const visib = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other))));
612 const size = s(sym.st_size);612 const size = s(sym.st_size);
613613
614 if (size == 0) {614 if (size == 0) {