Commit 210b764c03
Changed files (3)
src
src/link/Elf/Object.zig
@@ -634,7 +634,7 @@ pub fn claimUnresolved(self: *Object, elf_file: *Elf) void {
const is_import = blk: {
if (!elf_file.isEffectivelyDynLib()) break :blk false;
- const vis = @as(elf.STV, @enumFromInt(esym.st_other));
+ const vis: elf.STV = @enumFromInt(@as(u3, @truncate(esym.st_other)));
if (vis == .HIDDEN) break :blk false;
break :blk true;
};
@@ -707,7 +707,7 @@ pub fn markImportsExports(self: *Object, elf_file: *Elf) void {
const file = sym.file(elf_file).?;
// https://github.com/ziglang/zig/issues/21678
if (@as(u16, @bitCast(sym.version_index)) == @as(u16, @bitCast(elf.Versym.LOCAL))) continue;
- const vis: elf.STV = @enumFromInt(sym.elfSym(elf_file).st_other);
+ const vis: elf.STV = @enumFromInt(@as(u3, @truncate(sym.elfSym(elf_file).st_other)));
if (vis == .HIDDEN) continue;
if (file == .shared_object and !sym.isAbs(elf_file)) {
sym.flags.import = true;
src/link/Elf/ZigObject.zig
@@ -617,7 +617,7 @@ pub fn claimUnresolved(self: *ZigObject, elf_file: *Elf) void {
const is_import = blk: {
if (!elf_file.isEffectivelyDynLib()) break :blk false;
- const vis = @as(elf.STV, @enumFromInt(esym.st_other));
+ const vis: elf.STV = @enumFromInt(@as(u3, @truncate(esym.st_other)));
if (vis == .HIDDEN) break :blk false;
break :blk true;
};
@@ -695,7 +695,7 @@ pub fn markImportsExports(self: *ZigObject, elf_file: *Elf) void {
const file = sym.file(elf_file).?;
// https://github.com/ziglang/zig/issues/21678
if (@as(u16, @bitCast(sym.version_index)) == @as(u16, @bitCast(elf.Versym.LOCAL))) continue;
- const vis: elf.STV = @enumFromInt(sym.elfSym(elf_file).st_other);
+ const vis: elf.STV = @enumFromInt(@as(u3, @truncate(sym.elfSym(elf_file).st_other)));
if (vis == .HIDDEN) continue;
if (file == .shared_object and !sym.isAbs(elf_file)) {
sym.flags.import = true;