summaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/exe-dynamic.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/Mips/exe-dynamic.test')
-rw-r--r--test/old-elf/Mips/exe-dynamic.test110
1 files changed, 110 insertions, 0 deletions
diff --git a/test/old-elf/Mips/exe-dynamic.test b/test/old-elf/Mips/exe-dynamic.test
new file mode 100644
index 000000000000..93fdce9fdc7d
--- /dev/null
+++ b/test/old-elf/Mips/exe-dynamic.test
@@ -0,0 +1,110 @@
+# Check MIPS specific tags in the dynamic table in case executable linking.
+
+# Build shared library
+# RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
+# RUN: lld -flavor old-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 old-gnu -target mipsel -e glob -o %t.exe %t-o.o %t.so
+# RUN: llvm-readobj -dynamic-table %t.exe | FileCheck %s
+
+# CHECK: Format: ELF32-mips
+# CHECK: Arch: mipsel
+# CHECK: AddressSize: 32bit
+# CHECK: LoadName:
+# CHECK: DynamicSection [ (20 entries)
+# CHECK: Tag Type Name/Value
+# CHECK-NEXT: 0x00000004 HASH 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x00000005 STRTAB 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x00000006 SYMTAB 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x0000000A STRSZ 28 (bytes)
+# CHECK-NEXT: 0x0000000B SYMENT 16 (bytes)
+# CHECK-NEXT: 0x00000002 PLTRELSZ 8 (bytes)
+# CHECK-NEXT: 0x70000032 MIPS_PLTGOT 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x00000014 PLTREL REL
+# CHECK-NEXT: 0x00000017 JMPREL 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x70000001 MIPS_RLD_VERSION 1
+# CHECK-NEXT: 0x70000016 MIPS_RLD_MAP 0x40200C
+# CHECK-NEXT: 0x70000035 MIPS_RLD_MAP_REL 0x1E0C
+# CHECK-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
+# CHECK-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x400000
+# CHECK-NEXT: 0x7000000A MIPS_LOCAL_GOTNO 2
+# CHECK-NEXT: 0x70000011 MIPS_SYMTABNO 2
+# CHECK-NEXT: 0x70000013 MIPS_GOTSYM 0x2
+# CHECK-NEXT: 0x00000003 PLTGOT 0x{{[0-9A-F]+}}
+# CHECK-NEXT: 0x00000001 NEEDED SharedLibrary (exe-dynamic.test.tmp.so)
+# CHECK-NEXT: 0x00000000 NULL 0x0
+# CHECK-NEXT: ]
+
+# 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_PIC, EF_MIPS_CPIC,
+ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x04
+ Content: 0000000C000000000000000C000000000000000C00000000
+ - Name: .rel.text
+ Type: SHT_REL
+ Link: .symtab
+ AddressAlign: 0x04
+ Info: .text
+ Relocations:
+ - Offset: 0x00
+ Symbol: T1
+ Type: R_MIPS_26
+ Addend: 0
+ - Offset: 0x08
+ Symbol: .text
+ Type: R_MIPS_26
+ Addend: 0
+ - Offset: 0x10
+ Symbol: glob
+ Type: R_MIPS_26
+ Addend: 0
+
+Symbols:
+ Local:
+ - Name: loc
+ Section: .text
+ - Name: .text
+ Type: STT_SECTION
+ Section: .text
+ Global:
+ - Name: glob
+ Section: .text
+ Value: 0x08
+ - Name: T1
+...