| ... | ... | @@ -19,6 +19,7 @@ const R_OR1K_RELATIVE = 21; |
| 19 | 19 | const R_PPC_RELATIVE = 22; |
| 20 | 20 | const R_RISCV_RELATIVE = 3; |
| 21 | 21 | const R_390_RELATIVE = 12; |
| 22 | const R_SH_RELATIVE = 165; |
| 22 | 23 | const R_SPARC_RELATIVE = 22; |
| 23 | 24 | |
| 24 | 25 | const R_RELATIVE = switch (builtin.cpu.arch) { |
| ... | ... | @@ -38,6 +39,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { |
| 38 | 39 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => R_PPC_RELATIVE, |
| 39 | 40 | .riscv32, .riscv32be, .riscv64, .riscv64be => R_RISCV_RELATIVE, |
| 40 | 41 | .s390x => R_390_RELATIVE, |
| 42 | .sh, .sheb => R_SH_RELATIVE, |
| 41 | 43 | .sparc, .sparc64 => R_SPARC_RELATIVE, |
| 42 | 44 | else => @compileError("Missing R_RELATIVE definition for this target"), |
| 43 | 45 | }; |
| ... | ... | @@ -223,6 +225,20 @@ inline fn getDynamicSymbol() [*]const elf.Dyn { |
| 223 | 225 | \\ 2: |
| 224 | 226 | : [ret] "=a" (-> [*]const elf.Dyn), |
| 225 | 227 | ), |
| 228 | .sh, .sheb => asm volatile ( |
| 229 | \\ .weak _DYNAMIC |
| 230 | \\ .hidden _DYNAMIC |
| 231 | \\ mova 1f, r0 |
| 232 | \\ mov.l 1f, %[ret] |
| 233 | \\ add r0, %[ret] |
| 234 | \\ bra 2f |
| 235 | \\1: |
| 236 | \\ .balign 4 |
| 237 | \\ .long DYNAMIC - . |
| 238 | \\2: |
| 239 | : [ret] "=r" (-> [*]const elf.Dyn), |
| 240 | : |
| 241 | : .{ .r0 = true }), |
| 226 | 242 | // The compiler does not necessarily have any obligation to load the `l7` register (pointing |
| 227 | 243 | // to the GOT), so do it ourselves just in case. |
| 228 | 244 | .sparc, .sparc64 => asm volatile ( |