See http://lists.llvm.org/pipermail/llvm-dev/2020-April/140549.html For the record, GNU ld changed to 64k max page size in 2014 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7572ca8989ead4c3425a1500bc241eaaeffa2c89 "[RFC] ld/ARM: Increase maximum page size to 64kB" Android driver forced 4k page size in AArch64 (D55029) and ARM (D77746). A binary linked with max-page-size=4096 does not run on a system with a higher page size configured. There are some systems out there that do this and it leads to the binary getting `Killed!` by the kernel. In the non-linker-script cases, when linked with -z noseparate-code (default), the max-page-size increase should not cause any size difference. There may be some VMA usage differences, though. Reviewed By: psmith, MaskRay Differential Revision: https://reviews.llvm.org/D77330
36 lines
780 B
ArmAsm
36 lines
780 B
ArmAsm
// REQUIRES: arm
|
|
// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf %s -o %t
|
|
// RUN: ld.lld --hash-style=sysv -shared %t -o %t2
|
|
// RUN: llvm-readobj --symbols %t2 | FileCheck %s
|
|
|
|
/// The ARM _GLOBAL_OFFSET_TABLE_ should be defined at the start of the .got
|
|
.globl a
|
|
.type a,%object
|
|
.comm a,4,4
|
|
|
|
.globl f
|
|
.type f,%function
|
|
f:
|
|
ldr r2, .L1
|
|
.L0:
|
|
add r2, pc
|
|
.L1:
|
|
.word _GLOBAL_OFFSET_TABLE_ - (.L0+4)
|
|
.word a(GOT)
|
|
|
|
.global _start
|
|
.type _start,%function
|
|
_start:
|
|
bl f
|
|
.data
|
|
|
|
// CHECK: Name: _GLOBAL_OFFSET_TABLE_
|
|
// CHECK-NEXT: Value: 0x20268
|
|
// CHECK-NEXT: Size: 0
|
|
// CHECK-NEXT: Binding: Local
|
|
// CHECK-NEXT: Type: None
|
|
// CHECK-NEXT: Other [ (0x2)
|
|
// CHECK-NEXT: STV_HIDDEN (0x2)
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: Section: .got
|