2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: aarch64
|
2015-09-26 08:32:04 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t -o %t2
|
2015-09-26 08:43:49 +08:00
|
|
|
# RUN: llvm-readobj -file-headers -sections -program-headers -symbols %t2 \
|
2015-09-26 08:32:04 +08:00
|
|
|
# RUN: | FileCheck %s
|
|
|
|
|
|
|
|
# exits with return code 42 on FreeBSD/AArch64
|
2016-04-27 10:58:27 +08:00
|
|
|
.globl _start
|
2015-09-26 08:32:04 +08:00
|
|
|
_start:
|
|
|
|
mov x0, 42
|
|
|
|
mov x8, 1
|
|
|
|
svc 0
|
|
|
|
|
|
|
|
# CHECK: ElfHeader {
|
|
|
|
# CHECK-NEXT: Ident {
|
|
|
|
# CHECK-NEXT: Magic: (7F 45 4C 46)
|
|
|
|
# CHECK-NEXT: Class: 64-bit (0x2)
|
|
|
|
# CHECK-NEXT: DataEncoding: LittleEndian (0x1)
|
|
|
|
# CHECK-NEXT: FileVersion: 1
|
|
|
|
# CHECK-NEXT: OS/ABI: FreeBSD (0x9)
|
|
|
|
# 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_AARCH64 (0xB7)
|
|
|
|
# CHECK-NEXT: Version: 1
|
|
|
|
# CHECK-NEXT: Entry: [[ENTRY:0x[0-9A-F]+]]
|
|
|
|
# CHECK-NEXT: ProgramHeaderOffset: 0x40
|
2017-08-03 00:35:00 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderOffset: 0x11088
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: HeaderSize: 64
|
|
|
|
# CHECK-NEXT: ProgramHeaderEntrySize: 56
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: ProgramHeaderCount: 4
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderEntrySize: 64
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: SectionHeaderCount: 6
|
|
|
|
# CHECK-NEXT: StringTableSectionIndex: 4
|
2015-09-26 08:32:04 +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
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
|
|
|
# CHECK-NEXT: Index: 1
|
2015-10-02 05:15:02 +08:00
|
|
|
# CHECK-NEXT: Name: .text
|
|
|
|
# CHECK-NEXT: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK-NEXT: Flags [ (0x6)
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: SHF_ALLOC (0x2)
|
2015-10-02 05:15:02 +08:00
|
|
|
# CHECK-NEXT: SHF_EXECINSTR (0x4)
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: ]
|
Align AArch64 and i386 image base to superpage
Summary:
As for x86_64, the default image base for AArch64 and i386 should be
aligned to a superpage appropriate for the architecture.
On AArch64, this is 2 MiB, on i386 it is 4 MiB.
Reviewers: emaste, grimar, javed.absar, espindola, ruiu, peter.smith, srhines, rprichard
Reviewed By: ruiu, peter.smith
Subscribers: jfb, markj, arichardson, krytarowski, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D50297
llvm-svn: 342746
2018-09-22 00:58:13 +08:00
|
|
|
# CHECK-NEXT: Address: 0x210000
|
2016-10-04 16:58:55 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x10000
|
2015-10-02 05:15:02 +08:00
|
|
|
# CHECK-NEXT: Size: 12
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 4
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
|
|
|
# CHECK-NEXT: Index: 2
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Name: .comment
|
|
|
|
# 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
|
2017-08-03 00:35:00 +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: }
|
|
|
|
# CHECK-NEXT: Section {
|
|
|
|
# CHECK-NEXT: Index: 3
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Name: .symtab
|
|
|
|
# CHECK-NEXT: Type: SHT_SYMTAB (0x2)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2017-08-03 00:35:00 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x11008
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Size: 72
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Link: 5
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Info: 2
|
|
|
|
# CHECK-NEXT: AddressAlignment: 8
|
|
|
|
# CHECK-NEXT: EntrySize: 24
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Section {
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Index: 4
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Name: .shstrtab
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Type: SHT_STRTAB (0x3)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2017-08-03 00:35:00 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x11050
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Size: 42
|
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: }
|
|
|
|
# CHECK-NEXT: Section {
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: Index: 5
|
2016-11-02 05:26:28 +08:00
|
|
|
# CHECK-NEXT: Name: .strtab
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Type: SHT_STRTAB (0x3)
|
|
|
|
# CHECK-NEXT: Flags [ (0x0)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x0
|
2017-08-03 00:35:00 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x1107A
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Size: 13
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 1
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Symbols [
|
|
|
|
# CHECK-NEXT: Symbol {
|
|
|
|
# CHECK-NEXT: Name: (0)
|
|
|
|
# CHECK-NEXT: Value: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Local (0x0)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Undefined (0x0)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Name: $x.0
|
Align AArch64 and i386 image base to superpage
Summary:
As for x86_64, the default image base for AArch64 and i386 should be
aligned to a superpage appropriate for the architecture.
On AArch64, this is 2 MiB, on i386 it is 4 MiB.
Reviewers: emaste, grimar, javed.absar, espindola, ruiu, peter.smith, srhines, rprichard
Reviewed By: ruiu, peter.smith
Subscribers: jfb, markj, arichardson, krytarowski, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D50297
llvm-svn: 342746
2018-09-22 00:58:13 +08:00
|
|
|
# CHECK-NEXT: Value: 0x210000
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Local (0x0)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
2015-10-02 05:15:02 +08:00
|
|
|
# CHECK-NEXT: Section: .text
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2015-10-21 01:21:35 +08:00
|
|
|
# CHECK-NEXT: Name: _start
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Value: [[ENTRY]]
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Global (0x1)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: .text
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: ProgramHeaders [
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: Type: PT_PHDR (0x6)
|
|
|
|
# CHECK-NEXT: Offset: 0x40
|
Align AArch64 and i386 image base to superpage
Summary:
As for x86_64, the default image base for AArch64 and i386 should be
aligned to a superpage appropriate for the architecture.
On AArch64, this is 2 MiB, on i386 it is 4 MiB.
Reviewers: emaste, grimar, javed.absar, espindola, ruiu, peter.smith, srhines, rprichard
Reviewed By: ruiu, peter.smith
Subscribers: jfb, markj, arichardson, krytarowski, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D50297
llvm-svn: 342746
2018-09-22 00:58:13 +08:00
|
|
|
# CHECK-NEXT: VirtualAddress: 0x200040
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x200040
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: FileSize: 224
|
|
|
|
# CHECK-NEXT: MemSize: 224
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x4)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 8
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
Align AArch64 and i386 image base to superpage
Summary:
As for x86_64, the default image base for AArch64 and i386 should be
aligned to a superpage appropriate for the architecture.
On AArch64, this is 2 MiB, on i386 it is 4 MiB.
Reviewers: emaste, grimar, javed.absar, espindola, ruiu, peter.smith, srhines, rprichard
Reviewed By: ruiu, peter.smith
Subscribers: jfb, markj, arichardson, krytarowski, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D50297
llvm-svn: 342746
2018-09-22 00:58:13 +08:00
|
|
|
# CHECK-NEXT: VirtualAddress: 0x200000
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x200000
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: FileSize: 288
|
|
|
|
# CHECK-NEXT: MemSize: 288
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: ]
|
2016-10-04 16:58:55 +08:00
|
|
|
# CHECK-NEXT: Alignment: 65536
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
# CHECK-NEXT: Offset: 0x1000
|
Align AArch64 and i386 image base to superpage
Summary:
As for x86_64, the default image base for AArch64 and i386 should be
aligned to a superpage appropriate for the architecture.
On AArch64, this is 2 MiB, on i386 it is 4 MiB.
Reviewers: emaste, grimar, javed.absar, espindola, ruiu, peter.smith, srhines, rprichard
Reviewed By: ruiu, peter.smith
Subscribers: jfb, markj, arichardson, krytarowski, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D50297
llvm-svn: 342746
2018-09-22 00:58:13 +08:00
|
|
|
# CHECK-NEXT: VirtualAddress: 0x210000
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x210000
|
2017-08-03 00:35:00 +08:00
|
|
|
# CHECK-NEXT: FileSize: 4096
|
2017-09-02 05:48:20 +08:00
|
|
|
# CHECK-NEXT: MemSize: 4096
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x5)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: PF_X (0x1)
|
|
|
|
# CHECK-NEXT: ]
|
2016-10-04 16:58:55 +08:00
|
|
|
# CHECK-NEXT: Alignment: 65536
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: }
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_GNU_STACK
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x0
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x0
|
|
|
|
# CHECK-NEXT: FileSize: 0
|
|
|
|
# CHECK-NEXT: MemSize: 0
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: PF_W
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 0
|
|
|
|
# CHECK-NEXT: }
|
2015-09-26 08:32:04 +08:00
|
|
|
# CHECK-NEXT: ]
|