2016-06-06 06:54:11 +08:00
|
|
|
// REQUIRES: aarch64
|
2018-06-27 06:20:04 +08:00
|
|
|
# REQUIRES: aarch64
|
2016-03-11 22:34:44 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %p/Inputs/aarch64-tls-ie.s -o %tdso.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %tmain.o
|
|
|
|
# RUN: ld.lld -shared %tdso.o -o %tdso.so
|
2017-10-06 17:37:44 +08:00
|
|
|
# RUN: ld.lld --hash-style=sysv %tmain.o %tdso.so -o %tout
|
2016-03-11 22:34:44 +08:00
|
|
|
# RUN: llvm-objdump -d %tout | FileCheck %s
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj -S -r %tout | FileCheck -check-prefix=RELOC %s
|
2016-03-11 22:34:44 +08:00
|
|
|
|
|
|
|
#RELOC: Section {
|
|
|
|
#RELOC: Index:
|
|
|
|
#RELOC: Name: .got
|
|
|
|
#RELOC-NEXT: Type: SHT_PROGBITS
|
|
|
|
#RELOC-NEXT: Flags [
|
|
|
|
#RELOC-NEXT: SHF_ALLOC
|
|
|
|
#RELOC-NEXT: SHF_WRITE
|
|
|
|
#RELOC-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
|
|
|
#RELOC-NEXT: Address: 0x2200B0
|
2016-10-04 16:58:55 +08:00
|
|
|
#RELOC-NEXT: Offset: 0x200B0
|
2016-03-11 22:34:44 +08:00
|
|
|
#RELOC-NEXT: Size: 16
|
|
|
|
#RELOC-NEXT: Link: 0
|
|
|
|
#RELOC-NEXT: Info: 0
|
|
|
|
#RELOC-NEXT: AddressAlignment: 8
|
|
|
|
#RELOC-NEXT: EntrySize: 0
|
|
|
|
#RELOC-NEXT: }
|
|
|
|
#RELOC: Relocations [
|
|
|
|
#RELOC-NEXT: Section ({{.*}}) .rela.dyn {
|
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
|
|
|
#RELOC-NEXT: 0x2200B8 R_AARCH64_TLS_TPREL64 bar 0x0
|
|
|
|
#RELOC-NEXT: 0x2200B0 R_AARCH64_TLS_TPREL64 foo 0x0
|
2016-03-11 22:34:44 +08:00
|
|
|
#RELOC-NEXT: }
|
|
|
|
#RELOC-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
|
|
|
# Page(0x2200B0) - Page(0x210000) = 0x10000 = 65536
|
|
|
|
# 0x2200B0 & 0xff8 = 0xB0 = 176
|
|
|
|
# Page(0x2200B8) - Page(0x210000) = 0x10000 = 65536
|
|
|
|
# 0x2200B8 & 0xff8 = 0xB8 = 184
|
2016-03-11 22:34:44 +08:00
|
|
|
#CHECK: Disassembly of section .text:
|
|
|
|
#CHECK: _start:
|
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: 210000: 80 00 00 90 adrp x0, #65536
|
|
|
|
#CHECK: 210004: 00 58 40 f9 ldr x0, [x0, #176]
|
|
|
|
#CHECK: 210008: 80 00 00 90 adrp x0, #65536
|
|
|
|
#CHECK: 21000c: 00 5c 40 f9 ldr x0, [x0, #184]
|
2016-03-11 22:34:44 +08:00
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
adrp x0, :gottprel:foo
|
|
|
|
ldr x0, [x0, #:gottprel_lo12:foo]
|
|
|
|
|
|
|
|
adrp x0, :gottprel:bar
|
|
|
|
ldr x0, [x0, #:gottprel_lo12:bar]
|