| ... | ... | @@ -10,6 +10,7 @@ const R_AARCH64_RELATIVE = 1027; |
| 10 | 10 | const R_LARCH_RELATIVE = 3; |
| 11 | 11 | const R_68K_RELATIVE = 22; |
| 12 | 12 | const R_RISCV_RELATIVE = 3; |
| 13 | const R_390_RELATIVE = 12; |
| 13 | 14 | const R_SPARC_RELATIVE = 22; |
| 14 | 15 | |
| 15 | 16 | const R_RELATIVE = switch (builtin.cpu.arch) { |
| ... | ... | @@ -20,6 +21,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { |
| 20 | 21 | .loongarch32, .loongarch64 => R_LARCH_RELATIVE, |
| 21 | 22 | .m68k => R_68K_RELATIVE, |
| 22 | 23 | .riscv64 => R_RISCV_RELATIVE, |
| 24 | .s390x => R_390_RELATIVE, |
| 23 | 25 | else => @compileError("Missing R_RELATIVE definition for this target"), |
| 24 | 26 | }; |
| 25 | 27 | |
| ... | ... | @@ -82,6 +84,16 @@ fn getDynamicSymbol() [*]elf.Dyn { |
| 82 | 84 | \\ lla %[ret], _DYNAMIC |
| 83 | 85 | : [ret] "=r" (-> [*]elf.Dyn), |
| 84 | 86 | ), |
| 87 | .s390x => asm volatile ( |
| 88 | \\ .weak _DYNAMIC |
| 89 | \\ .hidden _DYNAMIC |
| 90 | \\ larl %[ret], 1f |
| 91 | \\ agf %[ret], 0(%[ret]) |
| 92 | \\ b 2f |
| 93 | \\ 1: .long _DYNAMIC - . |
| 94 | \\ 2: |
| 95 | : [ret] "=r" (-> [*]elf.Dyn), |
| 96 | ), |
| 85 | 97 | else => { |
| 86 | 98 | @compileError("PIE startup is not yet supported for this target!"); |
| 87 | 99 | }, |