1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/tools/obj2yaml/relocation-unsupported-machine.yaml
Georgii Rymar e3a21fcc35 [yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.
Before this change .symtab section was required for SHT_REL[A] section
declarations. yaml2obj automatically defined it in case when YAML document
did not have it.

With this change it is now possible to produce an object that
has a relocation section, but has no symbol table.

It simplifies the code and also it is inline with how we handle Link fields
for another special sections.

Differential revision: https://reviews.llvm.org/D69260
2019-10-29 11:43:12 +03:00

36 lines
933 B
YAML

## Show that obj2yaml is able to dump relocations when `e_machine` is unknown.
# RUN: yaml2obj %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s
# CHECK: --- !ELF
# CHECK-NEXT: FileHeader:
# CHECK-NEXT: Class: ELFCLASS64
# CHECK-NEXT: Data: ELFDATA2MSB
# CHECK-NEXT: Type: ET_REL
# CHECK-NEXT: Machine: 0x1234
# CHECK-NEXT: Sections:
# CHECK-NEXT: - Name: .rela.text
# CHECK-NEXT: Type: SHT_RELA
# CHECK-NEXT: EntSize: 0x0000000000000018
# CHECK-NEXT: Relocations:
# CHECK-NEXT: - Offset: 0x0000000000000001
# CHECK-NEXT: Type: 0x00000002
# CHECK-NEXT: - Offset: 0x0000000000000003
# CHECK-NEXT: Type: 0x00000004
--- !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