| ... | ... | @@ -47,7 +47,7 @@ fn newSymbolAssumeCapacity(self: *LinkerDefined, name_off: u32, elf_file: *Elf) |
| 47 | 47 | const esym = self.symtab.addOneAssumeCapacity(); |
| 48 | 48 | esym.* = .{ |
| 49 | 49 | .st_name = name_off, |
| 50 | | .st_info = elf.STB_GLOBAL << 4, |
| 50 | .st_info = elf.STB_WEAK << 4, |
| 51 | 51 | .st_other = @intFromEnum(elf.STV.HIDDEN), |
| 52 | 52 | .st_shndx = elf.SHN_ABS, |
| 53 | 53 | .st_value = 0, |
| ... | ... | @@ -255,8 +255,10 @@ pub fn allocateSymbols(self: *LinkerDefined, elf_file: *Elf) void { |
| 255 | 255 | |
| 256 | 256 | // __dso_handle |
| 257 | 257 | if (self.dso_handle_index) |index| { |
| 258 | | const shdr = shdrs[1]; |
| 259 | | allocSymbol(self, index, shdr.sh_addr, 0, elf_file); |
| 258 | if (self.resolveSymbol(index, elf_file).file == self.index) { |
| 259 | const shdr = shdrs[1]; |
| 260 | allocSymbol(self, index, shdr.sh_addr, 0, elf_file); |
| 261 | } |
| 260 | 262 | } |
| 261 | 263 | |
| 262 | 264 | // __GNU_EH_FRAME_HDR |