aboutsummaryrefslogtreecommitdiff
path: root/src/link/Coff
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-04-01 11:51:05 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-04-01 14:22:44 +0200
commita88c0b4d089d286e36351cf476c8d982fb730541 (patch)
treea4d985e8a6bd7f7b36b66f24e21e1ff53ff5303a /src/link/Coff
parent2dd178443abcbd91a923c64a4fd066caef974a82 (diff)
downloadzig-a88c0b4d089d286e36351cf476c8d982fb730541.tar.gz
zig-a88c0b4d089d286e36351cf476c8d982fb730541.zip
link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`. In MachO, ensure we add every symbol marked with `-u` as undefined before proceeding with symbol resolution. Additionally, ensure those symbols are never garbage collected. MachO entry_in_dylib test: pass `-u _my_main` when linking executable so that it is not incorrectly garbage collected by the linker.
Diffstat (limited to 'src/link/Coff')
-rw-r--r--src/link/Coff/lld.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/link/Coff/lld.zig b/src/link/Coff/lld.zig
index 358c905b2c..01f724ed41 100644
--- a/src/link/Coff/lld.zig
+++ b/src/link/Coff/lld.zig
@@ -63,7 +63,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod
man = comp.cache_parent.obtain();
self.base.releaseLock();
- comptime assert(Compilation.link_hash_implementation_version == 7);
+ comptime assert(Compilation.link_hash_implementation_version == 8);
for (self.base.options.objects) |obj| {
_ = try man.addFile(obj.path, null);