| ... | ... | @@ -9,6 +9,7 @@ const R_ARC_RELATIVE = 56; |
| 9 | 9 | const R_ARM_RELATIVE = 23; |
| 10 | 10 | const R_AARCH64_RELATIVE = 1027; |
| 11 | 11 | const R_CSKY_RELATIVE = 9; |
| 12 | const R_HEXAGON_RELATIVE = 35; |
| 12 | 13 | const R_LARCH_RELATIVE = 3; |
| 13 | 14 | const R_68K_RELATIVE = 22; |
| 14 | 15 | const R_RISCV_RELATIVE = 3; |
| ... | ... | @@ -22,6 +23,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { |
| 22 | 23 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, |
| 23 | 24 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, |
| 24 | 25 | .csky => R_CSKY_RELATIVE, |
| 26 | .hexagon => R_HEXAGON_RELATIVE, |
| 25 | 27 | .loongarch32, .loongarch64 => R_LARCH_RELATIVE, |
| 26 | 28 | .m68k => R_68K_RELATIVE, |
| 27 | 29 | .riscv64 => R_RISCV_RELATIVE, |
| ... | ... | @@ -80,6 +82,20 @@ fn getDynamicSymbol() [*]elf.Dyn { |
| 80 | 82 | \\ ldw %[ret], %[ret] |
| 81 | 83 | : [ret] "=r" (-> [*]elf.Dyn), |
| 82 | 84 | ), |
| 85 | .hexagon => asm volatile ( |
| 86 | \\ .weak _DYNAMIC |
| 87 | \\ .hidden _DYNAMIC |
| 88 | \\ jump 1f |
| 89 | \\ .word _DYNAMIC - . |
| 90 | \\ 1: |
| 91 | \\ r1 = pc |
| 92 | \\ r1 = add(r1, #-4) |
| 93 | \\ %[ret] = memw(r1) |
| 94 | \\ %[ret] = add(r1, %[ret]) |
| 95 | : [ret] "=r" (-> [*]elf.Dyn), |
| 96 | : |
| 97 | : "r1" |
| 98 | ), |
| 83 | 99 | .loongarch32, .loongarch64 => asm volatile ( |
| 84 | 100 | \\ .weak _DYNAMIC |
| 85 | 101 | \\ .hidden _DYNAMIC |