forked from OSchip/llvm-project
120 lines
3.5 KiB
Plaintext
120 lines
3.5 KiB
Plaintext
# .option norelax
|
|
# .global _start
|
|
# _start:
|
|
# beq x0, x0, _start
|
|
#
|
|
# .section .reloc_max, "ax", @progbits
|
|
# L1:
|
|
# beq x0, x0, L1 + 0xffe
|
|
#
|
|
# .section .reloc_min, "ax", @progbits
|
|
# L2:
|
|
# beq x0, x0, L2 - 0x1000
|
|
#
|
|
# REQUIRES: riscv
|
|
# RUN: yaml2obj %s -o %t.o
|
|
# RUN: ld.lld %t.o -o %t
|
|
# RUN: obj2yaml %t | FileCheck %s
|
|
#
|
|
# CHECK: - Name: .text
|
|
# CHECK: Content: '63000000'
|
|
# 11000: 00000063 beqz zero,11000 <_start>
|
|
#
|
|
# CHECK: - Name: .reloc_max
|
|
# CHECK: Content: E30F007E
|
|
# 11004: 7e000fe3 beqz zero,12002
|
|
#
|
|
# CHECK: - Name: .reloc_min
|
|
# CHECK: Content: '63000080'
|
|
# 11008: 80000063 beqz zero,10008
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_RISCV
|
|
Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_SOFT ]
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x0000000000000002
|
|
Content: '63000000'
|
|
- Name: .rela.text
|
|
Type: SHT_RELA
|
|
Flags: [ SHF_INFO_LINK ]
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000004
|
|
Info: .text
|
|
Relocations:
|
|
- Offset: 0x0000000000000000
|
|
Symbol: _start
|
|
Type: R_RISCV_BRANCH
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: ''
|
|
- Name: .bss
|
|
Type: SHT_NOBITS
|
|
Flags: [ SHF_WRITE, SHF_ALLOC ]
|
|
AddressAlign: 0x0000000000000001
|
|
- Name: .reloc_max
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: E30F007E
|
|
- Name: .rela.reloc_max
|
|
Type: SHT_RELA
|
|
Flags: [ SHF_INFO_LINK ]
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000004
|
|
Info: .reloc_max
|
|
Relocations:
|
|
- Offset: 0x0000000000000000
|
|
Symbol: L1
|
|
Type: R_RISCV_BRANCH
|
|
Addend: 4094
|
|
- Name: .reloc_min
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x0000000000000001
|
|
Content: '63000080'
|
|
- Name: .rela.reloc_min
|
|
Type: SHT_RELA
|
|
Flags: [ SHF_INFO_LINK ]
|
|
Link: .symtab
|
|
AddressAlign: 0x0000000000000004
|
|
Info: .reloc_min
|
|
Relocations:
|
|
- Offset: 0x0000000000000000
|
|
Symbol: L2
|
|
Type: R_RISCV_BRANCH
|
|
Addend: -4096
|
|
Symbols:
|
|
Local:
|
|
- Name: .text
|
|
Type: STT_SECTION
|
|
Section: .text
|
|
- Name: .data
|
|
Type: STT_SECTION
|
|
Section: .data
|
|
- Name: .bss
|
|
Type: STT_SECTION
|
|
Section: .bss
|
|
- Name: .reloc_max
|
|
Type: STT_SECTION
|
|
Section: .reloc_max
|
|
- Name: L1
|
|
Section: .reloc_max
|
|
- Name: .reloc_min
|
|
Type: STT_SECTION
|
|
Section: .reloc_min
|
|
- Name: L2
|
|
Section: .reloc_min
|
|
Global:
|
|
- Name: _start
|
|
Section: .text
|
|
...
|