summaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/rel-dynamic-10.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/Mips/rel-dynamic-10.test')
-rw-r--r--test/old-elf/Mips/rel-dynamic-10.test160
1 files changed, 160 insertions, 0 deletions
diff --git a/test/old-elf/Mips/rel-dynamic-10.test b/test/old-elf/Mips/rel-dynamic-10.test
new file mode 100644
index 000000000000..68a311df73e4
--- /dev/null
+++ b/test/old-elf/Mips/rel-dynamic-10.test
@@ -0,0 +1,160 @@
+# Conditions:
+# a) Linking a non-shared executable file.
+# b) Relocations' targets are symbols defined in the other object.
+# Check:
+# a) There should be no dynamic relocations.
+# b) There should be no PLT entries.
+#
+# RUN: yaml2obj -format=elf -docnum 1 %s > %t-o1.o
+# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o2.o
+# RUN: lld -flavor old-gnu -target mipsel -e T0 -o %t.exe %t-o1.o %t-o2.o
+# RUN: llvm-readobj -dt -r -s %t.exe | FileCheck -check-prefix=PLT-SYM %s
+
+# PLT-SYM: Sections [
+# PLT-SYM: Section {
+# PLT-SYM-NOT: Name: .plt ({{[0-9]+}})
+
+# PLT-SYM: Relocations [
+# PLT-SYM-NEXT: ]
+
+# PLT-SYM: DynamicSymbols [
+# PLT-SYM-NEXT: Symbol {
+# PLT-SYM-NEXT: Name: @ (0)
+# PLT-SYM-NEXT: Value: 0x0
+# PLT-SYM-NEXT: Size: 0
+# PLT-SYM-NEXT: Binding: Local (0x0)
+# PLT-SYM-NEXT: Type: None (0x0)
+# PLT-SYM-NEXT: Other: 0
+# PLT-SYM-NEXT: Section: Undefined (0x0)
+# PLT-SYM-NEXT: }
+# PLT-SYM-NEXT: ]
+
+# o1.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]
+
+- Name: .data
+ Type: SHT_PROGBITS
+ Size: 0x08
+ AddressAlign: 16
+ Flags: [SHF_WRITE, SHF_ALLOC]
+
+Symbols:
+ Global:
+ - Name: T1
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x0
+ Size: 4
+ - Name: T2
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x4
+ Size: 4
+ - Name: T3
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x8
+ Size: 4
+ - Name: D1
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x0
+ Size: 4
+ - Name: D2
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x4
+ Size: 4
+
+# o2.o
+---
+FileHeader: !FileHeader
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
+
+Sections:
+- Name: .text
+ Type: SHT_PROGBITS
+ Size: 0x08
+ AddressAlign: 16
+ Flags: [SHF_EXECINSTR, SHF_ALLOC]
+
+- Name: .data
+ Type: SHT_PROGBITS
+ Size: 0x08
+ AddressAlign: 16
+ Flags: [SHF_WRITE, SHF_ALLOC]
+
+- Name: .rel.text
+ Type: SHT_REL
+ Info: .text
+ AddressAlign: 4
+ Relocations:
+ - Offset: 0x04
+ Symbol: T3
+ Type: R_MIPS_26
+
+- Name: .rel.data
+ Type: SHT_REL
+ Info: .data
+ AddressAlign: 4
+ Relocations:
+ - Offset: 0x00
+ Symbol: T1
+ Type: R_MIPS_HI16
+ - Offset: 0x00
+ Symbol: T1
+ Type: R_MIPS_LO16
+ - Offset: 0x04
+ Symbol: T2
+ Type: R_MIPS_32
+
+ - Offset: 0x04
+ Symbol: D1
+ Type: R_MIPS_HI16
+ - Offset: 0x04
+ Symbol: D1
+ Type: R_MIPS_LO16
+ - Offset: 0x04
+ Symbol: D2
+ Type: R_MIPS_32
+
+Symbols:
+ Global:
+ - Name: T0
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x0
+ Size: 8
+ - Name: T1
+ Type: STT_FUNC
+ - Name: T2
+ Type: STT_FUNC
+ - Name: T3
+ Type: STT_FUNC
+ - Name: D0
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x0
+ Size: 8
+ - Name: D1
+ Type: STT_OBJECT
+ - Name: D2
+ Type: STT_OBJECT
+...