3 # RUN: yaml2obj --docnum=1 %s -o %t.o
4 # RUN: ld.lld %t.o %t.o -o %t2
5 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s
7 # RUN: yaml2obj --docnum=2 %s -o %t.o
8 # RUN: ld.lld %t.o %t.o -o %t2
9 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s
11 # CHECK: Name: .debug_info
12 # CHECK-NEXT: Type: SHT_PROGBITS
15 # CHECK-NEXT: Address: 0x0
16 # CHECK-NEXT: Offset: 0xE8
17 # CHECK-NEXT: Size: 108
20 # CHECK-NEXT: AddressAlignment: 1
21 # CHECK-NEXT: EntrySize: 0
22 # CHECK-NEXT: SectionData (
23 # CHECK-NEXT: 0000: {{.*}} |ABCDEFGHIJKLMNOP|
24 # CHECK-NEXT: 0010: {{.*}} |QRSTUVWXYZ.ABCDE|
25 # CHECK-NEXT: 0020: {{.*}} |FGHIJKLMNOPQRSTU|
26 # CHECK-NEXT: 0030: {{.*}} |VWXYZ.ABCDEFGHIJ|
27 # CHECK-NEXT: 0040: {{.*}} |KLMNOPQRSTUVWXYZ|
28 # CHECK-NEXT: 0050: {{.*}} |.ABCDEFGHIJKLMNO|
29 # CHECK-NEXT: 0060: {{.*}} |PQRSTUVWXYZ.|
33 ## YAML below is produced from the following code. AddressAlign of .debug_info is 8,
34 ## while compressed header has ch_addralign = 1. LLD had a bug and did not use the
35 ## value of ch_addralign at all. We produced broken section content.
37 ## .section .debug_info,"",@progbits
38 ## .string "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
39 ## .string "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
50 Flags: [ SHF_COMPRESSED ]
51 AddressAlign: 0x0000000000000008
52 Content: 010000000000000036000000000000000100000000000000789C73747276717573F7F0F4F2F6F1F5F30F080C0A0E090D0B8F888C6270C42D0500ADA00FBF
54 ## YAML below is the same as above, with a single change: ch_addralign field of the compressed
55 ## header was set to 0. This is allowed by the standard, we have to support it.
65 Flags: [ SHF_COMPRESSED ]
66 AddressAlign: 0x0000000000000008
67 Content: 010000000000000036000000000000000000000000000000789C73747276717573F7F0F4F2F6F1F5F30F080C0A0E090D0B8F888C6270C42D0500ADA00FBF