aboutsummaryrefslogtreecommitdiff
path: root/src/link/Coff
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-03-30 18:52:56 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-03-30 21:08:31 +0200
commit216badef0bd90c6353bf32bd927e2c6d36b3ebf6 (patch)
treefc1ec7f502b30d4b0b103d624f2ea33e918df5e6 /src/link/Coff
parentba5302c4f88d2942890a5838e53eb078d61da123 (diff)
downloadzig-216badef0bd90c6353bf32bd927e2c6d36b3ebf6.tar.gz
zig-216badef0bd90c6353bf32bd927e2c6d36b3ebf6.zip
coff: use std.os.windows wrappers; fix relocating in-file
Diffstat (limited to 'src/link/Coff')
-rw-r--r--src/link/Coff/Relocation.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/link/Coff/Relocation.zig b/src/link/Coff/Relocation.zig
index d778206e60..6b35de93f4 100644
--- a/src/link/Coff/Relocation.zig
+++ b/src/link/Coff/Relocation.zig
@@ -74,7 +74,7 @@ pub fn getTargetAddress(self: Relocation, coff_file: *const Coff) ?u32 {
/// Returns `false` if obtaining the target address has been deferred until `flushModule`.
/// This can happen when trying to resolve address of an import table entry ahead of time.
-pub fn resolve(self: Relocation, atom_index: Atom.Index, code: []u8, coff_file: *Coff) bool {
+pub fn resolve(self: Relocation, atom_index: Atom.Index, code: []u8, image_base: u64, coff_file: *Coff) bool {
const atom = coff_file.getAtom(atom_index);
const source_sym = atom.getSymbol(coff_file);
const source_vaddr = source_sym.value + self.offset;
@@ -92,7 +92,7 @@ pub fn resolve(self: Relocation, atom_index: Atom.Index, code: []u8, coff_file:
const ctx: Context = .{
.source_vaddr = source_vaddr,
.target_vaddr = target_vaddr_with_addend,
- .image_base = coff_file.hot_state.loaded_base_address orelse coff_file.getImageBase(),
+ .image_base = image_base,
.code = code,
.ptr_width = coff_file.ptr_width,
};