]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/ztext-text-notext.s
Vendor import of lld trunk r321530:
[FreeBSD/FreeBSD.git] / test / ELF / ztext-text-notext.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/ztext-text-notext.s -o %t2.o
4 # RUN: ld.lld %t2.o -o %t2.so -shared
5 # RUN: ld.lld -z notext %t.o %t2.so -o %t -shared
6 # RUN: llvm-readobj  -dynamic-table -r %t | FileCheck %s
7 # RUN: ld.lld -z notext %t.o %t2.so -o %t2 -pie
8 # RUN: llvm-readobj  -dynamic-table -r %t2 | FileCheck %s
9 # RUN: ld.lld -z notext %t.o %t2.so -o %t3
10 # RUN: llvm-readobj  -dynamic-table -r %t3 | FileCheck --check-prefix=STATIC %s
11
12 # If the preference is to have text relocations, don't create plt of copy relocations.
13
14 # CHECK:      Relocations [
15 # CHECK-NEXT:    Section {{.*}} .rela.dyn {
16 # CHECK-NEXT:      0x1000 R_X86_64_RELATIVE - 0x1000
17 # CHECK-NEXT:      0x1008 R_X86_64_64 bar 0x0
18 # CHECK-NEXT:      0x1010 R_X86_64_PC64 zed 0x0
19 # CHECK-NEXT:    }
20 # CHECK-NEXT:  ]
21 # CHECK: DynamicSection [
22 # CHECK: 0x0000000000000016 TEXTREL 0x0
23
24 # STATIC:      Relocations [
25 # STATIC-NEXT:    Section {{.*}} .rela.dyn {
26 # STATIC-NEXT:      0x201008 R_X86_64_64 bar 0x0
27 # STATIC-NEXT:      0x201010 R_X86_64_PC64 zed 0x0
28 # STATIC-NEXT:    }
29 # STATIC-NEXT:  ]
30 # STATIC: DynamicSection [
31 # STATIC: 0x0000000000000016 TEXTREL 0x0
32
33 foo:
34 .quad foo
35 .quad bar
36 .quad zed - .