mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
linker: Don't copy protected visibility from shared object symbols
Resolves #30081
This commit is contained in:
committed by
Andrew Kelley
parent
badd252036
commit
d3fcfb0581
@@ -309,8 +309,15 @@ pub fn setOutputSym(symbol: Symbol, elf_file: *Elf, out: *elf.Elf64_Sym) void {
|
||||
break :blk symbol.address(.{ .plt = false }, elf_file) - elf_file.tlsAddress();
|
||||
break :blk symbol.address(.{ .plt = false, .trampoline = false }, elf_file);
|
||||
};
|
||||
const st_other = blk: {
|
||||
const vis = @as(elf.STV, @enumFromInt(@as(u3, @truncate(esym.st_other))));
|
||||
if (file_ptr != .shared_object or vis != elf.STV.PROTECTED) break :blk esym.st_other;
|
||||
// Reset protected visibility to default for symbols originating in shared objects
|
||||
break :blk esym.st_other & 0b11111000;
|
||||
};
|
||||
|
||||
out.st_info = (st_bind << 4) | st_type;
|
||||
out.st_other = esym.st_other;
|
||||
out.st_other = st_other;
|
||||
out.st_shndx = st_shndx;
|
||||
out.st_value = @intCast(st_value);
|
||||
out.st_size = esym.st_size;
|
||||
|
||||
Reference in New Issue
Block a user