summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/riscv-pcrel-hilo-error.s
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/ELF/riscv-pcrel-hilo-error.s')
-rw-r--r--lld/test/ELF/riscv-pcrel-hilo-error.s6
1 files changed, 6 insertions, 0 deletions
diff --git a/lld/test/ELF/riscv-pcrel-hilo-error.s b/lld/test/ELF/riscv-pcrel-hilo-error.s
index bfc205520bd..1557ac77bb7 100644
--- a/lld/test/ELF/riscv-pcrel-hilo-error.s
+++ b/lld/test/ELF/riscv-pcrel-hilo-error.s
@@ -4,4 +4,10 @@
# CHECK: error: R_RISCV_PCREL_LO12 relocation points to an absolute symbol: external
+# We provide a dummy %pcrel_hi referred to by external to appease the
+# assembler, but make external weak so --defsym can still override it at link
+# time.
+.weak external
+external:
+auipc sp,%pcrel_hi(external)
addi sp,sp,%pcrel_lo(external)
OpenPOWER on IntegriCloud