1// REQUIRES: arm, shell
2// RUN: llvm-mc --arm-add-build-attributes --triple=armv7a-linux-gnueabihf -filetype=obj %s -o %t.o
3// RUN: echo "SECTIONS { \
4// RUN:         . = 0x80000000; \
5// RUN:         .text : { *(.text) } \
6// RUN:         .vectors 0xffff0000 : AT(0xffff0000) { *(.vectors) } \
7// RUN: } " > %t.script
8// RUN: ld.lld --script %t.script %t.o -o %t
9// RUN: llvm-readobj -x .ARM.exidx %t | FileCheck %s
10/// Adapted from Linux kernel linker script failing due to out of range
11/// relocation. The .vectors at 0xffff0000 is a common occurrence as the vector
12/// table can only be placed at either 0 or 0xffff0000 in older ARM CPUs.
13/// In the example the .vectors won't have an exception table so if LLD creates
14/// one then we'll get a relocation out of range error. Check that we don't
15/// synthesise a table entry or place a sentinel out of range.
16
17/// Expect only .ARM.exidx from _start and sentinel
18// CHECK: Hex dump of section '.ARM.exidx':
19// CHECK-NEXT: 0x80000000 10000000 01000000 0c000000 01000000
20// CHECK-NOT:  0x80000010
21
22 .text
23 .global _start
24 .type _start, %function
25_start:
26 .fnstart
27 bx lr
28 .cantunwind
29 .fnend
30
31 .section .vectors, "ax", %progbits
32 .global vecs
33 .type vecs, %function
34vecs:
35 bx lr
36