From 1d2199b71c06e97be407c2bd0b05c07c8bd6cd2c Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 3 Sep 2021 13:41:28 +0200 Subject: macho: dirty export trie when adding globals Similarly, dirty rebase info when adding a GOT atom. --- src/link/MachO.zig | 1 + src/link/MachO/TextBlock.zig | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/link/MachO.zig b/src/link/MachO.zig index dfd70c4492..cd5a0218d1 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -2312,6 +2312,7 @@ fn resolveSymbolsInObject( .local_sym_index = local_sym_index, .file = object_id, }; + self.export_info_dirty = true; } else if (symbolIsTentative(sym)) { // Symbol is a tentative definition. const resolv = self.symbol_resolver.getPtr(n_strx) orelse { diff --git a/src/link/MachO/TextBlock.zig b/src/link/MachO/TextBlock.zig index 160ba5cd8c..af9bf5b3eb 100644 --- a/src/link/MachO/TextBlock.zig +++ b/src/link/MachO/TextBlock.zig @@ -844,6 +844,9 @@ pub fn parseRelocs(self: *TextBlock, relocs: []macho.relocation_info, context: R .sect = context.macho_file.got_section_index.?, }; _ = try context.macho_file.allocateAtom(atom, match); + // TODO don't need both at once + context.macho_file.rebase_info_dirty = true; + context.macho_file.binding_info_dirty = true; } else if (parsed_rel.payload == .unsigned) { switch (parsed_rel.where) { .undef => { -- cgit v1.2.3