summaryrefslogtreecommitdiffstats
path: root/lld/test/elf/ARM/rel-arm-call.test
diff options
context:
space:
mode:
authorGreg Fitzgerald <garious@gmail.com>2015-01-21 07:35:48 +0000
committerGreg Fitzgerald <garious@gmail.com>2015-01-21 07:35:48 +0000
commit8a1887f1f1efd32e33b5389715587e85d9592216 (patch)
tree5664bfdccd4d6882f8e03eb3c6c13c05e5e9cee5 /lld/test/elf/ARM/rel-arm-call.test
parentf38dea1cfa2dba7848aaba79ad9866896e00f0ad (diff)
downloadbcm5719-llvm-8a1887f1f1efd32e33b5389715587e85d9592216.tar.gz
bcm5719-llvm-8a1887f1f1efd32e33b5389715587e85d9592216.zip
[ELF] Minimal implementation for ARM static linking
The code is able to statically link the simplest case of: int main() { return 0; } * Only works with ARM code - no Thumb code, no interwork (-marm -mno-thumb-interwork) * musl libc built with no interwork and no Thumb code Differential Revision: http://reviews.llvm.org/D6716 From: Denis Protivensky <dprotivensky@accesssoftek.com> llvm-svn: 226643
Diffstat (limited to 'lld/test/elf/ARM/rel-arm-call.test')
-rw-r--r--lld/test/elf/ARM/rel-arm-call.test60
1 files changed, 60 insertions, 0 deletions
diff --git a/lld/test/elf/ARM/rel-arm-call.test b/lld/test/elf/ARM/rel-arm-call.test
new file mode 100644
index 00000000000..bee2e468880
--- /dev/null
+++ b/lld/test/elf/ARM/rel-arm-call.test
@@ -0,0 +1,60 @@
+# Check handling of R_ARM_CALL relocation.
+# RUN: yaml2obj -format=elf %s > %t-o.o
+# RUN: lld -flavor gnu -target arm -m armelf_linux_eabi -Bstatic \
+# RUN: --noinhibit-exec %t-o.o -o %t
+# RUN: llvm-objdump -s -t %t | FileCheck %s
+
+# CHECK: Contents of section .text:
+# CHECK: 400084 1eff2fe1 00482de9 04b08de2 f7ffffeb
+# offset = -0x24 ^^
+# call site offset PC(arm) _Z1fv addr
+# 0x400090 + (-0x24) + 0x8 = 0x400074
+# CHECK: SYMBOL TABLE:
+# CHECK: 00400074 g F .text 00000014 _Z1fv
+# CHECK: 00400088 g F .text 00000018 main
+
+---
+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: 04B02DE500B08DE200D04BE204B09DE41EFF2FE100482DE904B08DE2FEFFFFEB0030A0E30300A0E10088BDE8
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x0000000000000004
+ Info: .text
+ Relocations:
+ - Offset: 0x000000000000001C
+ Symbol: _Z1fv
+ Type: R_ARM_CALL
+ 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: _Z1fv
+ Type: STT_FUNC
+ Section: .text
+ Size: 0x0000000000000014
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x0000000000000014
+ Size: 0x0000000000000018
+...
OpenPOWER on IntegriCloud