| ... | @@ -488,7 +488,7 @@ pub fn linkWithZld( | ... | @@ -488,7 +488,7 @@ pub fn linkWithZld( |
| 488 | } | 488 | } |
| 489 | | 489 | |
| 490 | try writeAtoms(macho_file); | 490 | try writeAtoms(macho_file); |
| 491 | if (macho_file.requiresThunks()) try writeThunks(macho_file); | 491 | if (macho_file.base.options.target.cpu.arch == .aarch64) try writeThunks(macho_file); |
| 492 | try writeDyldPrivateAtom(macho_file); | 492 | try writeDyldPrivateAtom(macho_file); |
| 493 | | 493 | |
| 494 | if (macho_file.stubs_section_index) |_| { | 494 | if (macho_file.stubs_section_index) |_| { |
| ... | @@ -778,7 +778,7 @@ fn writeDyldPrivateAtom(macho_file: *MachO) !void { | ... | @@ -778,7 +778,7 @@ fn writeDyldPrivateAtom(macho_file: *MachO) !void { |
| 778 | } | 778 | } |
| 779 | | 779 | |
| 780 | fn writeThunks(macho_file: *MachO) !void { | 780 | fn writeThunks(macho_file: *MachO) !void { |
| 781 | assert(macho_file.requiresThunks()); | 781 | assert(macho_file.base.options.target.cpu.arch == .aarch64); |
| 782 | const gpa = macho_file.base.allocator; | 782 | const gpa = macho_file.base.allocator; |
| 783 | | 783 | |
| 784 | const sect_id = macho_file.text_section_index orelse return; | 784 | const sect_id = macho_file.text_section_index orelse return; |
| ... | @@ -991,7 +991,7 @@ fn calcSectionSizes(macho_file: *MachO) !void { | ... | @@ -991,7 +991,7 @@ fn calcSectionSizes(macho_file: *MachO) !void { |
| 991 | for (slice.items(.header), 0..) |*header, sect_id| { | 991 | for (slice.items(.header), 0..) |*header, sect_id| { |
| 992 | if (header.size == 0) continue; | 992 | if (header.size == 0) continue; |
| 993 | if (macho_file.text_section_index) |txt| { | 993 | if (macho_file.text_section_index) |txt| { |
| 994 | if (txt == sect_id and macho_file.requiresThunks()) continue; | 994 | if (txt == sect_id and macho_file.base.options.target.cpu.arch == .aarch64) continue; |
| 995 | } | 995 | } |
| 996 | | 996 | |
| 997 | var atom_index = slice.items(.first_atom_index)[sect_id] orelse continue; | 997 | var atom_index = slice.items(.first_atom_index)[sect_id] orelse continue; |
| ... | @@ -1017,7 +1017,7 @@ fn calcSectionSizes(macho_file: *MachO) !void { | ... | @@ -1017,7 +1017,7 @@ fn calcSectionSizes(macho_file: *MachO) !void { |
| 1017 | } | 1017 | } |
| 1018 | } | 1018 | } |
| 1019 | | 1019 | |
| 1020 | if (macho_file.text_section_index != null and macho_file.requiresThunks()) { | 1020 | if (macho_file.text_section_index != null and macho_file.base.options.target.cpu.arch == .aarch64) { |
| 1021 | // Create jump/branch range extenders if needed. | 1021 | // Create jump/branch range extenders if needed. |
| 1022 | try thunks.createThunks(macho_file, macho_file.text_section_index.?); | 1022 | try thunks.createThunks(macho_file, macho_file.text_section_index.?); |
| 1023 | } | 1023 | } |