mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-25 13:20:57 +00:00

Currently when e_machine is set to something that is not supported by YAML lib, then tools fail with llvm_unreachable. In this patch I allow them to handle relocations in this case. It can be used to dump and create objects for broken or unsupported targets. Differential revision: https://reviews.llvm.org/D67657 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372377 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
771 B
YAML
25 lines
771 B
YAML
## Show that yaml2obj is able to write relocations for an unknown e_machine properly.
|
|
|
|
# RUN: yaml2obj %s -o %t1
|
|
# RUN: llvm-readelf %t1 --relocations | FileCheck %s
|
|
|
|
# CHECK: Relocation section '.rela.text' at offset 0x40 contains 2 entries:
|
|
# CHECK: Offset Info Type Symbol's Value Symbol's Name + Addend
|
|
# CHECK-NEXT: 0000000000000001 0000000000000002 Unknown 0
|
|
# CHECK-NEXT: 0000000000000003 0000000000000004 Unknown 0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2MSB
|
|
Type: ET_REL
|
|
Machine: 0x1234
|
|
Sections:
|
|
- Name: .rela.text
|
|
Type: SHT_RELA
|
|
Relocations:
|
|
- Offset: 0x1
|
|
Type: 0x2
|
|
- Offset: 0x3
|
|
Type: 0x4
|