• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: riscv
2# RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o
3# RUN: not ld.lld %t.o --defsym external=0 2>&1 | FileCheck %s
4
5# CHECK: error: R_RISCV_PCREL_LO12 relocation points to an absolute symbol: external
6
7# We provide a dummy %pcrel_hi referred to by external to appease the
8# assembler, but make external weak so --defsym can still override it at link
9# time.
10.weak external
11external:
12auipc sp,%pcrel_hi(external)
13addi sp,sp,%pcrel_lo(external)
14