| ... | @@ -795,6 +795,8 @@ const GotReloc = struct { | ... | @@ -795,6 +795,8 @@ const GotReloc = struct { |
| 795 | sparc_10, | 795 | sparc_10, |
| 796 | sparc_13, | 796 | sparc_13, |
| 797 | sparc_22, | 797 | sparc_22, |
| | 798 | sparc_ldm_hi22, |
| | 799 | sparc_ldm_lo10, |
| 798 | sparc_op_hix22, | 800 | sparc_op_hix22, |
| 799 | sparc_op_lox10, | 801 | sparc_op_lox10, |
| 800 | }; | 802 | }; |
| ... | @@ -920,6 +922,18 @@ const GotReloc = struct { | ... | @@ -920,6 +922,18 @@ const GotReloc = struct { |
| 920 | result.simm22 = @truncate(got_offset >> 10); | 922 | result.simm22 = @truncate(got_offset >> 10); |
| 921 | elf.targetStore(dest_ptr, result); | 923 | elf.targetStore(dest_ptr, result); |
| 922 | }, | 924 | }, |
| | 925 | .sparc_ldm_hi22 => { |
| | 926 | const dest_ptr: *link.sparc.reloc.Simm22 = @ptrCast(@alignCast(dest_slice)); |
| | 927 | var result = elf.targetLoad(dest_ptr); |
| | 928 | result.simm22 = @truncate((got_offset +% addend) >> 10); |
| | 929 | elf.targetStore(dest_ptr, result); |
| | 930 | }, |
| | 931 | .sparc_ldm_lo10 => { |
| | 932 | const dest_ptr: *link.sparc.reloc.Simm13 = @ptrCast(@alignCast(dest_slice)); |
| | 933 | var result = elf.targetLoad(dest_ptr); |
| | 934 | result.simm13 = @as(u10, @truncate(got_offset +% addend)); |
| | 935 | elf.targetStore(dest_ptr, result); |
| | 936 | }, |
| 923 | .sparc_op_hix22 => { | 937 | .sparc_op_hix22 => { |
| 924 | const dest_ptr: *link.sparc.reloc.Imm22 = @ptrCast(@alignCast(dest_slice)); | 938 | const dest_ptr: *link.sparc.reloc.Imm22 = @ptrCast(@alignCast(dest_slice)); |
| 925 | var result = elf.targetLoad(dest_ptr); | 939 | var result = elf.targetLoad(dest_ptr); |
| ... | @@ -6292,8 +6306,6 @@ fn addRelocAssumeCapacity( | ... | @@ -6292,8 +6306,6 @@ fn addRelocAssumeCapacity( |
| 6292 | .TLS_GD_HI22, | 6306 | .TLS_GD_HI22, |
| 6293 | .TLS_GD_LO10, | 6307 | .TLS_GD_LO10, |
| 6294 | .TLS_GD_CALL, | 6308 | .TLS_GD_CALL, |
| 6295 | .TLS_LDM_HI22, | | |
| 6296 | .TLS_LDM_LO10, | | |
| 6297 | .TLS_LDM_CALL, | 6309 | .TLS_LDM_CALL, |
| 6298 | .TLS_LDO_HIX22, | 6310 | .TLS_LDO_HIX22, |
| 6299 | .TLS_LDO_LOX10, | 6311 | .TLS_LDO_LOX10, |
| ... | @@ -6350,6 +6362,8 @@ fn addRelocAssumeCapacity( | ... | @@ -6350,6 +6362,8 @@ fn addRelocAssumeCapacity( |
| 6350 | .GOT10 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_10), | 6362 | .GOT10 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_10), |
| 6351 | .GOT13 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_13), | 6363 | .GOT13 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_13), |
| 6352 | .GOT22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_22), | 6364 | .GOT22 => elf.addGotRelocAssumeCapacity(node, offset, .{ .symbol = target }, addend, .sparc_22), |
| | 6365 | .TLS_LDM_HI22 => elf.addGotRelocAssumeCapacity(node, offset, .tlsld0, addend, .sparc_ldm_hi22), |
| | 6366 | .TLS_LDM_LO10 => elf.addGotRelocAssumeCapacity(node, offset, .tlsld0, addend, .sparc_ldm_lo10), |
| 6353 | // These need similar handling to `R_X86_64_GOTOFF64`. No compiler seems to emit them though. | 6367 | // These need similar handling to `R_X86_64_GOTOFF64`. No compiler seems to emit them though. |
| 6354 | .GOTDATA_HIX22 => @panic("TODO: R_SPARC_GOTDATA_HIX22"), | 6368 | .GOTDATA_HIX22 => @panic("TODO: R_SPARC_GOTDATA_HIX22"), |
| 6355 | .GOTDATA_LOX10 => @panic("TODO: R_SPARC_GOTDATA_LOX10"), | 6369 | .GOTDATA_LOX10 => @panic("TODO: R_SPARC_GOTDATA_LOX10"), |