llvm-project/lld/test/elf/Mips/plt-entry-mixed-3.test

99 lines
2.3 KiB
Plaintext

# 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
...