forked from OSchip/llvm-project
69 lines
1.7 KiB
Plaintext
69 lines
1.7 KiB
Plaintext
# REQUIRES: mips
|
|
|
|
# Check R_MIPS_JALR relocations do not affect the code
|
|
# in case of relocatable targets.
|
|
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -shared -o %t.so %t.o
|
|
# RUN: llvm-objdump -d %t.so | FileCheck %s
|
|
|
|
# CHECK: __start:
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 09 f8 20 03 jalr $25
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 00 00 00 00 nop
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 08 00 20 03 jr $25
|
|
# CHECK-NEXT: {{[0-9a-f]+}}: 00 00 00 00 nop
|
|
|
|
---
|
|
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
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 16
|
|
Content: "09f820030000000008002003000000000000000000000000"
|
|
# ^ jalr ^ jr ^ T1 ^ T2
|
|
|
|
- Name: .rel.text
|
|
Type: SHT_REL
|
|
Link: .symtab
|
|
AddressAlign: 4
|
|
Info: .text
|
|
Relocations:
|
|
- Offset: 0
|
|
Symbol: T1
|
|
Type: R_MIPS_JALR
|
|
- Offset: 8
|
|
Symbol: T2
|
|
Type: R_MIPS_JALR
|
|
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 16
|
|
Size: 0
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: __start
|
|
Type: STT_FUNC
|
|
Section: .text
|
|
Value: 0
|
|
Size: 16
|
|
- Name: T1
|
|
Type: STT_FUNC
|
|
Section: .text
|
|
Value: 16
|
|
Size: 4
|
|
- Name: T2
|
|
Type: STT_FUNC
|
|
Section: .text
|
|
Value: 20
|
|
Size: 4
|
|
...
|