brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b955b39 Raw
38 lines · plain
1// REQUIRES: arm2// Fails for unclear reasons on 32-bit windows3// UNSUPPORTED: system-windows4// RUN: llvm-mc --arm-add-build-attributes --triple=armv7a-linux-gnueabihf -filetype=obj %s -o %t.o5// RUN: echo "SECTIONS { \6// RUN:         . = 0x80000000; \7// RUN:         .text : { *(.text) } \8// RUN:         .vectors 0xffff0000 : AT(0xffff0000) { *(.vectors) } \9// RUN: } " > %t.script10// RUN: ld.lld --script %t.script %t.o -o %t11// RUN: llvm-readobj -x .ARM.exidx %t | FileCheck %s12/// Adapted from Linux kernel linker script failing due to out of range13/// relocation. The .vectors at 0xffff0000 is a common occurrence as the vector14/// table can only be placed at either 0 or 0xffff0000 in older ARM CPUs.15/// In the example the .vectors won't have an exception table so if LLD creates16/// one then we'll get a relocation out of range error. Check that we don't17/// synthesise a table entry or place a sentinel out of range.18 19/// Expect only .ARM.exidx from _start and sentinel20// CHECK: Hex dump of section '.ARM.exidx':21// CHECK-NEXT: 0x80000000 10000000 01000000 0c000000 0100000022// CHECK-NOT:  0x8000001023 24 .text25 .global _start26 .type _start, %function27_start:28 .fnstart29 bx lr30 .cantunwind31 .fnend32 33 .section .vectors, "ax", %progbits34 .global vecs35 .type vecs, %function36vecs:37 bx lr38