llvm-project/lld/test/old-elf/Mips/rel-gprel32-64.test

85 lines
2.3 KiB
Plaintext

# Check R_MIPS_GPREL32/R_MIPS_64 relocations handling.
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor old-gnu -target mips64el -e T0 -o %t.exe %t.o
# RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=REL-EXE %s
# RUN: llvm-objdump -s %t.exe | FileCheck %s
# RUN: llvm-nm %t.exe | FileCheck --check-prefix=SYM %s
# REL-EXE: Relocations [
# REL-EXE-NEXT: ]
# CHECK: Contents of section .text:
# CHECK-NEXT: 1200001d0 f871ffff ffffffff f871ffff f871ffff
# CHECK-NEXT: 1200001e0 f871ffff ffffffff 00000000 00000000
# SYM: 00000001200001e8 t LT1
# SYM: 0000000120001000 N _GLOBAL_OFFSET_TABLE_
# RUN: lld -flavor old-gnu -target mips64el -shared -o %t.so %t.o
# RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=REL-SO %s
# REL-SO: Relocations [
# REL-SO-NEXT: ]
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 16
Size: 32
- Name: .rela.text
Type: SHT_RELA
Link: .symtab
AddressAlign: 8
Info: .text
Relocations:
- Offset: 0x00
Symbol: LT1
Type: R_MIPS_GPREL16
Type2: R_MIPS_64
Type3: R_MIPS_NONE
- Offset: 0x08
Symbol: LT1
Type: R_MIPS_GPREL16
Type2: R_MIPS_64
Type3: R_MIPS_NONE
- Offset: 0x0C
Symbol: LT1
Type: R_MIPS_GPREL32
Type2: R_MIPS_64
Type3: R_MIPS_NONE
- Offset: 0x10
Symbol: LT1
Type: R_MIPS_GPREL32
Type2: R_MIPS_64
Type3: R_MIPS_NONE
Symbols:
Local:
- Name: .text
Type: STT_SECTION
Section: .text
- Name: LT1
Type: STT_FUNC
Section: .text
Value: 0x18
Size: 0x8
Global:
- Name: T0
Type: STT_FUNC
Section: .text
Value: 0x0
Size: 0x18
...