Skip to content

Commit 8f8a640

Browse files
committed
[ELF,test] Test static-pie __global_pointer$
1 parent b593110 commit 8f8a640

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lld/test/ELF/riscv-gp.s

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818

1919
# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol '__global_pointer$'; recompile with -fPIC
2020

21+
# RUN: ld.lld -pie --no-dynamic-linker --export-dynamic %t.64.o -o %t.64e
22+
# RUN: llvm-readelf -s %t.64e | FileCheck %s --check-prefix=STATICPIE
23+
24+
# STATICPIE: '.dynsym'
25+
# STATICPIE-NOT: __global_pointer$
26+
# STATICPIE: '.symtab'
27+
# STATICPIE: __global_pointer$
28+
2129
## -r mode does not define __global_pointer$.
2230
# RUN: ld.lld -r %t.64.o -o %t.64.ro
2331
# RUN: llvm-readelf -s %t.64.ro | FileCheck --check-prefix=RELOCATABLE %s

0 commit comments

Comments
 (0)