2 # RUN: rm -rf %t && split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/a.s -o %t/a.o
4 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %p/Inputs/shared.s -o %t/b.o
5 # RUN: ld.lld -shared -soname=b %t/b.o -o %t/b.so
7 # RUN: ld.lld -z max-page-size=65536 -z norelro %t/a.o %t/b.so -T %t/1.t -o %t/a1
8 # RN: llvm-readelf -S -l %t/a1 | FileCheck %s --check-prefixes=CHECK1
10 # RUN: ld.lld -z max-page-size=65536 -z relro %t/a.o %t/b.so -T %t/1.t -o %t/a2
11 # RUN: llvm-readelf -S -l %t/a2 | FileCheck %s --check-prefixes=CHECK2
13 ## -z norelro suppresses the .relro_padding section.
14 # CHECK1: Name Type Address Off Size ES Flg
15 # CHECK1: .foo PROGBITS
16 # CHECK1-NEXT: .orphan.rw PROGBITS
17 # CHECK1-NEXT: .branch_lt PROGBITS
18 # CHECK1-NEXT: .got PROGBITS
19 # CHECK1-NEXT: .data PROGBITS
20 # CHECK1-NEXT: .bss NOBITS
22 # CHECK2: Name Type Address Off Size ES Flg
23 # CHECK2-NEXT: NULL {{.*}}
24 # CHECK2: .orphan.ro PROGBITS {{.*}} A
25 # CHECK2: .dynamic DYNAMIC {{.*}} WA
26 # CHECK2-NEXT: .branch_lt PROGBITS {{.*}} WA
27 # CHECK2-NEXT: .got PROGBITS {{.*}} WA
28 # CHECK2-NEXT: .relro_padding NOBITS 00000000000100f0 0100f0 000f10 00 WA
29 # CHECK2-NEXT: .data PROGBITS {{.*}} WA
30 # CHECK2-NEXT: .foo PROGBITS {{.*}} WA
31 # CHECK2-NEXT: .orphan.rw PROGBITS {{.*}} WA
32 # CHECK2-NEXT: .bss NOBITS {{.*}} WA
37 addis 3, 2, bar2@toc@ha
49 .section .bss,"",@nobits
51 .section .orphan.ro,"a",@progbits
54 .section .orphan.rw,"aw",@progbits
64 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
66 .dynamic : { *(.dynamic) }
67 .branch_lt : { *(.branch_lt) }
70 . = DATA_SEGMENT_RELRO_END (0, .);
76 . = DATA_SEGMENT_END (.);
78 .comment 0 : { *(.comment) }