diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-03-28 14:13:39 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-03-28 14:13:39 +0200 |
| commit | db877df8eb1831891fc1f3cb6dab1503868b5732 (patch) | |
| tree | f23e2edcc7cfafaf09b05228b1f67f74afc3ae78 /src/link/Coff/Relocation.zig | |
| parent | fb3345e346d26cfac01e45e3662385c587ec3462 (diff) | |
| download | zig-db877df8eb1831891fc1f3cb6dab1503868b5732.tar.gz zig-db877df8eb1831891fc1f3cb6dab1503868b5732.zip | |
coff: move import table definition into a separate ImportTable.zig module
Diffstat (limited to 'src/link/Coff/Relocation.zig')
| -rw-r--r-- | src/link/Coff/Relocation.zig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/link/Coff/Relocation.zig b/src/link/Coff/Relocation.zig index 5dcb0552fc..45f3a97052 100644 --- a/src/link/Coff/Relocation.zig +++ b/src/link/Coff/Relocation.zig @@ -61,8 +61,13 @@ pub fn getTargetAddress(self: Relocation, coff_file: *const Coff) ?u32 { .import, .import_page, .import_pageoff => { const sym = coff_file.getSymbol(self.target); - const itab = coff_file.import_tables.get(sym.value) orelse return null; - return itab.getImportAddress(coff_file, self.target); + const index = coff_file.import_tables.getIndex(sym.value) orelse return null; + const itab = coff_file.import_tables.values()[index]; + return itab.getImportAddress(self.target, .{ + .coff_file = coff_file, + .index = index, + .name_off = sym.value, + }); }, } } |
