2018-06-27 06:20:04 +08:00
|
|
|
// REQUIRES: arm
|
2019-08-27 19:50:27 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
|
2019-08-27 19:52:36 +08:00
|
|
|
// RUN: ld.lld %t.o --pie -o %t
|
2019-08-27 19:50:27 +08:00
|
|
|
// RUN: llvm-readobj -r %t | FileCheck %s
|
|
|
|
// RUN: llvm-readelf -x .got %t | FileCheck %s --check-prefix=GOT
|
2016-12-13 18:42:05 +08:00
|
|
|
|
|
|
|
// 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 [
|
2019-08-27 19:52:36 +08:00
|
|
|
// CHECK-NEXT: Section (5) .rel.dyn {
|
2020-06-02 01:17:48 +08:00
|
|
|
// CHECK-NEXT: 0x201E4 R_ARM_RELATIVE
|
2016-12-13 18:42:05 +08:00
|
|
|
|
2019-08-27 19:52:36 +08:00
|
|
|
// GOT: section '.got':
|
2020-06-02 01:17:48 +08:00
|
|
|
// GOT-NEXT: 0x000201e4 e8010300
|