llvm-project/lld/test/elf/Mips/hilo16-9-micro.test

143 lines
3.9 KiB
Plaintext
Raw Normal View History

# 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 00000100 0000e08e 00000100 0000d60e
# CHECK-NEXT: 0120 00000100 00004f0f 00000000 00000000
# CHECK-NEXT: 0130 00000200 0000bf0e 00000140 0000378f
# CHECK-NEXT: 0140 00000100 00000100 00000200 00000300
# CHECK-NEXT: 0150 00000140 00001f8f
# 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: "0000000000000100000000000000FF7F0000010000008080"
# ^ %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: "00000200000000800000004000008000"
# ^ %hi(gp+0x18000) ^ %lo(gp+0x40000080)
# ^ %lo(gp+0x18000)
# ^ %hi(gp+0x40000080)
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: "000000000000000000000100000002000000004000008000"
# ^ %hi(gp+0x1) ^ %hi(gp+0x8080) ^ %lo(gp+0x40000080)
# ^ %hi(gp+0x7fff) ^ %hi(gp+0x40000080)
# ^ %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