2018-06-27 06:20:04 +08:00
|
|
|
// REQUIRES: arm
|
2016-12-13 18:42:05 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
|
2017-10-06 17:37:44 +08:00
|
|
|
// RUN: ld.lld --hash-style=sysv %t --pie -o %t2
|
2016-12-13 18:42:05 +08:00
|
|
|
// RUN: llvm-readobj -r %t2 | FileCheck %s
|
|
|
|
// RUN: llvm-objdump -s %t2 | FileCheck %s --check-prefix=GOT
|
|
|
|
|
|
|
|
// 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 {
|
2017-01-10 09:21:30 +08:00
|
|
|
// CHECK-NEXT: 0x3058 R_ARM_RELATIVE
|
2016-12-13 18:42:05 +08:00
|
|
|
|
|
|
|
// GOT: Contents of section .got:
|
2017-01-10 09:21:30 +08:00
|
|
|
// GOT-NEXT: 3058 00200000
|