38 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabi %s -o %t.o3// RUN: ld.lld -z separate-loadable-segments %t.o -o %t4// RUN: llvm-readelf -S -r --symbols %t | FileCheck %s5// RUN: llvm-objdump --triple=armv7a-linux-gnueabi -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s6 7// Test the R_ARM_GOTOFF32 relocation8 9// CHECK: [Nr] Name Type Address Off Size ES Flg Lk Inf Al10// CHECK-NEXT: [ 0] NULL 00000000 000000 000000 00 0 0 011// CHECK-NEXT: [ 1] .text PROGBITS 00020000 010000 000010 00 AX 0 0 412// CHECK-NEXT: [ 2] .got PROGBITS 00030000 020000 000000 00 WA 0 0 413// CHECK-NEXT: [ 3] .relro_padding NOBITS 00030000 020000 000000 00 WA 0 0 114// CHECK-NEXT: [ 4] .bss NOBITS 00030000 020000 000014 00 WA 0 0 115 16// CHECK: 00030000 10 OBJECT GLOBAL DEFAULT 4 bar17// CHECK-NEXT: 0003000a 10 OBJECT GLOBAL DEFAULT 4 obj18 19// DISASM: <_start>:20// DISASM-NEXT: bx lr21// Offset 0 from .got = bar22// DISASM: .word 0x0000000023// Offset 10 from .got = obj24// DISASM-NEXT: .word 0x0000000a25// Offset 15 from .got = obj +526// DISASM-NEXT: .word 0x0000000f27 .syntax unified28 .globl _start29_start:30 bx lr31 .word bar(GOTOFF)32 .word obj(GOTOFF)33 .word obj(GOTOFF)+534 .type bar, %object35 .comm bar, 1036 .type obj, %object37 .comm obj, 1038