2015-08-06 08:00:50 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld -discard-all %t -o %t2
|
2015-09-23 05:12:55 +08:00
|
|
|
# RUN: llvm-readobj -file-headers -sections -section-data -program-headers %t2 | FileCheck %s
|
2015-08-06 08:00:50 +08:00
|
|
|
# REQUIRES: ppc
|
|
|
|
|
|
|
|
# exits with return code 42 on linux
|
|
|
|
.text
|
|
|
|
li 0,1
|
|
|
|
li 3,42
|
|
|
|
sc
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK: ElfHeader {
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: Ident {
|
|
|
|
# CHECK-NEXT: Magic: (7F 45 4C 46)
|
|
|
|
# CHECK-NEXT: Class: 64-bit (0x2)
|
|
|
|
# CHECK-NEXT: DataEncoding: BigEndian (0x2)
|
|
|
|
# CHECK-NEXT: FileVersion: 1
|
|
|
|
# CHECK-NEXT: OS/ABI: SystemV (0x0)
|
|
|
|
# CHECK-NEXT: ABIVersion: 0
|
|
|
|
# CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Type: Executable (0x2)
|
|
|
|
# CHECK-NEXT: Machine: EM_PPC64 (0x15)
|
|
|
|
# CHECK-NEXT: Version: 1
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Entry: 0x10010000
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: ProgramHeaderOffset: 0x40
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderOffset: 0x11050
|
|
|
|
# CHECK-NEXT: Flags [ (0x2)
|
|
|
|
# CHECK-NEXT: 0x2
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: HeaderSize: 64
|
|
|
|
# CHECK-NEXT: ProgramHeaderEntrySize: 56
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: ProgramHeaderCount: 4
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderEntrySize: 64
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderCount: 6
|
|
|
|
# CHECK-NEXT: StringTableSectionIndex: 4
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Sections [
|
|
|
|
# CHECK-NEXT: Section {
|
|
|
|
# CHECK-NEXT: Index: 0
|
|
|
|
# CHECK-NEXT: Name: (0)
|
|
|
|
# CHECK-NEXT: Type: SHT_NULL (0x0)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 0
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
2015-09-23 05:12:55 +08:00
|
|
|
# CHECK-NEXT: SectionData (
|
2015-10-13 04:51:48 +08:00
|
|
|
# CHECK-NEXT: )
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
|
|
|
# CHECK-NEXT: Index: 1
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Name: .text (1)
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: Type: SHT_PROGBITS (0x1)
|
2015-09-24 02:25:05 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x6)
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: SHF_ALLOC (0x2)
|
2015-09-24 02:25:05 +08:00
|
|
|
# CHECK-NEXT: SHF_EXECINSTR (0x4)
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: ]
|
2015-10-15 15:49:07 +08:00
|
|
|
# CHECK-NEXT: Address: 0x10010000
|
2015-10-13 04:51:48 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x10000
|
2015-09-24 02:25:05 +08:00
|
|
|
# CHECK-NEXT: Size: 12
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
2015-08-14 04:13:39 +08:00
|
|
|
# CHECK-NEXT: AddressAlignment: 4
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: EntrySize: 0
|
2015-09-23 05:12:55 +08:00
|
|
|
# CHECK-NEXT: SectionData (
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: 0000: 38000001 3860002A 44000002 |8...8`.*D...|
|
2015-09-23 05:12:55 +08:00
|
|
|
# CHECK-NEXT: )
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: }
|
2015-08-12 08:00:24 +08:00
|
|
|
# CHECK-NEXT: Section {
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Index: 2
|
|
|
|
# CHECK-NEXT: Name: .comment (7)
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK-NEXT: Flags [ (0x30)
|
|
|
|
# CHECK-NEXT: SHF_MERGE (0x10)
|
|
|
|
# CHECK-NEXT: SHF_STRINGS (0x20)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x11000
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Size: 8
|
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 1
|
2017-11-16 00:56:20 +08:00
|
|
|
# CHECK-NEXT: EntrySize: 1
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: SectionData (
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.|
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: )
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Index: 3
|
|
|
|
# CHECK-NEXT: Name: .symtab (16)
|
2015-10-13 04:51:48 +08:00
|
|
|
# CHECK-NEXT: Type: SHT_SYMTAB (0x2)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
2015-08-14 10:42:20 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x11008
|
|
|
|
# CHECK-NEXT: Size: 24
|
|
|
|
# CHECK-NEXT: Link: 5
|
2015-08-14 10:42:20 +08:00
|
|
|
# CHECK-NEXT: Info: 1
|
|
|
|
# CHECK-NEXT: AddressAlignment: 8
|
|
|
|
# CHECK-NEXT: EntrySize: 24
|
2015-09-23 05:12:55 +08:00
|
|
|
# CHECK-NEXT: SectionData (
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: 0000: 00000000 00000000 00000000 00000000 |................|
|
|
|
|
# CHECK-NEXT: 0010: 00000000 00000000 |........|
|
|
|
|
# CHECK-NEXT: )
|
2015-08-14 10:42:20 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Index: 4
|
|
|
|
# CHECK-NEXT: Name: .shstrtab (24)
|
|
|
|
# CHECK-NEXT: Type: SHT_STRTAB (0x3)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
2015-08-12 08:00:24 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x11020
|
|
|
|
# CHECK-NEXT: Size: 42
|
2015-08-12 08:00:24 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 1
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
2015-09-23 05:12:55 +08:00
|
|
|
# CHECK-NEXT: SectionData (
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: 0000: 002E7465 7874002E 636F6D6D 656E7400 |..text..comment.|
|
|
|
|
# CHECK-NEXT: 0010: 2E73796D 74616200 2E736873 74727461 |.symtab..shstrta|
|
|
|
|
# CHECK-NEXT: 0020: 62002E73 74727461 6200 |b..strtab.|
|
|
|
|
# CHECK-NEXT: )
|
2015-08-12 08:00:24 +08:00
|
|
|
# CHECK-NEXT: }
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Section {
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Index: 5
|
|
|
|
# CHECK-NEXT: Name: .strtab (34)
|
|
|
|
# CHECK-NEXT: Type: SHT_STRTAB (0x3)
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x1104A
|
|
|
|
# CHECK-NEXT: Size: 1
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 1
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
|
|
|
# CHECK-NEXT: SectionData (
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: 0000: 00 |.|
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: )
|
|
|
|
# CHECK-NEXT: }
|
2015-08-06 08:00:50 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: ProgramHeaders [
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_PHDR (0x6)
|
|
|
|
# CHECK-NEXT: Offset: 0x40
|
2015-10-15 15:49:07 +08:00
|
|
|
# CHECK-NEXT: VirtualAddress: 0x10000040
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x10000040
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: FileSize: 224
|
|
|
|
# CHECK-NEXT: MemSize: 224
|
|
|
|
# CHECK-NEXT: Flags [ (0x4)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 8
|
|
|
|
# CHECK-NEXT: }
|
2018-05-04 23:09:49 +08:00
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x10000000
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x10000000
|
|
|
|
# CHECK-NEXT: FileSize: 288
|
|
|
|
# CHECK-NEXT: MemSize: 288
|
|
|
|
# CHECK-NEXT: Flags [ (0x4)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 65536
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
# CHECK-NEXT: Offset: 0x10000
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x10010000
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x10010000
|
|
|
|
# CHECK-NEXT: FileSize: 4096
|
|
|
|
# CHECK-NEXT: MemSize: 4096
|
|
|
|
# CHECK-NEXT: Flags [ (0x5)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: PF_X (0x1)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 65536
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551)
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x0
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x0
|
|
|
|
# CHECK-NEXT: FileSize: 0
|
|
|
|
# CHECK-NEXT: MemSize: 0
|
|
|
|
# CHECK-NEXT: Flags [ (0x6)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: PF_W (0x2)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 0
|
|
|
|
# CHECK-NEXT: }
|
2016-01-07 10:35:32 +08:00
|
|
|
# CHECK-NEXT: ]
|