1# REQUIRES: arm 2# RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o 3# RUN: echo "SECTIONS { \ 4# RUN: .ARM.exidx 0x1000 : { *(.ARM.exidx*) foo = .; } \ 5# RUN: .text 0x2000 : { *(.text*) } \ 6# RUN: }" > %t.script 7## We used to crash if the last output section command for .ARM.exidx 8## was anything but an input section description. 9# RUN: ld.lld --no-merge-exidx-entries -T %t.script %t.o -shared -o %t.so 10# RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t.so | FileCheck %s 11# RUN: llvm-readobj -S --symbols %t.so | FileCheck %s --check-prefix=SYMBOL 12 13 .syntax unified 14 .text 15 .global _start 16_start: 17 .fnstart 18 .cantunwind 19 bx lr 20 .fnend 21 22# CHECK: Contents of section .ARM.exidx: 23# 1000 + 1000 = 0x2000 = _start 24# 1008 + 0ffc = 0x2004 = _start + sizeof(_start) 25# CHECK-NEXT: 1000 00100000 01000000 fc0f0000 01000000 26 27# SYMBOL: Section { 28# SYMBOL: Name: .ARM.exidx 29# SYMBOL-NEXT: Type: SHT_ARM_EXIDX 30# SYMBOL-NEXT: Flags [ 31# SYMBOL-NEXT: SHF_ALLOC 32# SYMBOL-NEXT: SHF_LINK_ORDER 33# SYMBOL-NEXT: ] 34# SYMBOL-NEXT: Address: 0x1000 35# SYMBOL-NEXT: Offset: 36# SYMBOL-NEXT: Size: 16 37 38# Symbol 'foo' is expected to point at the end of the section. 39# SYMBOL: Symbol { 40# SYMBOL: Name: foo 41# SYMBOL-NEXT: Value: 0x1010 42