1// REQUIRES: arm
2
3// RUN: llvm-mc -filetype=obj -triple=armv7-pc-linux %s -o %t.o
4// RUN: ld.lld %t.o -o %t.so -shared
5// RUN: llvm-readelf -l %t.so | FileCheck --implicit-check-not=LOAD %s
6
7// RUN: echo ".section .foo,\"ax\"; \
8// RUN:       bx lr" > %t.s
9// RUN: llvm-mc -filetype=obj -triple=armv7-pc-linux %t.s -o %t2.o
10// RUN: ld.lld %t.o %t2.o -o %t.so -shared
11// RUN: llvm-readelf -l %t.so | FileCheck --check-prefix=DIFF --implicit-check-not=LOAD %s
12
13// CHECK:      LOAD           0x000000 0x00000000 0x00000000 0x0016d 0x0016d  R 0x10000
14// CHECK:      LOAD           0x000170 0x00010170 0x00010170 0x{{.*}} 0x{{.*}} R E 0x10000
15// CHECK:      LOAD           0x000174 0x00020174 0x00020174 0x{{.*}} 0x{{.*}}   E 0x10000
16// CHECK:      LOAD           0x000178 0x00030178 0x00030178 0x00038  0x00038  RW  0x10000
17
18// CHECK: 01     .dynsym .gnu.hash .hash .dynstr
19// CHECK: 02     .text
20// CHECK: 03     .foo
21// CHECK: 04     .dynamic
22
23// DIFF:      LOAD           0x000000 0x00000000 0x00000000 0x0014d 0x0014d R   0x10000
24// DIFF:      LOAD           0x000150 0x00010150 0x00010150 0x0000c 0x0000c R E 0x10000
25// DIFF:      LOAD           0x00015c 0x0002015c 0x0002015c 0x00038 0x00038 RW  0x10000
26
27// DIFF: 01     .dynsym .gnu.hash .hash .dynstr
28// DIFF: 02     .text .foo
29// DIFF: 03     .dynamic
30
31        bx lr
32        .section .foo,"axy"
33        bx lr
34