summaryrefslogtreecommitdiffstats
path: root/lld/test/elf/ARM/plt-mapping.test
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/elf/ARM/plt-mapping.test')
-rw-r--r--lld/test/elf/ARM/plt-mapping.test111
1 files changed, 111 insertions, 0 deletions
diff --git a/lld/test/elf/ARM/plt-mapping.test b/lld/test/elf/ARM/plt-mapping.test
new file mode 100644
index 00000000000..cb86fb7b39e
--- /dev/null
+++ b/lld/test/elf/ARM/plt-mapping.test
@@ -0,0 +1,111 @@
+# Check that mapping symbols are properly generated for PLT entries.
+
+# 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-linux-gnu \
+# RUN: -Bstatic --noinhibit-exec %t-arm.o %t-thm.o -o %t
+# RUN: llvm-readobj -symbols %t | FileCheck %s
+
+# CHECK: Name: {{[$]?[at]?[.]?}}__plt_ifunc_f1
+# CHECK: Name: {{[$]?[at]?[.]?}}__plt_from_thumb_ifunc_f2
+# CHECK: Name: {{[$]?[at]?[.]?}}__plt_ifunc_f2
+
+# 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: 04B02DE500B08DE2003000E3003040E30300A0E100D04BE204B09DE41EFF2FE100482DE904B08DE2FEFFFFEB0030A0E10300A0E10088BDE8
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x0000000000000004
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000008
+ Symbol: main
+ Type: R_ARM_MOVW_ABS_NC
+ - Offset: 0x000000000000000C
+ Symbol: main
+ Type: R_ARM_MOVT_ABS
+ - Offset: 0x0000000000000028
+ Symbol: f1
+ Type: R_ARM_CALL
+ - 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: f1
+ Type: STT_GNU_IFUNC
+ Section: .text
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x0000000000000020
+
+# 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: 80B400AF40F20003C0F200031846BD465DF8047B704700BF80B500AFFFF7FEFF0346184680BD00BF
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x0000000000000004
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000004
+ Symbol: f
+ Type: R_ARM_THM_MOVW_ABS_NC
+ - Offset: 0x0000000000000008
+ Symbol: f
+ Type: R_ARM_THM_MOVT_ABS
+ - Offset: 0x000000000000001C
+ Symbol: f2
+ Type: R_ARM_THM_CALL
+ - 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: f2
+ Type: STT_GNU_IFUNC
+ Section: .text
+ Value: 0x0000000000000001
+ - Name: f
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x0000000000000019
+...
OpenPOWER on IntegriCloud