forked from OSchip/llvm-project
66 lines
1.6 KiB
Plaintext
66 lines
1.6 KiB
Plaintext
# Check R_MICROMIPS_GPREL7_S2 relocation handling.
|
|
#
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -shared -o %t.so %t.o
|
|
# RUN: llvm-readobj -symbols %t.so | FileCheck -check-prefix=SYM %s
|
|
# RUN: llvm-objdump -s %t.so | FileCheck -check-prefix=SEC %s
|
|
|
|
# SYM: Name: L0
|
|
# SYM-NEXT: Value: 0xF0
|
|
# SYM-NEXT: Size: 4
|
|
|
|
# SYM: Name: _gp
|
|
# SYM-NEXT: Value: 0x8FF0
|
|
# SYM-NEXT: Size: 0
|
|
|
|
# SEC: Contents of section .rodata:
|
|
# SEC-NEXT: 0f4 3b000000
|
|
# ^ 0xf0 (L0) + 0x8ff0 (GP0) - 0x8ff0 (_gp) - 4 = 0xec >> 2
|
|
|
|
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_32R2, EF_MIPS_MICROMIPS]
|
|
|
|
Sections:
|
|
- Type: SHT_PROGBITS
|
|
Name: .text
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 4
|
|
Size: 4
|
|
|
|
- Type: SHT_PROGBITS
|
|
Name: .rodata
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 4
|
|
Content: 7f000000
|
|
|
|
- Type: SHT_REL
|
|
Name: .rel.rodata
|
|
Link: .symtab
|
|
Info: .rodata
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0
|
|
Symbol: L0
|
|
Type: R_MICROMIPS_GPREL7_S2
|
|
|
|
- Type: SHT_MIPS_REGINFO
|
|
Name: .reginfo
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 1
|
|
Content: 0000000000000000000000000000000000000000f08f0000
|
|
|
|
Symbols:
|
|
Local:
|
|
- Name: L0
|
|
Section: .text
|
|
Value: 0
|
|
Size: 4
|
|
- Name: .rodata
|
|
Type: STT_SECTION
|
|
Section: .rodata
|