| ... | @@ -309,8 +309,15 @@ pub fn setOutputSym(symbol: Symbol, elf_file: *Elf, out: *elf.Elf64_Sym) void { | ... | @@ -309,8 +309,15 @@ pub fn setOutputSym(symbol: Symbol, elf_file: *Elf, out: *elf.Elf64_Sym) void { |
| 309 | break :blk symbol.address(.{ .plt = false }, elf_file) - elf_file.tlsAddress(); | 309 | break :blk symbol.address(.{ .plt = false }, elf_file) - elf_file.tlsAddress(); |
| 310 | break :blk symbol.address(.{ .plt = false, .trampoline = false }, elf_file); | 310 | break :blk symbol.address(.{ .plt = false, .trampoline = false }, elf_file); |
| 311 | }; | 311 | }; |
| | 312 | const st_other = blk: { |
| | 313 | const vis = @as(elf.STV, @enumFromInt(@as(u3, @truncate(esym.st_other)))); |
| | 314 | if (file_ptr != .shared_object or vis != elf.STV.PROTECTED) break :blk esym.st_other; |
| | 315 | // Reset protected visibility to default for symbols originating in shared objects |
| | 316 | break :blk esym.st_other & 0b11111000; |
| | 317 | }; |
| | 318 | |
| 312 | out.st_info = (st_bind << 4) | st_type; | 319 | out.st_info = (st_bind << 4) | st_type; |
| 313 | out.st_other = esym.st_other; | 320 | out.st_other = st_other; |
| 314 | out.st_shndx = st_shndx; | 321 | out.st_shndx = st_shndx; |
| 315 | out.st_value = @intCast(st_value); | 322 | out.st_value = @intCast(st_value); |
| 316 | out.st_size = esym.st_size; | 323 | out.st_size = esym.st_size; |