mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
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.
This commit is contained in:
parent
9e076d8c75
commit
a82f446d91
3 changed files with 3 additions and 3 deletions
|
|
@ -2226,7 +2226,7 @@ const ElfDumper = struct {
|
||||||
try writer.print(" {s}", .{sym_bind});
|
try writer.print(" {s}", .{sym_bind});
|
||||||
}
|
}
|
||||||
|
|
||||||
const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));
|
const sym_vis = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other))));
|
||||||
try writer.print(" {s}", .{@tagName(sym_vis)});
|
try writer.print(" {s}", .{@tagName(sym_vis)});
|
||||||
|
|
||||||
const sym_name = switch (sym.st_type()) {
|
const sym_name = switch (sym.st_type()) {
|
||||||
|
|
|
||||||
|
|
@ -2303,7 +2303,7 @@ pub const R_PPC64 = enum(u32) {
|
||||||
_,
|
_,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const STV = enum(u2) {
|
pub const STV = enum(u3) {
|
||||||
DEFAULT = 0,
|
DEFAULT = 0,
|
||||||
INTERNAL = 1,
|
INTERNAL = 1,
|
||||||
HIDDEN = 2,
|
HIDDEN = 2,
|
||||||
|
|
|
||||||
|
|
@ -608,7 +608,7 @@ fn parseElf(parse: Parse, comptime is_64: bool, comptime endian: builtin.Endian)
|
||||||
const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0));
|
const name = try arena.dupe(u8, mem.sliceTo(dynstr[s(sym.st_name)..], 0));
|
||||||
const ty = @as(u4, @truncate(sym.st_info));
|
const ty = @as(u4, @truncate(sym.st_info));
|
||||||
const binding = @as(u4, @truncate(sym.st_info >> 4));
|
const binding = @as(u4, @truncate(sym.st_info >> 4));
|
||||||
const visib = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other))));
|
const visib = @as(elf.STV, @enumFromInt(@as(u3, @truncate(sym.st_other))));
|
||||||
const size = s(sym.st_size);
|
const size = s(sym.st_size);
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue