zig/deps/lld/test/ELF/arm-pie-relative.s
Andrew Kelley 4794281d64 embed LLD 5.0.0
This is 48aaa9f66120f72b5d7e4a90b32fee40a3386ce9 from the
git monorepo.
2017-08-27 17:46:59 -04:00

26 lines
600 B
ArmAsm

// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
// RUN: ld.lld %t --pie -o %t2
// RUN: llvm-readobj -r %t2 | FileCheck %s
// RUN: llvm-objdump -s %t2 | FileCheck %s --check-prefix=GOT
// REQUIRES: arm
// Test that a R_ARM_GOT_BREL relocation with PIE results in a R_ARM_RELATIVE
// dynamic relocation
.syntax unified
.text
.global _start
_start:
.word sym(GOT)
.data
.global sym
sym:
.word 0
// CHECK: Relocations [
// CHECK-NEXT: Section (4) .rel.dyn {
// CHECK-NEXT: 0x3058 R_ARM_RELATIVE
// GOT: Contents of section .got:
// GOT-NEXT: 3058 00200000