mirror of
https://github.com/ziglang/zig.git
synced 2026-01-02 03:25:01 +00:00
elf: fix generating .plt.got indirection
This commit is contained in:
parent
06f3b385c4
commit
1772dbb503
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user