forked from OSchip/llvm-project
75 lines
2.0 KiB
Plaintext
75 lines
2.0 KiB
Plaintext
# Check handling of HI16 and LO16 relocations for _gp_disp.
|
|
#
|
|
# R_MIPS_HI16: (AHL + GP - P) - (short)(AHL + GP - P)
|
|
# R_MIPS_LO16: AHL + GP - P + 4
|
|
# where AHL = (AHI << 16) + ALO
|
|
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -shared -o %t.so %t.o
|
|
# RUN: llvm-objdump -s -t %t.so | FileCheck %s
|
|
|
|
# CHECK: Contents of section .text:
|
|
# CHECK-NEXT: 00d0 0100083c 218f0885 0100083c 178f0885
|
|
# CHECK-NEXT: 00e0 0100083c 0f910885 0100083c 098d0885
|
|
# CHECK-NEXT: 00f0 0200083c ffff0885
|
|
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: 000000d0 g F .text 00000028 T0
|
|
# CHECK: 00008ff0 g *ABS* 00000000 _gp_disp
|
|
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Content: "0000083C010008850000083CFFFF08850000083CFF0108850000083C01FE08850200083CFFFF0885"
|
|
# ^ %hi(gp+1) ^ %hi(gp-1) ^ %hi(gp+0x1ff) ^ %hi(gp-0x1ff) ^ %lo(gp+0x1ffff)
|
|
# ^ %lo(gp+1) ^ %lo(gp-1) ^ %lo(gp+0x1ff) ^ %lo(gp-0x1ff)
|
|
# ^ %hi(gp+0x1ffff)
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .rel.text
|
|
Type: SHT_REL
|
|
Info: .text
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x0
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0x4
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_LO16
|
|
- Offset: 0x8
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0xC
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_LO16
|
|
- Offset: 0x10
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0x14
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_LO16
|
|
- Offset: 0x18
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0x1C
|
|
Symbol: _gp_disp
|
|
Type: R_MIPS_LO16
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T0
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 80
|
|
- Name: _gp_disp
|