Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / arm-pie-relative.s
blob0628d945063d96fe65bd4013aa95992f710e174a
1 // REQUIRES: arm
2 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
3 // RUN: ld.lld %t.o --pie -o %t
4 // RUN: llvm-readobj -r %t | FileCheck %s
5 // RUN: llvm-readelf -x .got %t | FileCheck %s --check-prefix=GOT
6 // RUN: ld.lld %t.o --pie --image-base=0x80000000 --check-dynamic-relocations -o %t1 2>&1 | \
7 // RUN: FileCheck %s -allow-empty -check-prefix=NOERR
8 // RUN: llvm-readobj -r %t1 | FileCheck %s --check-prefix=CHECK1
9 // RUN: llvm-readelf -x .got %t1 | FileCheck %s --check-prefix=GOT1
11 // Test that a R_ARM_GOT_BREL relocation with PIE results in a R_ARM_RELATIVE
12 // dynamic relocation
13 .syntax unified
14 .text
15 .global _start
16 _start:
17 .word sym(GOT)
19 .data
20 .global sym
21 sym:
22 .word 0
24 // CHECK: Relocations [
25 // CHECK-NEXT: Section (5) .rel.dyn {
26 // CHECK-NEXT: 0x201E4 R_ARM_RELATIVE
28 // GOT: section '.got':
29 // GOT-NEXT: 0x000201e4 e8010300
31 // NOERR-NOT: internal linker error
33 // CHECK1: Relocations [
34 // CHECK1-NEXT: Section (5) .rel.dyn {
35 // CHECK1-NEXT: 0x800201E4 R_ARM_RELATIVE
37 // GOT1: section '.got':
38 // GOT1-NEXT: 0x800201e4 e8010380