aboutsummaryrefslogtreecommitdiff
path: root/test/elf/Mips/plt-entry-mixed-3.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/Mips/plt-entry-mixed-3.test
downloadsrc-fb911942f1434f3d1750f83f25f5e42c80e60638.tar.gz
src-fb911942f1434f3d1750f83f25f5e42c80e60638.zip
Vendor import of lld trunk r233088:vendor/lld/lld-trunk-r233088
Notes
Notes: svn path=/vendor/lld/dist/; revision=280461 svn path=/vendor/lld/lld-trunk-r233088/; revision=280462; tag=vendor/lld/lld-trunk-r233088
Diffstat (limited to 'test/elf/Mips/plt-entry-mixed-3.test')
-rw-r--r--test/elf/Mips/plt-entry-mixed-3.test98
1 files changed, 98 insertions, 0 deletions
diff --git a/test/elf/Mips/plt-entry-mixed-3.test b/test/elf/Mips/plt-entry-mixed-3.test
new file mode 100644
index 000000000000..c61991b4b139
--- /dev/null
+++ b/test/elf/Mips/plt-entry-mixed-3.test
@@ -0,0 +1,98 @@
+# REQUIRES: mips
+
+# Conditions:
+# a) Object file contains microMIPS instructions.
+# b) There is a relocation refers arbitrary symbols and requires a PLT entry.
+# Check:
+# a) PLT contains a compressed entry.
+
+# Build shared library
+# RUN: yaml2obj -format=elf -docnum 1 %s > %t.so.o
+# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t.so.o
+
+# Build executable
+# RUN: yaml2obj -format=elf -docnum 2 %s > %t.o.o
+# RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t.o.o %t.so
+# RUN: llvm-objdump -s %t.exe | FileCheck %s
+
+# FIXME (simon): Check the disassembler output when llvm-objdump starts
+# to support microMIPS instruction encoding.
+
+# CHECK: Contents of section .plt:
+# CHECK-NEXT: 400170 8079a407 23ff0000 35052525 0233feff .y..#...5.%%.3..
+# CHECK-NEXT: 400180 ff0df945 830f000c 0079a007 22ff0000 ...E.....y.."...
+# CHECK-NEXT: 400190 9945020f .E..
+
+# so.o
+---
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
+
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Size: 0x0C
+ AddressAlign: 16
+ Flags: [SHF_EXECINSTR, SHF_ALLOC]
+
+Symbols:
+ Global:
+ - Name: T1
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x0
+ Size: 4
+
+# o.o
+---
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32,
+ EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS]
+
+Sections:
+- Name: .text
+ Type: SHT_PROGBITS
+ Size: 16
+ AddressAlign: 16
+ Flags: [SHF_EXECINSTR, SHF_ALLOC]
+
+- Name: .data
+ Type: SHT_PROGBITS
+ Size: 0x08
+ AddressAlign: 16
+ Flags: [SHF_WRITE, SHF_ALLOC]
+
+- Name: .rel.data
+ Type: SHT_REL
+ Info: .data
+ AddressAlign: 4
+ Relocations:
+ - Offset: 0x00
+ Symbol: T1
+ Type: R_MICROMIPS_HI16
+ - Offset: 0x00
+ Symbol: T1
+ Type: R_MICROMIPS_LO16
+
+Symbols:
+ Global:
+ - Name: T0
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x0
+ Size: 16
+ - Name: D0
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x0
+ Size: 8
+ - Name: T1
+...