summaryrefslogtreecommitdiff
path: root/test/elf/ARM/rel-arm-jump24.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/ARM/rel-arm-jump24.test')
-rw-r--r--test/elf/ARM/rel-arm-jump24.test58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/elf/ARM/rel-arm-jump24.test b/test/elf/ARM/rel-arm-jump24.test
new file mode 100644
index 0000000000000..18eb8397d7b55
--- /dev/null
+++ b/test/elf/ARM/rel-arm-jump24.test
@@ -0,0 +1,58 @@
+# Check handling of R_ARM_JUMP24 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: 400094 04b08de2 f5ffffea 0030a0e1 0300a0e1
+# offset = -0x2C ^^
+# call site offset PC(arm) _Z1fv addr
+# 0x400098 + (-0x2C) + 0x8 = 0x400074
+# CHECK: SYMBOL TABLE:
+# CHECK: 00400074 g F .text {{[0-9a-f]+}} _Z1fv
+# CHECK: 00400090 g F .text {{[0-9a-f]+}} 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: 04B02DE500B08DE20030A0E30300A0E100D04BE204B09DE41EFF2FE100482DE904B08DE2FEFFFFEA0030A0E10300A0E10088BDE8
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x0000000000000004
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000024
+ 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: _Z1fv
+ Type: STT_FUNC
+ Section: .text
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x000000000000001C
+...