mirror of
https://github.com/ziglang/zig.git
synced 2026-02-19 15:58:50 +00:00
macho: count rebases for synthetic __objc_selrefs
This commit is contained in:
parent
2901026425
commit
429e542f3f
@ -2479,6 +2479,9 @@ fn initDyldInfoSections(self: *MachO) !void {
|
||||
nbinds += ctx.bind_relocs;
|
||||
nweak_binds += ctx.weak_bind_relocs;
|
||||
}
|
||||
if (self.getInternalObject()) |int| {
|
||||
nrebases += int.num_rebase_relocs;
|
||||
}
|
||||
try self.rebase.entries.ensureUnusedCapacity(gpa, nrebases);
|
||||
try self.bind.entries.ensureUnusedCapacity(gpa, nbinds);
|
||||
try self.weak_bind.entries.ensureUnusedCapacity(gpa, nweak_binds);
|
||||
|
||||
@ -8,6 +8,7 @@ strtab: std.ArrayListUnmanaged(u8) = .{},
|
||||
objc_methnames: std.ArrayListUnmanaged(u8) = .{},
|
||||
objc_selrefs: [@sizeOf(u64)]u8 = [_]u8{0} ** @sizeOf(u64),
|
||||
|
||||
num_rebase_relocs: u32 = 0,
|
||||
output_symtab_ctx: MachO.SymtabCtx = .{},
|
||||
|
||||
pub fn deinit(self: *InternalObject, allocator: Allocator) void {
|
||||
@ -115,6 +116,7 @@ fn addObjcSelrefsSection(
|
||||
},
|
||||
});
|
||||
atom.relocs = .{ .pos = 0, .len = 1 };
|
||||
self.num_rebase_relocs += 1;
|
||||
|
||||
return atom_index;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user