authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-04-12 10:40:29+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-04-13 11:47:51+02:00
log38ecaf3ab6c71aae213edbd38b8f661a03035b3a
treef8aba91386c89374bb871ce3008a9e2022f1be7a
parenteba280ce20d308ec0abb17719ab4cc43a27901eb

macho: add machinery for emitting TLV refs


2 files changed, 4 insertions(+), 0 deletions(-)

src/link/MachO.zig+3
......@@ -613,6 +613,9 @@ pub fn flushModule(self: *MachO, comp: *Compilation, prog_node: *std.Progress.No
613613 if (self.dyld_stub_binder_index == null) {
614614 self.dyld_stub_binder_index = try self.addUndefined("dyld_stub_binder", .add_got);
615615 }
616 if (!self.base.options.single_threaded) {
617 _ = try self.addUndefined("_tlv_bootstrap", .none);
618 }
616619
617620 try self.createMhExecuteHeaderSymbol();
618621
src/link/MachO/Relocation.zig+1
......@@ -48,6 +48,7 @@ pub fn isResolvable(self: Relocation, macho_file: *MachO) bool {
4848pub fn getTargetAtomIndex(self: Relocation, macho_file: *MachO) ?Atom.Index {
4949 switch (self.type) {
5050 .got, .got_page, .got_pageoff => return macho_file.getGotAtomIndexForSymbol(self.target),
51 .tlv, .tlv_page, .tlv_pageoff => return macho_file.getTlvpAtomIndexForSymbol(self.target),
5152 else => {},
5253 }
5354 if (macho_file.getStubsAtomIndexForSymbol(self.target)) |stubs_atom| return stubs_atom;