aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/Symbol.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-07-15 06:47:13 +0200
committerJakub Konka <kubkon@jakubkonka.com>2021-07-15 18:49:47 +0200
commitec874a9b2bf24bb37f1e90558153bbf04ac5f22a (patch)
tree2b8544cf3422b200cde70f9ced99f2207fa00f75 /src/link/MachO/Symbol.zig
parent0135b4665988530c0bd6b36ef7cb93ecaf999776 (diff)
downloadzig-ec874a9b2bf24bb37f1e90558153bbf04ac5f22a.tar.gz
zig-ec874a9b2bf24bb37f1e90558153bbf04ac5f22a.zip
zld: move tracking binding for proxies into TextBlock
which is the source of binding rather than its target. That is, we now track by source.
Diffstat (limited to 'src/link/MachO/Symbol.zig')
-rw-r--r--src/link/MachO/Symbol.zig21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/link/MachO/Symbol.zig b/src/link/MachO/Symbol.zig
index 1c270e8510..28aee6eeb0 100644
--- a/src/link/MachO/Symbol.zig
+++ b/src/link/MachO/Symbol.zig
@@ -121,20 +121,11 @@ pub const Tentative = struct {
};
pub const Proxy = struct {
- /// Dynamic binding info - spots within the final
- /// executable where this proxy is referenced from.
- bind_info: std.ArrayListUnmanaged(struct {
- local_sym_index: u32,
- offset: u32,
- }) = .{},
-
/// Dylib where to locate this symbol.
/// null means self-reference.
file: ?*Dylib = null,
- pub fn deinit(proxy: *Proxy, allocator: *Allocator) void {
- proxy.bind_info.deinit(allocator);
- }
+ local_sym_index: u32 = 0,
pub fn dylibOrdinal(proxy: Proxy) u16 {
const dylib = proxy.file orelse return 0;
@@ -145,13 +136,10 @@ pub const Proxy = struct {
_ = fmt;
_ = options;
try std.fmt.format(writer, "Proxy {{ ", .{});
- if (self.bind_info.items.len > 0) {
- // TODO
- try std.fmt.format(writer, ".bind_info = {}, ", .{self.bind_info.items.len});
- }
if (self.file) |file| {
try std.fmt.format(writer, ".file = {s}, ", .{file.name.?});
}
+ try std.fmt.format(writer, ".local_sym_index = {d}, ", .{self.local_sym_index});
try std.fmt.format(writer, "}}", .{});
}
};
@@ -284,11 +272,6 @@ pub fn asNlist(symbol: *Symbol, zld: *Zld) !macho.nlist_64 {
pub fn deinit(symbol: *Symbol, allocator: *Allocator) void {
allocator.free(symbol.name);
-
- switch (symbol.payload) {
- .proxy => |*proxy| proxy.deinit(allocator),
- else => {},
- }
}
pub fn isStab(sym: macho.nlist_64) bool {