forked from OSchip/llvm-project
94 lines
2.2 KiB
Plaintext
94 lines
2.2 KiB
Plaintext
# REQUIRES: mips
|
|
|
|
# Check pairing of R_MIPS_HI16 and R_MIPS_LO16 relocations.
|
|
# RUN: yaml2obj -format=elf %s > %t-obj
|
|
# RUN: lld -flavor gnu -target mipsel -e glob1 -o %t-exe %t-obj
|
|
# RUN: llvm-objdump -t -disassemble %t-exe | FileCheck %s
|
|
|
|
# CHECK: Disassembly of section .text:
|
|
# CHECK: glob1:
|
|
# CHECK-NEXT: 400130: 40 00 04 3c lui $4, 64
|
|
# CHECK-NEXT: 400134: ff 9f a6 8c lw $6, -24577($5)
|
|
|
|
# CHECK: glob2:
|
|
# CHECK-NEXT: 400138: 00 20 c7 80 lb $7, 8192($6)
|
|
# CHECK-NEXT: 40013c: 04 20 c8 80 lb $8, 8196($6)
|
|
|
|
# CHECK: glob3:
|
|
# CHECK-NEXT: 400140: 40 80 05 3c lui $5, 32832
|
|
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: 00400130 g F .text 00000008 glob1
|
|
# CHECK: 00400138 g F .text 00000008 glob2
|
|
# CHECK: 00400140 g F .text 00000004 glob3
|
|
# CHECK: 00402000 g .data 0000000c X
|
|
|
|
!ELF
|
|
FileHeader: !FileHeader
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
# glob1:
|
|
# lui $4,%hi(X) # rel A
|
|
# lw $6,%lo(X+32767)($5) # rel B
|
|
# glob2:
|
|
# lb $7,%lo(X)($6) # rel C
|
|
# lb $8,%lo(X+4)($6) # rel D
|
|
# glob3:
|
|
# lui $5,%hi(X+32767) # rel E
|
|
Content: "0000043CFF7FA68C0000C7800400C880FF7F053C"
|
|
AddressAlign: 16
|
|
Flags: [SHF_EXECINSTR, SHF_ALLOC]
|
|
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Content: "000000000000000000000000"
|
|
AddressAlign: 16
|
|
Flags: [SHF_WRITE, SHF_ALLOC]
|
|
|
|
- Name: .rel.text
|
|
Type: SHT_REL
|
|
Info: .text
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x10 # rel E
|
|
Symbol: X
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0x04 # rel B
|
|
Symbol: X
|
|
Type: R_MIPS_LO16
|
|
- Offset: 0x00 # rel A
|
|
Symbol: X
|
|
Type: R_MIPS_HI16
|
|
- Offset: 0x0C # rel D
|
|
Symbol: X
|
|
Type: R_MIPS_LO16
|
|
- Offset: 0x08 # rel C
|
|
Symbol: X
|
|
Type: R_MIPS_LO16
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: glob1
|
|
Section: .text
|
|
Value: 0x0
|
|
Size: 8
|
|
- Name: glob2
|
|
Section: .text
|
|
Value: 0x8
|
|
Size: 8
|
|
- Name: glob3
|
|
Section: .text
|
|
Value: 0x10
|
|
Size: 4
|
|
- Name: X
|
|
Section: .data
|
|
Value: 0x0
|
|
Size: 12
|