| ... | @@ -5,6 +5,7 @@ const assert = std.debug.assert; | ... | @@ -5,6 +5,7 @@ const assert = std.debug.assert; |
| 5 | | 5 | |
| 6 | const R_AMD64_RELATIVE = 8; | 6 | const R_AMD64_RELATIVE = 8; |
| 7 | const R_386_RELATIVE = 8; | 7 | const R_386_RELATIVE = 8; |
| | 8 | const R_ARC_RELATIVE = 56; |
| 8 | const R_ARM_RELATIVE = 23; | 9 | const R_ARM_RELATIVE = 23; |
| 9 | const R_AARCH64_RELATIVE = 1027; | 10 | const R_AARCH64_RELATIVE = 1027; |
| 10 | const R_CSKY_RELATIVE = 9; | 11 | const R_CSKY_RELATIVE = 9; |
| ... | @@ -17,6 +18,7 @@ const R_SPARC_RELATIVE = 22; | ... | @@ -17,6 +18,7 @@ const R_SPARC_RELATIVE = 22; |
| 17 | const R_RELATIVE = switch (builtin.cpu.arch) { | 18 | const R_RELATIVE = switch (builtin.cpu.arch) { |
| 18 | .x86 => R_386_RELATIVE, | 19 | .x86 => R_386_RELATIVE, |
| 19 | .x86_64 => R_AMD64_RELATIVE, | 20 | .x86_64 => R_AMD64_RELATIVE, |
| | 21 | .arc => R_ARC_RELATIVE, |
| 20 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, | 22 | .arm, .armeb, .thumb, .thumbeb => R_ARM_RELATIVE, |
| 21 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, | 23 | .aarch64, .aarch64_be => R_AARCH64_RELATIVE, |
| 22 | .csky => R_CSKY_RELATIVE, | 24 | .csky => R_CSKY_RELATIVE, |
| ... | @@ -46,6 +48,12 @@ fn getDynamicSymbol() [*]elf.Dyn { | ... | @@ -46,6 +48,12 @@ fn getDynamicSymbol() [*]elf.Dyn { |
| 46 | \\ lea _DYNAMIC(%%rip), %[ret] | 48 | \\ lea _DYNAMIC(%%rip), %[ret] |
| 47 | : [ret] "=r" (-> [*]elf.Dyn), | 49 | : [ret] "=r" (-> [*]elf.Dyn), |
| 48 | ), | 50 | ), |
| | 51 | .arc => asm volatile ( |
| | 52 | \\ .weak _DYNAMIC |
| | 53 | \\ .hidden _DYNAMIC |
| | 54 | \\ add %[ret], pcl, _DYNAMIC@pcl |
| | 55 | : [ret] "=r" (-> [*]elf.Dyn), |
| | 56 | ), |
| 49 | // Work around the limited offset range of `ldr` | 57 | // Work around the limited offset range of `ldr` |
| 50 | .arm, .armeb, .thumb, .thumbeb => asm volatile ( | 58 | .arm, .armeb, .thumb, .thumbeb => asm volatile ( |
| 51 | \\ .weak _DYNAMIC | 59 | \\ .weak _DYNAMIC |