brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 7f57304 Raw
50 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t3// RUN: ld.lld --image-base=0x10000000 %t -o %t24// RUN: llvm-objdump --no-print-imm-hex --triple=armv7a-none-linux-gnueabi --no-show-raw-insn -d %t2 | FileCheck %s5 6/// Check that the ARM ABI rules for undefined weak symbols are applied.7/// Branch instructions are resolved to the next instruction. Undefined8/// Symbols in relative are resolved to the place so S - P + A = A.9/// We place the image-base at 0x10000000 to test that a range extensions thunk10/// is not generated.11 12 .syntax unified13 14 .weak target15 .type target, %function16 .weak undefweak217 .hidden undefweak218 .type undefweak2, %function19 20 .text21 .global _start22_start:23/// R_ARM_JUMP2424 b target25/// R_ARM_CALL26 bl target27/// R_ARM_CALL with exchange28 blx target29/// R_ARM_MOVT_PREL30 movt r0, :upper16:target - .31/// R_ARM_MOVW_PREL_NC32 movw r0, :lower16:target - .33/// R_ARM_REL3234 .word target - .35 36bl_undefweak2:37 bl undefweak238 39// CHECK: Disassembly of section .text:40// CHECK-EMPTY:41// CHECK-NEXT: 100100b4 <_start>:42// CHECK-NEXT: 100100b4: b       {{.+}} @ imm = #-443// CHECK-NEXT: 100100b8: bl      {{.+}} @ imm = #-444// CHECK-NEXT: 100100bc: bl      {{.+}} @ imm = #-445// CHECK-NEXT: 100100c0: movt    r0, #046// CHECK-NEXT: 100100c4: movw    r0, #047// CHECK:      100100c8: 00 00 00 00     .word   0x0000000048// CHECK-LABEL: <bl_undefweak2>49// CHECK-NEXT:    bl {{.*}} <bl_undefweak2+0x4>50