authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-12 10:26:39+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-12 10:26:39+02:00
log993c75845605c7001c8b9e4526bc5344458570cb
tree268652130cba11de3c365129da98332954c8d842
parent26450ba0f6c48a445beca483141605b9a2407d20
parentd4984092a332e6b1564b7f43e5037da0a5b7e42f

Merge pull request 'Elf2: more SPARC relocations' (#37191) from alexrp/zig:elf2-sparc into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37191

3 files changed, 183 insertions(+), 35 deletions(-)

lib/std/debug/cpu_context.zig+46-8
......@@ -42,7 +42,7 @@ pub fn fromPosixSignalContext(ctx_ptr: ?*const anyopaque) ?Native {
4242 // Deal with some special cases first.
4343 if (native_arch.isArc() and native_os == .linux) {
4444 var native: Native = .{
45 .r = [_]u32{ uc.mcontext.r31, uc.mcontext.r30, 0, uc.mcontext.r28 } ++
45 .r = [_]Arc.Gpr{ uc.mcontext.r31, uc.mcontext.r30, 0, uc.mcontext.r28 } ++
4646 uc.mcontext.r27_26 ++
4747 uc.mcontext.r25_13 ++
4848 uc.mcontext.r12_0,
......@@ -100,15 +100,29 @@ pub fn fromPosixSignalContext(ctx_ptr: ?*const anyopaque) ?Native {
100100 .i = frame.i,
101101 .pc = uc.mcontext.pc,
102102 };
103 } else if (native_arch.isSparc() and native_os == .netbsd) {
104 // The kernel flushes all user windows before delivering a signal.
105 const save: *const [16]usize = @ptrFromInt(uc.mcontext.o[6] +% if (native_arch == .sparc64) 2047 else 0);
106
107 return .{
108 .g = [_]Sparc.Gpr{0} ++ uc.mcontext.g1_7,
109 .o = uc.mcontext.o,
110 .l = save[0..8].*,
111 .i = save[8..16].*,
112 .pc = uc.mcontext.pc,
113 };
114 } else if (native_arch == .sparc64 and native_os == .openbsd) {
115 // https://codeberg.org/ziglang/zig/issues/30958
116 return null;
103117 }
104118
105119 // Only unified conversions from here.
106120 return switch (native_arch) {
107121 .arm, .armeb, .thumb, .thumbeb => .{
108 .r = uc.mcontext.r ++ [_]u32{uc.mcontext.pc},
122 .r = uc.mcontext.r ++ [_]Arm.Gpr{uc.mcontext.pc},
109123 },
110124 .aarch64, .aarch64_be => .{
111 .x = uc.mcontext.x ++ [_]u64{uc.mcontext.lr},
125 .x = uc.mcontext.x ++ [_]Aarch64.Gpr{uc.mcontext.lr},
112126 .sp = uc.mcontext.sp,
113127 .pc = uc.mcontext.pc,
114128 },
......@@ -118,9 +132,9 @@ pub fn fromPosixSignalContext(ctx_ptr: ?*const anyopaque) ?Native {
118132 },
119133 .csky => .{
120134 .r = uc.mcontext.r0_13 ++
121 [_]u32{ uc.mcontext.r14, uc.mcontext.r15 } ++
135 [_]Csky.Gpr{ uc.mcontext.r14, uc.mcontext.r15 } ++
122136 uc.mcontext.r16_30 ++
123 [_]u32{uc.mcontext.r31},
137 [_]Csky.Gpr{uc.mcontext.r31},
124138 .pc = uc.mcontext.pc,
125139 },
126140 .hexagon, .loongarch32, .loongarch64, .mips, .mipsel, .mips64, .mips64el, .or1k => .{
......@@ -2557,7 +2571,17 @@ const signal_ucontext_t = switch (native_os) {
25572571 },
25582572 },
25592573 // https://github.com/openbsd/src/blob/42468faed8369d07ae49ae02dd71ec34f59b66cd/sys/arch/sparc64/include/signal.h
2560 .sparc64 => @compileError("sparc64-openbsd ucontext_t missing"),
2574 .sparc64 => extern struct {
2575 _cookie: i64,
2576 mcontext: extern struct {
2577 sp: u64,
2578 pc: u64,
2579 _npc: i64,
2580 _tstate: i64,
2581 g1: u64,
2582 o0: u64,
2583 },
2584 },
25612585 // https://github.com/openbsd/src/blob/42468faed8369d07ae49ae02dd71ec34f59b66cd/sys/arch/sh/include/signal.h
25622586 .sh => extern struct {
25632587 pc: u32,
......@@ -2694,8 +2718,22 @@ const signal_ucontext_t = switch (native_os) {
26942718 pc: usize,
26952719 },
26962720 // https://github.com/NetBSD/src/blob/861008c62187bf7bc0aac4d81e52ed6eee4d0c74/sys/arch/sparc/include/mcontext.h
2697 .sparc => @compileError("sparc-netbsd mcontext_t missing"),
2698 .sparc64 => @compileError("sparc64-netbsd mcontext_t missing"),
2721 .sparc => extern struct {
2722 _psr: i32 align(8),
2723 pc: u32,
2724 _npc: i32,
2725 _y: i32,
2726 g1_7: [7]u32,
2727 o: [8]u32,
2728 },
2729 .sparc64 => extern struct {
2730 _ccr: i64 align(16),
2731 pc: u64,
2732 _npc: i64,
2733 _y: i64,
2734 g1_7: [7]u64,
2735 o: [8]u64,
2736 },
26992737 // https://github.com/NetBSD/src/blob/861008c62187bf7bc0aac4d81e52ed6eee4d0c74/sys/arch/sh3/include/mcontext.h
27002738 .sh, .sheb => extern struct {
27012739 _gbr: i32,
src/link/Elf2.zig+128-27
......@@ -1356,6 +1356,7 @@ const SymbolReloc = struct {
13561356 @"32[10:0]",
13571357 @"32[11:0]",
13581358 @"32[12:0]",
1359 @"32[18:0]",
13591360 @"32[21:0]",
13601361 @"32[21:10]",
13611362 @"32[24:5]",
......@@ -1399,6 +1400,7 @@ const SymbolReloc = struct {
13991400 @"12",
14001401 @"22",
14011402 @"32",
1403 @"42",
14021404 @"52",
14031405 },
14041406
......@@ -1418,6 +1420,7 @@ const SymbolReloc = struct {
14181420 .@"12" => .{ 12, false },
14191421 .@"22" => .{ 22, false },
14201422 .@"32" => .{ 32, false },
1423 .@"42" => .{ 42, false },
14211424 .@"52" => .{ 52, false },
14221425 };
14231426
......@@ -1438,6 +1441,7 @@ const SymbolReloc = struct {
14381441 .@"32[10:0]" => .{ 32, 10, 0 },
14391442 .@"32[11:0]" => .{ 32, 11, 0 },
14401443 .@"32[12:0]" => .{ 32, 12, 0 },
1444 .@"32[18:0]" => .{ 32, 18, 0 },
14411445 .@"32[21:0]" => .{ 32, 21, 0 },
14421446 .@"32[21:10]" => .{ 32, 21, 10 },
14431447 .@"32[24:5]" => .{ 32, 24, 5 },
......@@ -1500,7 +1504,10 @@ const SymbolReloc = struct {
15001504 larch_b26,
15011505 larch_call36,
15021506
1507 sparc_hix22,
15031508 sparc_le_hix22,
1509 sparc_wdisp10,
1510 sparc_wdisp16,
15041511
15051512 fn applyInner(
15061513 s: Special,
......@@ -1598,6 +1605,17 @@ const SymbolReloc = struct {
15981605 else => unreachable,
15991606 }
16001607 },
1608
1609 .sparc_hix22 => {
1610 const dest_ptr: *align(1) packed struct(u32) {
1611 imm22: u22,
1612 b22_31: u10,
1613 } = @ptrCast(dest_slice);
1614 elf.targetStore(dest_ptr, .{
1615 .imm22 = @truncate(~(target.value(elf) +% addend) >> 10),
1616 .b22_31 = elf.targetLoad(dest_ptr).b22_31,
1617 });
1618 },
16011619 .sparc_le_hix22 => {
16021620 const tls_phndx = elf.getNode(elf.ni.tls.unwrap().?).segment;
16031621 const tls_size: u64 = switch (elf.phdrSlice()) {
......@@ -1615,6 +1633,57 @@ const SymbolReloc = struct {
16151633 .b22_31 = elf.targetLoad(dest_ptr).b22_31,
16161634 });
16171635 },
1636 .sparc_wdisp16, .sparc_wdisp10 => {
1637 const target_vaddr: u64 = elf.pltEntryTargetAddr(target) orelse target.value(elf);
1638 const jump_offset: i64 = @bitCast(target_vaddr +% addend -% dest_vaddr);
1639 if ((jump_offset >> 2) << 2 != jump_offset) {
1640 return error.RelocationMisaligned;
1641 }
1642 const shifted_jump_offset: i64 = @shrExact(jump_offset, 2);
1643 switch (s) {
1644 .sparc_wdisp10 => {
1645 if ((shifted_jump_offset << (64 - 10)) >> (64 - 10) != shifted_jump_offset) {
1646 return error.RelocationOverflow;
1647 }
1648 const truncated: i10 = @intCast(shifted_jump_offset);
1649 const parts: packed struct { lo8: u8, hi2: u2 } = @bitCast(truncated);
1650 const inst: *align(1) packed struct(u32) {
1651 b0_4: u5,
1652 disp10: u8,
1653 b13_18: u6,
1654 d2: u2,
1655 b21_31: u11,
1656 } = @ptrCast(dest_slice[0..4]);
1657 elf.targetStore(inst, .{
1658 .b0_4 = elf.targetLoad(inst).b0_4,
1659 .disp10 = parts.lo8,
1660 .b13_18 = elf.targetLoad(inst).b13_18,
1661 .d2 = parts.hi2,
1662 .b21_31 = elf.targetLoad(inst).b21_31,
1663 });
1664 },
1665 .sparc_wdisp16 => {
1666 if ((shifted_jump_offset << (64 - 16)) >> (64 - 16) != shifted_jump_offset) {
1667 return error.RelocationOverflow;
1668 }
1669 const truncated: i16 = @intCast(shifted_jump_offset);
1670 const parts: packed struct { lo14: u14, hi2: u2 } = @bitCast(truncated);
1671 const inst: *align(1) packed struct(u32) {
1672 disp14: u14,
1673 b14_19: u6,
1674 d2: u2,
1675 b22_31: u10,
1676 } = @ptrCast(dest_slice[0..4]);
1677 elf.targetStore(inst, .{
1678 .disp14 = parts.lo14,
1679 .b14_19 = elf.targetLoad(inst).b14_19,
1680 .d2 = parts.hi2,
1681 .b22_31 = elf.targetLoad(inst).b22_31,
1682 });
1683 },
1684 else => unreachable,
1685 }
1686 },
16181687 }
16191688 }
16201689 };
......@@ -1649,6 +1718,10 @@ const SymbolReloc = struct {
16491718 .larch_b21,
16501719 .larch_b26,
16511720 .larch_call36,
1721
1722 .sparc_hix22,
1723 .sparc_wdisp10,
1724 .sparc_wdisp16,
16521725 => false,
16531726 },
16541727 },
......@@ -9000,38 +9073,31 @@ fn addRelocAssumeCapacity(
90009073 .JMP_SLOT,
90019074 .RELATIVE,
90029075 .IRELATIVE,
9076 .TLS_DTPMOD32,
9077 .TLS_DTPMOD64,
9078 .TLS_TPOFF32,
9079 .TLS_TPOFF64,
90039080 => return error.NonStaticRelocation,
90049081
9005 .WDISP22,
9006 .HI22,
9007 .LO10,
9082 // Nobody seems to support these.
90089083 .HIPLT22,
90099084 .LOPLT10,
90109085 .PCPLT22,
90119086 .PCPLT10,
9012 .OLO10,
9013 .HH22,
9014 .HM10,
9015 .LM22,
9016 .PC_HH22,
9017 .PC_HM10,
9018 .PC_LM22,
9019 .WDISP16,
9020 .WDISP19,
9021 .HIX22,
9022 .LOX10,
9023 .REGISTER,
9024 .TLS_IE_HI22,
9025 .TLS_IE_LO10,
9026 .TLS_DTPMOD32,
9027 .TLS_DTPMOD64,
9028 .H34,
9029 .WDISP10,
90309087 => return error.UnimplementedRelocation,
90319088
9089 // Needs to use the second addend in `ELF64_R_TYPE_DATA(reloc.r_info)` which we currently can't model.
9090 .OLO10 => return error.UnimplementedRelocation,
9091
9092 // Does not patch any bytes. Together with `STT_SPARC_REGISTER`, this is used to indicate that an object
9093 // file owns a global register and what value it should be initialized to. I don't think this sees any
9094 // real-world use.
9095 .REGISTER => return error.UnimplementedRelocation,
9096
90329097 // These need similar handling to `R_X86_64_GOTOFF64`. No compiler seems to emit them though.
9033 .GOTDATA_HIX22 => return error.UnimplementedRelocation,
9034 .GOTDATA_LOX10 => return error.UnimplementedRelocation,
9098 .GOTDATA_HIX22,
9099 .GOTDATA_LOX10,
9100 => return error.UnimplementedRelocation,
90359101
90369102 // These relocations signal that certain relaxations are legal, but this linker does
90379103 // not yet implement relaxation, so these are ignored.
......@@ -9063,15 +9129,26 @@ fn addRelocAssumeCapacity(
90639129 .DISP32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32", .cast = .signed, .shift = .@"0" })),
90649130 .DISP64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"64", .cast = .signed, .shift = .@"0" })),
90659131
9066 .SIZE32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.size, .{ .dest = .@"32", .cast = .unsigned, .shift = .@"0" })),
9067 .SIZE64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.size, .{ .dest = .@"64", .cast = .unsigned, .shift = .@"0" })),
9132 .SIZE32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.size, .{ .dest = .@"32", .cast = .unsigned, .shift = .@"0" })),
9133 .SIZE64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.size, .{ .dest = .@"64", .cast = .unsigned, .shift = .@"0" })),
90689134
90699135 .PCPLT32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltrel, .{ .dest = .@"32", .cast = .signed, .shift = .@"0" })),
90709136 .PLT32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltabs, .{ .dest = .@"32", .cast = .unsigned, .shift = .@"0" })),
90719137 .PLT64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltabs, .{ .dest = .@"64", .cast = .unsigned, .shift = .@"0" })),
90729138
9139 .WDISP10 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .special(.sparc_wdisp10)),
9140 .WDISP16 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .special(.sparc_wdisp16)),
9141 .WDISP19 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltrel, .{ .dest = .@"32[18:0]", .cast = .signed, .shift = .@"2_exact" })),
9142 .WDISP22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltrel, .{ .dest = .@"32[21:0]", .cast = .signed, .shift = .@"2_exact" })),
90739143 .WDISP30, .WPLT30 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.pltrel, .{ .dest = .@"32[29:0]", .cast = .signed, .shift = .@"2_exact" })),
90749144 .PC22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"10" })),
9145 .PC_LM22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
9146 .PC_HH22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"42" })),
9147 .HI22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"10" })),
9148 .LM22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
9149 .HH22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"42" })),
9150 .HIX22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .special(.sparc_hix22)),
9151 .H34 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"12" })),
90759152 .H44 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[21:0]", .cast = .unsigned, .shift = .@"22" })),
90769153 .M44 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"12" })),
90779154
......@@ -9079,8 +9156,6 @@ fn addRelocAssumeCapacity(
90799156 .TLS_LE_HIX22 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .special(.sparc_le_hix22)),
90809157 .TLS_DTPOFF32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.dtpoff, .{ .dest = .@"32", .cast = .unsigned, .shift = .@"0" })),
90819158 .TLS_DTPOFF64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.dtpoff, .{ .dest = .@"64", .cast = .unsigned, .shift = .@"0" })),
9082 .TLS_TPOFF32 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.tpoff, .{ .dest = .@"32", .cast = .signed, .shift = .@"0" })),
9083 .TLS_TPOFF64 => try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.tpoff, .{ .dest = .@"64", .cast = .signed, .shift = .@"0" })),
90849159
90859160 .GOT13 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .simple(.offset, .{ .dest = .@"32[12:0]", .cast = .unsigned, .shift = .@"0" })),
90869161 .GOT22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .simple(.offset, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
......@@ -9088,6 +9163,7 @@ fn addRelocAssumeCapacity(
90889163 .GOTDATA_OP_HIX22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .special(.sparc_op_hix22)),
90899164 .TLS_GD_HI22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .tlsgd0 = target }, addend, .simple(.offset, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
90909165 .TLS_LDM_HI22 => elf.addGotRelocAssumeCapacity(node, offset, .tlsld0, addend, .simple(.offset, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
9166 .TLS_IE_HI22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .tpoff = target }, addend, .simple(.offset, .{ .dest = .@"32[21:0]", .cast = .trunc, .shift = .@"10" })),
90919167 // zig fmt: on
90929168
90939169 .TLS_GD_CALL, .TLS_LDM_CALL => {
......@@ -9109,6 +9185,22 @@ fn addRelocAssumeCapacity(
91099185 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
91109186 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"0" }));
91119187 },
9188 .PC_HM10 => {
9189 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
9190 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.rel, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"32" }));
9191 },
9192 .LO10 => {
9193 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
9194 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"0" }));
9195 },
9196 .HM10 => {
9197 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
9198 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"32" }));
9199 },
9200 .LOX10 => {
9201 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b111" });
9202 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"0" }));
9203 },
91129204 .L44 => {
91139205 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:12] = 0b0" });
91149206 try elf.addSymbolRelocAssumeCapacity(node, offset, target, addend, .simple(.abs, .{ .dest = .@"32[11:0]", .cast = .trunc, .shift = .@"0" }));
......@@ -9133,6 +9225,10 @@ fn addRelocAssumeCapacity(
91339225 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
91349226 elf.addGotRelocAssumeCapacity(node, offset, .tlsld0, addend, .simple(.offset, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"0" }));
91359227 },
9228 .TLS_IE_LO10 => {
9229 try elf.one_shot_fixups.append(elf.base.comp.gpa, .{ .node = node, .offset = offset, .action = .@"32[12:10] = 0b000" });
9230 elf.addGotRelocAssumeCapacity(node, offset, .{ .tpoff = target }, addend, .simple(.offset, .{ .dest = .@"32[9:0]", .cast = .trunc, .shift = .@"0" }));
9231 },
91369232 },
91379233 .X86_64 => rel_type: switch (@"type".X86_64) {
91389234 .NONE => {},
......@@ -9256,12 +9352,17 @@ fn addSymbolRelocAssumeCapacity(
92569352 .larch_pcala_hi20,
92579353 .larch_pcala64_lo20,
92589354 .larch_pcala64_hi12,
9355
9356 .sparc_hix22,
92599357 => true,
92609358
92619359 .larch_b21,
92629360 .larch_b26,
92639361 .larch_call36,
9362
92649363 .sparc_le_hix22,
9364 .sparc_wdisp10,
9365 .sparc_wdisp16,
92659366 => false,
92669367 },
92679368 };
test/tests.zig+9
......@@ -1566,6 +1566,15 @@ const module_test_targets = blk: {
15661566 .link_libc = true,
15671567 },
15681568
1569 .{
1570 .target = .{
1571 .cpu_arch = .sparc64,
1572 .os_tag = .openbsd,
1573 .abi = .none,
1574 },
1575 .link_libc = true,
1576 },
1577
15691578 .{
15701579 .target = .{
15711580 .cpu_arch = .x86,