diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-06-23 16:20:20 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-06-24 08:12:17 +0200 |
| commit | 7c87f9c828282aa12fb2d77c9c6a2318d83b8dff (patch) | |
| tree | d1168ba85eca9ea505d901faecd97847b5bea76c /src/link | |
| parent | 3868864695b41c2c94f585b9644d3ed3bda39708 (diff) | |
| download | zig-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.zig | 2 | ||||
| -rw-r--r-- | src/link/Wasm.zig | 3 |
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 { |
