[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / no-discard-this_module.s
blob48078594509e98310cc9aae96bebf049d200d630
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-linux-gnu -save-temp-labels %s -o %t
3 // RUN: ld.lld %t -o %t2
4 // RUN: llvm-readobj -S --section-data --symbols %t2 | FileCheck %s
6 .global _start
7 _start:
9 // This section and symbol is used by Linux kernel modules. Ensure it's not
10 // accidentally discarded.
11 .section .gnu.linkonce.this_module:
12 __this_module:
13 .byte 0x00
15 // CHECK: Section {
16 // CHECK: Index:
17 // CHECK: Name: .gnu.linkonce.this_module
18 // CHECK-NEXT: Type: SHT_PROGBITS
19 // CHECK-NEXT: Flags [
20 // CHECK-NEXT: ]
21 // CHECK-NEXT: Address:
22 // CHECK-NEXT: Offset:
23 // CHECK-NEXT: Size:
24 // CHECK-NEXT: Link:
25 // CHECK-NEXT: Info:
26 // CHECK-NEXT: AddressAlignment:
27 // CHECK-NEXT: EntrySize:
28 // CHECK-NEXT: SectionData (
29 // CHECK-NEXT: 0000: 00 |.|
30 // CHECK-NEXT: )
31 // CHECK-NEXT: }
33 // CHECK: Symbol {
34 // CHECK: Name: __this_module
35 // CHECK-NEXT: Value:
36 // CHECK-NEXT: Size:
37 // CHECK-NEXT: Binding: Local
38 // CHECK-NEXT: Type: None
39 // CHECK-NEXT: Other:
40 // CHECK-NEXT: Section: .gnu.linkonce.this_module:
41 // CHECK-NEXT: }