forked from OSchip/llvm-project
110 lines
2.7 KiB
Plaintext
110 lines
2.7 KiB
Plaintext
# REQUIRES: mips
|
|
|
|
# Check generation of PLT entries in case of R6 big-endian target ABI.
|
|
|
|
# Build shared library
|
|
# RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o
|
|
# RUN: lld -flavor gnu -target mips -shared -o %t.so %t-so.o
|
|
|
|
# Build executable
|
|
# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o
|
|
# RUN: lld -flavor gnu -target mips -e T0 -o %t.exe %t-o.o %t.so
|
|
# RUN: llvm-objdump -d %t.exe | FileCheck %s
|
|
|
|
# CHECK: Disassembly of section .plt:
|
|
# CHECK-NEXT: .plt:
|
|
# CHECK-NEXT: 400160: 3c 1c 00 40 lui $gp, 64
|
|
# CHECK-NEXT: 400164: 8f 99 20 00 lw $25, 8192($gp)
|
|
# CHECK-NEXT: 400168: 27 9c 20 00 addiu $gp, $gp, 8192
|
|
# CHECK-NEXT: 40016c: 03 1c c0 23 subu $24, $24, $gp
|
|
# CHECK-NEXT: 400170: 03 e0 78 25 move $15, $ra
|
|
# CHECK-NEXT: 400174: 00 18 c0 82 srl $24, $24, 2
|
|
# CHECK-NEXT: 400178: 03 20 f8 09 jalr $25
|
|
# CHECK-NEXT: 40017c: 27 18 ff fe addiu $24, $24, -2
|
|
# CHECK-NEXT: 400180: 3c 0f 00 40 lui $15, 64
|
|
# CHECK-NEXT: 400184: 8d f9 20 08 lw $25, 8200($15)
|
|
# CHECK-NEXT: 400188: 03 20 00 09 jr $25
|
|
# CHECK-NEXT: 40018c: 25 f8 20 08 addiu $24, $15, 8200
|
|
|
|
# so.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2MSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R6]
|
|
|
|
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: ELFDATA2MSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R6]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Content: "0C00000000000000"
|
|
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: 0x0
|
|
Symbol: T1
|
|
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
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T0
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0x0
|
|
Size: 0x8
|
|
- Name: D0
|
|
Section: .data
|
|
Type: STT_OBJECT
|
|
Value: 0x0
|
|
Size: 8
|
|
- Name: T1
|
|
...
|