2 ## Regression test: add STT_SECTION even if synthetic sections are interleaved
3 ## with regular input sections.
5 # RUN: rm -rf %t && split-file %s %t
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
7 # RUN: ld.lld --emit-relocs --no-relax -T %t/1.t %t/a.o -o %t/a1
8 # RUN: llvm-objdump --no-print-imm-hex -dr %t/a1 | FileCheck %s --check-prefixes=CHECK,CHECK1
9 # RUN: ld.lld --emit-relocs --no-relax -T %t/2.t %t/a.o -o %t/a2
10 # RUN: llvm-objdump --no-print-imm-hex -dr %t/a2 | FileCheck %s --check-prefixes=CHECK,CHECK2
13 ## %t/a1: bss is at offset 17. bss-4 = .bss + 0xd
14 ## %t/a2: bss is at offset 16. bss-4 = .bss + 0xc
15 # CHECK-NEXT: movl [[#]](%rip), %eax
16 # CHECK1-NEXT: R_X86_64_PC32 .bss+0xd
17 # CHECK2-NEXT: R_X86_64_PC32 .bss+0xc
18 # CHECK-NEXT: movl [[#]](%rip), %eax
19 # CHECK-NEXT: R_X86_64_PC32 common-0x4
20 # CHECK-NEXT: movl [[#]](%rip), %eax
21 ## %t/a1: input .data is at offset 8. 8-4 = 0x4
22 ## %t/a2: input .data is at offset 0. 0-4 = -0x4
23 # CHECK1-NEXT: R_X86_64_GOTPCRELX .data+0x4
24 # CHECK2-NEXT: R_X86_64_GOTPCRELX .data-0x4
30 movl common
(%rip
), %eax
31 ## Compilers don't produce this. We just check the behavior.
32 movl
.data@gotpcrel(%rip), %eax
34 .section .data,"aw",@progbits
37 .section .bss,"aw",@nobits
46 .data : { *(.got) *(.data) }
47 .bss : { *(COMMON) *(.bss) }
52 .data : { *(.data) *(.got) }
53 .bss : { *(.bss) *(COMMON) }