diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-07 14:51:33 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-16 19:33:05 +0200 |
| commit | 1772dbb503429fcee453a3ee6db1eed4dfe7c5c9 (patch) | |
| tree | cf39909fb07fd3b7b7943f66e927d25eb60cc728 /src | |
| parent | 06f3b385c409a576b7c962f22c154edb307dd90b (diff) | |
| download | zig-1772dbb503429fcee453a3ee6db1eed4dfe7c5c9.tar.gz zig-1772dbb503429fcee453a3ee6db1eed4dfe7c5c9.zip | |
elf: fix generating .plt.got indirection
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/Elf/Atom.zig | 2 | ||||
| -rw-r--r-- | src/link/Elf/synthetic_sections.zig | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/link/Elf/Atom.zig b/src/link/Elf/Atom.zig index e42ddace4e..9720da5718 100644 --- a/src/link/Elf/Atom.zig +++ b/src/link/Elf/Atom.zig @@ -697,6 +697,8 @@ fn reportUndefined( } pub fn resolveRelocsAlloc(self: Atom, elf_file: *Elf, code: []u8) !void { + relocs_log.debug("0x{x}: {s}", .{ self.value, self.name(elf_file) }); + const file_ptr = self.file(elf_file).?; var stream = std.io.fixedBufferStream(code); const cwriter = stream.writer(); diff --git a/src/link/Elf/synthetic_sections.zig b/src/link/Elf/synthetic_sections.zig index 63848f05fd..1f336043e8 100644 --- a/src/link/Elf/synthetic_sections.zig +++ b/src/link/Elf/synthetic_sections.zig @@ -795,6 +795,8 @@ pub const PltGotSection = struct { pub fn addSymbol(plt_got: *PltGotSection, sym_index: Symbol.Index, elf_file: *Elf) !void { const index = @as(u32, @intCast(plt_got.symbols.items.len)); const symbol = elf_file.symbol(sym_index); + symbol.flags.has_plt = true; + symbol.flags.has_got = true; if (symbol.extra(elf_file)) |extra| { var new_extra = extra; new_extra.plt_got = index; |
