| ... | @@ -7,6 +7,7 @@ const R_AMD64_RELATIVE = 8; | ... | @@ -7,6 +7,7 @@ const R_AMD64_RELATIVE = 8; |
| 7 | const R_386_RELATIVE = 8; | 7 | const R_386_RELATIVE = 8; |
| 8 | const R_ARM_RELATIVE = 23; | 8 | const R_ARM_RELATIVE = 23; |
| 9 | const R_AARCH64_RELATIVE = 1027; | 9 | const R_AARCH64_RELATIVE = 1027; |
| | 10 | const R_CSKY_RELATIVE = 9; |
| 10 | const R_LARCH_RELATIVE = 3; | 11 | const R_LARCH_RELATIVE = 3; |
| 11 | const R_68K_RELATIVE = 22; | 12 | const R_68K_RELATIVE = 22; |
| 12 | const R_RISCV_RELATIVE = 3; | 13 | const R_RISCV_RELATIVE = 3; |
| ... | @@ -18,6 +19,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { | ... | @@ -18,6 +19,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { |
| 18 | .x86_64 => R_AMD64_RELATIVE, | 19 | .x86_64 => R_AMD64_RELATIVE, |
| 19 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, | 20 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, |
| 20 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, | 21 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, |
| | 22 | .csky => R_CSKY_RELATIVE, |
| 21 | .loongarch32, .loongarch64 => R_LARCH_RELATIVE, | 23 | .loongarch32, .loongarch64 => R_LARCH_RELATIVE, |
| 22 | .m68k => R_68K_RELATIVE, | 24 | .m68k => R_68K_RELATIVE, |
| 23 | .riscv64 => R_RISCV_RELATIVE, | 25 | .riscv64 => R_RISCV_RELATIVE, |
| ... | @@ -63,6 +65,13 @@ fn getDynamicSymbol() [*]elf.Dyn { | ... | @@ -63,6 +65,13 @@ fn getDynamicSymbol() [*]elf.Dyn { |
| 63 | \\ add %[ret], %[ret], #:lo12:_DYNAMIC | 65 | \\ add %[ret], %[ret], #:lo12:_DYNAMIC |
| 64 | : [ret] "=r" (-> [*]elf.Dyn), | 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 | .loongarch32, .loongarch64 => asm volatile ( | 75 | .loongarch32, .loongarch64 => asm volatile ( |
| 67 | \\ .weak _DYNAMIC | 76 | \\ .weak _DYNAMIC |
| 68 | \\ .hidden _DYNAMIC | 77 | \\ .hidden _DYNAMIC |