[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / relro-omagic.s
blobb6c9e0d20b9d14dbcf71fa2e9b7e18bf981927d9
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o
4 # RUN: ld.lld -shared %t2.o -o %t2.so -soname relro-omagic.s.tmp2.so
5 # RUN: ld.lld --hash-style=sysv -N %t.o -Bdynamic %t2.so -o %t
6 # RUN: llvm-objdump --section-headers %t | FileCheck --check-prefix=NORELRO %s
7 # RUN: llvm-readobj --program-headers %t | FileCheck --check-prefix=NOPHDRS %s
9 # NORELRO: Sections:
10 # NORELRO-NEXT: Idx Name Size VMA Type
11 # NORELRO-NEXT: 0 00000000 0000000000000000
12 # NORELRO-NEXT: 1 .dynsym 00000048 00000000002000e8
13 # NORELRO-NEXT: 2 .hash 00000020 0000000000200130
14 # NORELRO-NEXT: 3 .dynstr 00000021 0000000000200150
15 # NORELRO-NEXT: 4 .rela.dyn 00000018 0000000000200178
16 # NORELRO-NEXT: 5 .rela.plt 00000018 0000000000200190
17 # NORELRO-NEXT: 6 .text 0000000a 00000000002001a8 TEXT
18 # NORELRO-NEXT: 7 .plt 00000020 00000000002001c0 TEXT
19 # NORELRO-NEXT: 8 .data 00000008 00000000002001e0 DATA
20 # NORELRO-NEXT: 9 .foo 00000004 00000000002001e8 DATA
21 # NORELRO-NEXT: 10 .dynamic 000000f0 00000000002001f0
22 # NORELRO-NEXT: 11 .got 00000008 00000000002002e0 DATA
23 # NORELRO-NEXT: 12 .got.plt 00000020 00000000002002e8 DATA
25 # NOPHDRS: ProgramHeaders [
26 # NOPHDRS-NOT: PT_GNU_RELRO
28 .long bar
29 jmp *bar2@GOTPCREL(%rip)
31 .section .data,"aw"
32 .quad 0
34 .section .foo,"aw"
35 .zero 4