brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 2c89085 Raw
64 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc --triple=armv7a-linux-gnueabihf -arm-add-build-attributes -filetype=obj -o %t.o %s3// RUN: ld.lld %t.o -o %t4// RUN: llvm-objdump --no-print-imm-hex --triple=armv7a-none-linux-gnueabi -d --no-show-raw-insn %t | FileCheck %s5 6/// A symbol assignment defined alias inherits st_type and gets the same treatment.7// RUN: llvm-mc --triple=armv7a-linux-gnueabihf -arm-add-build-attributes -filetype=obj --defsym ALIAS=1 -o %t1.o %s8// RUN: ld.lld --defsym foo=foo1 %t1.o -o %t19// RUN: llvm-objdump --no-print-imm-hex --triple=armv7a-none-linux-gnueabi -d --no-show-raw-insn %t | FileCheck %s10 11/// Non-preemptible ifuncs are called via a PLT entry which is always Arm12/// state, expect the ARM callers to go direct to the PLT entry, Thumb13/// branches are indirected via state change thunks, the bl is changed to blx.14 15 .syntax unified16 .text17 .balign 0x100018.ifdef ALIAS19 .type foo1 STT_GNU_IFUNC20 .globl foo121foo1:22.else23 .type foo STT_GNU_IFUNC24 .globl foo25foo:26.endif27 bx lr28 29 .section .text.1, "ax", %progbits30 .arm31 .global _start32_start:33 b foo34 bl foo35 36 .section .text.2, "ax", %progbits37 .thumb38 .global thumb_caller39thumb_caller:40 b foo41 b.w foo42 bl foo43 44// CHECK:      00021004 <_start>:45// CHECK-NEXT: b       0x2103046// CHECK-NEXT: bl      0x2103047 48// CHECK:      0002100c <thumb_caller>:49// CHECK-NEXT: b.w     0x21018 <__Thumbv7ABSLongThunk_foo>50// CHECK-NEXT: b.w     0x21018 <__Thumbv7ABSLongThunk_foo>51// CHECK-NEXT: blx     0x2103052 53// CHECK:      00021018 <__Thumbv7ABSLongThunk_foo>:54// CHECK-NEXT: movw    r12, #414455// CHECK-NEXT: movt    r12, #256// CHECK-NEXT: bx      r1257 58// CHECK: Disassembly of section .iplt:59 60// CHECK:      00021030 <.iplt>:61// CHECK-NEXT: add     r12, pc, #0, #1262// CHECK-NEXT: add     r12, r12, #16, #2063// CHECK-NEXT: ldr     pc, [r12, #8]!64