xref: /aosp_15_r20/external/llvm/test/MC/ARM/elf-reloc-03.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple=armv7-linux-gnueabi  \
2*9880d681SAndroid Build Coastguard Worker// RUN:    -mcpu=cortex-a8 -mattr=-neon -mattr=+vfp2   \
3*9880d681SAndroid Build Coastguard Worker// RUN:    -filetype=obj %s -o - | \
4*9880d681SAndroid Build Coastguard Worker// RUN:   llvm-readobj -r | FileCheck -check-prefix=OBJ %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker// Ensure no regression on ARM/gcc compatibility for
7*9880d681SAndroid Build Coastguard Worker// emitting explicit symbol relocs for nonexternal symbols
8*9880d681SAndroid Build Coastguard Worker// versus section symbol relocs (with offset) -
9*9880d681SAndroid Build Coastguard Worker//
10*9880d681SAndroid Build Coastguard Worker// Default llvm behavior is to emit as section symbol relocs nearly
11*9880d681SAndroid Build Coastguard Worker// everything that is not an undefined external. Unfortunately, this
12*9880d681SAndroid Build Coastguard Worker// diverges from what codesourcery ARM/gcc does!
13*9880d681SAndroid Build Coastguard Worker//
14*9880d681SAndroid Build Coastguard Worker// Verifies that internal constants appear as explict symbol relocs
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker	movw	r1, :lower16:vtable
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker	.section	.data.rel.ro.local,"aw",%progbits
20*9880d681SAndroid Build Coastguard Workervtable:
21*9880d681SAndroid Build Coastguard Worker	.long	0
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker// OBJ: Relocations [
24*9880d681SAndroid Build Coastguard Worker// OBJ:   Section {{.*}} .rel.text {
25*9880d681SAndroid Build Coastguard Worker// OBJ:     0x{{[0-9,A-F]+}} R_ARM_MOVW_ABS_NC vtable
26*9880d681SAndroid Build Coastguard Worker// OBJ:   }
27*9880d681SAndroid Build Coastguard Worker// OBJ: ]
28