summaryrefslogtreecommitdiff
path: root/test/elf/ARM/rel-arm-jump24-veneer-bl.test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
commitfb911942f1434f3d1750f83f25f5e42c80e60638 (patch)
tree1678c4a4f0182e4029a86d135aa4a1b7d09e3c41 /test/elf/ARM/rel-arm-jump24-veneer-bl.test
Notes
Diffstat (limited to 'test/elf/ARM/rel-arm-jump24-veneer-bl.test')
-rw-r--r--test/elf/ARM/rel-arm-jump24-veneer-bl.test100
1 files changed, 100 insertions, 0 deletions
diff --git a/test/elf/ARM/rel-arm-jump24-veneer-bl.test b/test/elf/ARM/rel-arm-jump24-veneer-bl.test
new file mode 100644
index 0000000000000..cd386dc5b1a48
--- /dev/null
+++ b/test/elf/ARM/rel-arm-jump24-veneer-bl.test
@@ -0,0 +1,100 @@
+# Check veneer generation for R_ARM_JUMP24 relocation (BL<c> instruction call).
+
+# RUN: yaml2obj -format=elf -docnum 1 %s > %t-arm.o
+# RUN: yaml2obj -format=elf -docnum 2 %s > %t-thm.o
+# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \
+# RUN: --noinhibit-exec %t-arm.o %t-thm.o -o %t
+
+# RUN: llvm-objdump -s -t %t | FileCheck -check-prefix=BL-VENEER %s
+# RUN: llvm-objdump -s -t %t | FileCheck -check-prefix=BL-ADDR %s
+
+# BL-VENEER: Contents of section .text:
+# BL-VENEER: 400084 0400000b
+# Call from main:
+# offset = 0x10 ^^
+# call site offset PC(arm) ___Z1fv_from_arm addr
+# 0x400084 + 0x10 + 0x8 = 0x40009c
+#
+# Code of the veneer:
+# BL-VENEER: 400094 {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} 95004000
+# call addr = 0x400095 ^^
+# call addr _Z1fv addr Thumb mode
+# 0x400095 = 0x400094 | 0x1
+#
+# BL-ADDR: SYMBOL TABLE:
+# BL-ADDR: 0040009c l F .text {{[0-9a-f]+}} ___Z1fv_from_arm
+# BL-ADDR: 00400074 g F .text {{[0-9a-f]+}} main
+# BL-ADDR: 00400094 g F .text {{[0-9a-f]+}} _Z1fv
+
+# arm.o
+---
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_ARM
+ Flags: [ EF_ARM_EABI_VER5 ]
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x0000000000000004
+ Content: 00482DE904B08DE20030A0E3000053E3FEFFFF0B0030A0E30300A0E10088BDE8
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x0000000000000004
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000010
+ Symbol: _Z1fv
+ Type: R_ARM_JUMP24
+ Addend: 0
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000001
+ Content: ''
+ - Name: .bss
+ Type: SHT_NOBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000001
+ Content: ''
+Symbols:
+ Global:
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ - Name: _Z1fv
+
+# thm.o
+---
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_ARM
+ Flags: [ EF_ARM_EABI_VER5 ]
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x0000000000000004
+ Content: 4FF0000318467047
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000001
+ Content: ''
+ - Name: .bss
+ Type: SHT_NOBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000001
+ Content: ''
+Symbols:
+ Global:
+ - Name: _Z1fv
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x0000000000000001
+...