[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / relro-openbsd.s
blob142b6a5e1a5c14c5ecbe0ee5752aaa1881a6a860
1 // REQUIRES: x86
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-openbsd %s -o %t.o
4 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-openbsd %p/Inputs/shared.s -o %t2.o
5 // RUN: ld.lld -shared %t2.o -o %t2.so
7 // RUN: ld.lld %t.o %t2.so -z now -z norelro -z relro -o %t
8 // RUN: llvm-readelf -l %t | FileCheck --check-prefix=CHECK --check-prefix=FULLRELRO %s
10 // RUN: ld.lld %t.o %t2.so -z norelro -z relro -o %t
11 // RUN: llvm-readelf -l %t | FileCheck --check-prefix=CHECK --check-prefix=PARTRELRO %s
13 // RUN: ld.lld %t.o %t2.so -z norelro -o %t
14 // RUN: llvm-readelf -l %t | FileCheck --check-prefix=NORELRO %s
16 // CHECK: Program Headers:
17 // CHECK-NEXT: Type
18 // CHECK-NEXT: PHDR
19 // CHECK-NEXT: LOAD
20 // CHECK-NEXT: LOAD
21 // CHECK-NEXT: LOAD
22 // CHECK-NEXT: LOAD
23 // CHECK-NEXT: DYNAMIC
24 // CHECK-NEXT: GNU_RELRO
25 // CHECK: Section to Segment mapping:
27 // FULLRELRO: 03 .openbsd.randomdata .dynamic .got .got.plt .relro_padding {{$}}
28 // PARTRELRO: 03 .openbsd.randomdata .dynamic .got .relro_padding {{$}}
31 // NORELRO-NOT: GNU_RELRO
33 .global _start
34 _start:
35 .long bar
36 jmp *bar2@GOTPCREL(%rip)
38 .section .data,"aw"
39 .quad 0
41 .zero 4
42 .section .foo,"aw"
43 .section .bss,"",@nobits
45 .section .openbsd.randomdata, "aw"
46 .quad 0