aboutsummaryrefslogtreecommitdiff
path: root/src/link
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-06-23 16:20:20 +0200
committerLuuk de Gram <luuk@degram.dev>2022-06-24 08:12:17 +0200
commit7c87f9c828282aa12fb2d77c9c6a2318d83b8dff (patch)
treed1168ba85eca9ea505d901faecd97847b5bea76c /src/link
parent3868864695b41c2c94f585b9644d3ed3bda39708 (diff)
downloadzig-7c87f9c828282aa12fb2d77c9c6a2318d83b8dff.tar.gz
zig-7c87f9c828282aa12fb2d77c9c6a2318d83b8dff.zip
link:clarification & enable MachO getGlobalSymbol
This adds clarification to the getGlobalSymbol doc comments, as well as renames the `addExternFn` function for MachO to `getGlobalSymbol`. This function will now be called from 'src/link.zig' as well. Finally, this also enables compiling zig's libc using LLVM even though the `fno-LLVM` flag is given.
Diffstat (limited to 'src/link')
-rw-r--r--src/link/MachO.zig2
-rw-r--r--src/link/Wasm.zig3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index a7681e976d..0c44901d29 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -5366,7 +5366,7 @@ fn addAtomToSection(self: *MachO, atom: *Atom, match: MatchingSection) !void {
}
}
-pub fn addExternFn(self: *MachO, name: []const u8) !u32 {
+pub fn getGlobalSymbol(self: *MachO, name: []const u8) !u32 {
const sym_name = try std.fmt.allocPrint(self.base.allocator, "_{s}", .{name});
defer self.base.allocator.free(sym_name);
const n_strx = try self.makeString(sym_name);
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index d10690142f..4357a588a1 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -864,7 +864,8 @@ pub fn lowerUnnamedConst(self: *Wasm, tv: TypedValue, decl_index: Module.Decl.In
return atom.sym_index;
}
-/// Returns the symbol index from the name of an intrinsic.
+/// Returns the symbol index from a symbol of which its flag is set global,
+/// such as an exported or imported symbol.
/// If the symbol does not yet exist, creates a new one symbol instead
/// and then returns the index to it.
pub fn getGlobalSymbol(self: *Wasm, name: []const u8) !u32 {