forked from OSchip/llvm-project
143 lines
3.9 KiB
Plaintext
143 lines
3.9 KiB
Plaintext
# Check calculation of AHL addendums for R_MICROMIPS_HI16 / R_MICROMIPS_LO16
|
|
# relocations for the _gp_disp symbol.
|
|
#
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor 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: 0110 a8410100 083de08e a8410100 083dd60e
|
|
# CHECK-NEXT: 0120 a8410200 a841cf8e 00000000 00000000
|
|
# CHECK-NEXT: 0130 083d0200 a841bf8e 083d0080 a841b88e
|
|
# CHECK-NEXT: 0140 a8410100 a8410100 a8410200 a8410300
|
|
# CHECK-NEXT: 0150 a8410140 083d9f8e
|
|
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: 00000110 g F .text 00000018 T0
|
|
# CHECK: 00000130 g F .text 00000010 T1
|
|
# CHECK: 00000140 g F .text 00000018 T2
|
|
# 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, EF_MIPS_MICROMIPS]
|
|
|
|
Sections:
|
|
- Name: .text.1
|
|
Type: SHT_PROGBITS
|
|
Content: "A8410000083D0100A8410000083DFF7FA8410100A8410000"
|
|
# ^ %hi(gp+0x1) ^ %hi(gp+0x7fff) ^ %lo(gp+0x8080)
|
|
# ^ %lo(gp+0x1) ^ %lo(gp+0x7fff)
|
|
# ^ %hi(gp+0x8080)
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .rel.text.1
|
|
Type: SHT_REL
|
|
Info: .text.1
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x0
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x4
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
- Offset: 0x8
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0xC
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
- Offset: 0x10
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x14
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
|
|
- Name: .text.2
|
|
Type: SHT_PROGBITS
|
|
Content: "083D0100A8410000083DFF7FA8410100"
|
|
# ^ %hi(gp+0x18000) ^ %lo(gp+0x40000000)
|
|
# ^ %lo(gp+0x18000)
|
|
# ^ %hi(gp+0x40000000)
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .rel.text.2
|
|
Type: SHT_REL
|
|
Info: .text.2
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x0
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x4
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
- Offset: 0x8
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0xC
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
|
|
- Name: .text.3
|
|
Type: SHT_PROGBITS
|
|
Content: "A8410000A8410000A8410100A8410200A8410040083D0000"
|
|
# ^ %hi(gp+0x1) ^ %hi(gp+0x8080) ^ %lo(gp+0x40000000)
|
|
# ^ %hi(gp+0x7fff) ^ %hi(gp+0x40000000)
|
|
# ^ %hi(gp+0x18000)
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .rel.text.3
|
|
Type: SHT_REL
|
|
Info: .text.3
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x0
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x4
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x8
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0xC
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x10
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_HI16
|
|
- Offset: 0x14
|
|
Symbol: _gp_disp
|
|
Type: R_MICROMIPS_LO16
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T0
|
|
Section: .text.1
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 24
|
|
Other: [STO_MIPS_MICROMIPS]
|
|
- Name: T1
|
|
Section: .text.2
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 16
|
|
Other: [STO_MIPS_MICROMIPS]
|
|
- Name: T2
|
|
Section: .text.3
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 24
|
|
Other: [STO_MIPS_MICROMIPS]
|
|
- Name: _gp_disp
|