diff options
Diffstat (limited to 'test/ELF')
| -rw-r--r-- | test/ELF/Inputs/mips-gp-dips-corrupt-ver.s | 14 | ||||
| -rwxr-xr-x | test/ELF/Inputs/mips-gp-dips-corrupt-ver.so | bin | 0 -> 2160 bytes | |||
| -rw-r--r-- | test/ELF/mips-gp-disp-ver.s | 15 | ||||
| -rw-r--r-- | test/ELF/pie.s | 2 |
4 files changed, 30 insertions, 1 deletions
diff --git a/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s new file mode 100644 index 000000000000..42bd32a1e73a --- /dev/null +++ b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s @@ -0,0 +1,14 @@ +# Source file for mips-gp-dips-corrupt-ver.so +# +# % cat gpdisp.ver +# LLD_1.0.0 { global: foo; }; +# +# % as mips-gp-dips-corrupt-ver.s -o mips-gp-dips-corrupt-ver.o +# % ld -shared -o mips-gp-dips-corrupt-ver.so \ +# --version-script gpdisp.ver mips-gp-dips-corrupt-ver.o + + .global foo + .text +foo: + lui $t0, %hi(_gp_disp) + addi $t0, $t0, %lo(_gp_disp) diff --git a/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so Binary files differnew file mode 100755 index 000000000000..289ffa538f0c --- /dev/null +++ b/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so diff --git a/test/ELF/mips-gp-disp-ver.s b/test/ELF/mips-gp-disp-ver.s new file mode 100644 index 000000000000..134a056a3620 --- /dev/null +++ b/test/ELF/mips-gp-disp-ver.s @@ -0,0 +1,15 @@ +# MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero +# version definition index to it. This value means 'unversioned local symbol' +# while _gp_disp is a section global symbol. We have to handle this bug +# in the LLD because BFD linker is used for building MIPS toolchain +# libraries. This test checks such handling. + +# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o +# RUN: ld.lld %t.o %S/Inputs/mips-gp-dips-corrupt-ver.so + +# REQUIRES: mips + + .global __start + .text +__start: + lw $t0, %got(foo)($gp) diff --git a/test/ELF/pie.s b/test/ELF/pie.s index 5964db5c9399..3efd6e337c64 100644 --- a/test/ELF/pie.s +++ b/test/ELF/pie.s @@ -48,7 +48,7 @@ # CHECK: Type: PT_DYNAMIC ## Check -nopie -# RUN: ld.lld -nopie %t1.o -o %t2 +# RUN: ld.lld -no-pie %t1.o -o %t2 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE # NOPIE-NOT: Type: SharedObject |
