2016-06-28 03:53:53 +08:00
|
|
|
# RUN: yaml2obj %s | llvm-readobj -sections -section-data - | FileCheck %s
|
|
|
|
# RUN: yaml2obj -o %t %s
|
2014-05-16 00:14:02 +08:00
|
|
|
# RUN: llvm-readobj -sections -section-data %t | FileCheck %s
|
|
|
|
|
2013-06-14 06:19:48 +08:00
|
|
|
!ELF
|
|
|
|
FileHeader:
|
|
|
|
Class: ELFCLASS64
|
|
|
|
Data: ELFDATA2LSB
|
|
|
|
Type: ET_REL
|
|
|
|
Machine: EM_X86_64
|
|
|
|
Sections:
|
|
|
|
- Name: .text
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
2013-06-14 08:38:02 +08:00
|
|
|
Address: 0xCAFEBABE
|
2013-06-15 08:25:26 +08:00
|
|
|
Link: .text # Doesn't make sense for SHT_PROGBITS, but good enough for test.
|
2013-06-14 06:20:01 +08:00
|
|
|
Content: EBFE
|
2013-06-14 08:38:02 +08:00
|
|
|
AddressAlign: 2
|
2013-06-14 06:19:48 +08:00
|
|
|
|
2014-05-17 00:01:00 +08:00
|
|
|
- Name: .data
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ SHF_ALLOC ]
|
|
|
|
Address: 0xCAFECAFE
|
|
|
|
Content: FEBF
|
|
|
|
Size: 8
|
|
|
|
AddressAlign: 2
|
|
|
|
|
2013-06-14 06:19:48 +08:00
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 0
|
|
|
|
# CHECK: Type: SHT_NULL (0x0)
|
|
|
|
#
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Name: .text
|
|
|
|
# CHECK: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK-NEXT: Flags [ (0x6)
|
|
|
|
# CHECK-NEXT: SHF_ALLOC (0x2)
|
|
|
|
# CHECK-NEXT: SHF_EXECINSTR (0x4)
|
|
|
|
# CHECK-NEXT: ]
|
2013-06-14 08:38:02 +08:00
|
|
|
# CHECK-NEXT: Address: 0xCAFEBABE
|
2013-06-14 06:20:01 +08:00
|
|
|
# CHECK: Size: 2
|
2013-06-15 08:25:26 +08:00
|
|
|
# Check that Link != 0.
|
|
|
|
# CHECK: Link: {{[1-9][0-9]*}}
|
2013-06-14 08:38:02 +08:00
|
|
|
# CHECK: AddressAlignment: 2
|
2013-06-14 06:20:01 +08:00
|
|
|
# CHECK: SectionData (
|
|
|
|
# CHECK-NEXT: 0000: EBFE
|
|
|
|
# CHECK-NEXT: )
|
2014-03-14 14:53:16 +08:00
|
|
|
#
|
|
|
|
# CHECK: Section {
|
2014-05-17 00:01:00 +08:00
|
|
|
# CHECK: Name: .data
|
|
|
|
# CHECK-NEXT: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK-NEXT: Flags [ (0x2)
|
|
|
|
# CHECK-NEXT: SHF_ALLOC (0x2)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0xCAFECAFE
|
2015-07-08 14:57:24 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x{{[0-9A-F]+}}
|
2014-05-17 00:01:00 +08:00
|
|
|
# CHECK-NEXT: Size: 8
|
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 2
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
|
|
|
# CHECK-NEXT: SectionData (
|
|
|
|
# CHECK-NEXT: 0000: FEBF0000 00000000 |........|
|
|
|
|
# CHECK-NEXT: )
|
|
|
|
#
|
|
|
|
# CHECK: Section {
|
2014-05-01 03:38:09 +08:00
|
|
|
# CHECK: Name: .symtab (25)
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: Type: SHT_SYMTAB (0x2)
|
2015-07-10 02:23:02 +08:00
|
|
|
# CHECK: AddressAlignment: 8
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
2014-05-01 03:38:09 +08:00
|
|
|
# CHECK: Name: .strtab (17)
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: Type: SHT_STRTAB (0x3)
|
2015-07-10 02:23:02 +08:00
|
|
|
# CHECK: AddressAlignment: 1
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
2014-05-01 03:38:09 +08:00
|
|
|
# CHECK: Name: .shstrtab (7)
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: Type: SHT_STRTAB (0x3)
|
2015-07-10 02:23:02 +08:00
|
|
|
# CHECK: AddressAlignment: 1
|
2014-03-14 14:53:16 +08:00
|
|
|
# CHECK: }
|