3 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %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-readobj -l --elf-output-style=GNU %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-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=CHECK --check-prefix=PARTRELRO %s
13 // RUN: ld.lld %t.o %t2.so -z norelro -o %t
14 // RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=NORELRO %s
16 // CHECK: Program Headers:
22 // CHECK-NEXT: DYNAMIC
23 // CHECK-NEXT: GNU_RELRO
24 // CHECK: Section to Segment mapping:
26 // FULLRELRO: 05 .openbsd.randomdata .dynamic .got .got.plt {{$}}
27 // PARTRELRO: 05 .openbsd.randomdata .dynamic .got {{$}}
30 // NORELRO-NOT: GNU_RELRO
35 jmp *bar2@GOTPCREL(%rip)
42 .section .bss,"",@nobits
44 .section .openbsd.randomdata, "aw"