blob: 88f2e337d9282c8a72c8269f2a14903fc0e0012a [file] [edit]
# Check handling of R_MIPS_CALL_HI16 / R_MIPS_CALL_LO16 relocations.
# RUN: yaml2obj -format=elf -docnum 1 %s > %t1.so.o
# RUN: lld -flavor old-gnu -target mipsel -shared -o %t1.so %t1.so.o
# RUN: yaml2obj -format=elf -docnum 2 %s > %t2.so.o
# RUN: lld -flavor old-gnu -target mipsel -shared -o %t2.so %t2.so.o %t1.so
# RUN: llvm-objdump -s -t %t2.so | FileCheck -check-prefix=RAW %s
# RUN: llvm-readobj -mips-plt-got %t2.so | FileCheck -check-prefix=GOT %s
# RAW: Contents of section .text:
# RAW-NEXT: 0110 00000000 18800000 00000000 1c800000
# ^ -32744 ^ -32740
# RAW-NEXT: 0120 00000000
# RAW: SYMBOL TABLE:
# RAW: 00000120 l F .text 00000004 T1
# GOT: Local entries [
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x1008
# GOT-NEXT: Access: -32744
# GOT-NEXT: Initial: 0x120
# GOT-NEXT: }
# GOT-NEXT: ]
# GOT-NEXT: Global entries [
# GOT-NEXT: Entry {
# GOT-NEXT: Address: 0x100C
# GOT-NEXT: Access: -32740
# GOT-NEXT: Initial: 0x0
# GOT-NEXT: Value: 0x0
# GOT-NEXT: Type: Function (0x2)
# GOT-NEXT: Section: Undefined (0x0)
# GOT-NEXT: Name: T2@ (4)
# GOT-NEXT: }
# GOT-NEXT: ]
# t1.so.o
---
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_32]
Sections:
- Name: .text
Type: SHT_PROGBITS
Size: 4
AddressAlign: 16
Flags: [SHF_ALLOC, SHF_EXECINSTR]
Symbols:
Global:
- Name: T2
Section: .text
Type: STT_FUNC
Value: 0
Size: 4
# t2.so.o
---
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_32]
Sections:
- Name: .text
Type: SHT_PROGBITS
Size: 20
AddressAlign: 16
Flags: [SHF_ALLOC, SHF_EXECINSTR]
- Name: .rel.text
Type: SHT_REL
Info: .text
AddressAlign: 4
Relocations:
- Offset: 0
Symbol: T1
Type: R_MIPS_CALL_HI16
- Offset: 4
Symbol: T1
Type: R_MIPS_CALL_LO16
- Offset: 8
Symbol: T2
Type: R_MIPS_CALL_HI16
- Offset: 12
Symbol: T2
Type: R_MIPS_CALL_LO16
Symbols:
Local:
- Name: T1
Section: .text
Type: STT_FUNC
Value: 16
Size: 4
Global:
- Name: T0
Section: .text
Type: STT_FUNC
Value: 0
Size: 16
- Name: T2
...