| ... | ... | @@ -7,6 +7,7 @@ const R_AMD64_RELATIVE = 8; |
| 7 | 7 | const R_386_RELATIVE = 8; |
| 8 | 8 | const R_ARM_RELATIVE = 23; |
| 9 | 9 | const R_AARCH64_RELATIVE = 1027; |
| 10 | const R_CSKY_RELATIVE = 9; |
| 10 | 11 | const R_LARCH_RELATIVE = 3; |
| 11 | 12 | const R_68K_RELATIVE = 22; |
| 12 | 13 | const R_RISCV_RELATIVE = 3; |
| ... | ... | @@ -18,6 +19,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { |
| 18 | 19 | .x86_64 => R_AMD64_RELATIVE, |
| 19 | 20 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, |
| 20 | 21 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, |
| 22 | .csky => R_CSKY_RELATIVE, |
| 21 | 23 | .loongarch32, .loongarch64 => R_LARCH_RELATIVE, |
| 22 | 24 | .m68k => R_68K_RELATIVE, |
| 23 | 25 | .riscv64 => R_RISCV_RELATIVE, |
| ... | ... | @@ -63,6 +65,13 @@ fn getDynamicSymbol() [*]elf.Dyn { |
| 63 | 65 | \\ add %[ret], %[ret], #:lo12:_DYNAMIC |
| 64 | 66 | : [ret] "=r" (-> [*]elf.Dyn), |
| 65 | 67 | ), |
| 68 | // The CSKY ABI requires the gb register to point to the GOT. Additionally, the first |
| 69 | // entry in the GOT is defined to hold the address of _DYNAMIC. |
| 70 | .csky => asm volatile ( |
| 71 | \\ mov %[ret], gb |
| 72 | \\ ldw %[ret], %[ret] |
| 73 | : [ret] "=r" (-> [*]elf.Dyn), |
| 74 | ), |
| 66 | 75 | .loongarch32, .loongarch64 => asm volatile ( |
| 67 | 76 | \\ .weak _DYNAMIC |
| 68 | 77 | \\ .hidden _DYNAMIC |