brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 5de2385 Raw
61 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o3// RUN: ld.lld %t.o -o %t4// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t | FileCheck %s5// RUN: ld.lld %t.o --target2=got-rel -o %t26// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck %s7// RUN: ld.lld %t.o --target2=abs -o %t38// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t3 | FileCheck --check-prefix=CHECK-ABS %s9// RUN: ld.lld %t.o --target2=rel -o %t410// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t4 | FileCheck --check-prefix=CHECK-REL %s11 12// The R_ARM_TARGET2 is present in .ARM.extab sections. It can be handled as13// either R_ARM_ABS32, R_ARM_REL32 or R_ARM_GOT_PREL. For ARM linux the default14// is R_ARM_GOT_PREL. The other two options are primarily used for bare-metal,15// they can be selected with the --target2=abs or --target2=rel option.16 .syntax unified17 .text18 .globl _start19 .align 220_start:21 .type function, %function22 .fnstart23 bx lr24 .personality   __gxx_personality_v025 .handlerdata26 .word  _ZTIi(TARGET2)27 .text28 .fnend29 .global __gxx_personality_v030 .type function, %function31__gxx_personality_v0:32 bx lr33 34 .rodata35_ZTIi:  .word 036 37// CHECK: Contents of section .ARM.extab:38// 0x1012c + 0x2010 = 0x1213c = .got39// CHECK-NEXT:  10124 14000100 b0b0b000 1000020040 41// CHECK-ABS: Contents of section .ARM.extab:42// 0x100f0 = .rodata43// CHECK-ABS-NEXT: 100e4 14000100 b0b0b000 f000010044 45// CHECK-REL: Contents of section .ARM.extab:46// 0x100ec + 4 = 0x100f0 = .rodata47// CHECK-REL-NEXT: 100e4 14000100 b0b0b000 0400000048 49// CHECK: Contents of section .rodata:50// CHECK-NEXT: 10130 0000000051 52// CHECK-ABS: Contents of section .rodata:53// CHECK-ABS-NEXT: 100f0 0000000054 55// CHECK-REL: Contents of section .rodata:56// CHECK-REL-NEXT: 100f0 0000000057 58// CHECK: Contents of section .got:59// 10130 = _ZTIi60// CHECK-NEXT: 3013c 3001010061