llvm-project/lld/test/ELF/sht-group-empty.test
Georgii Rymar e4ceb8f421 [lib/ObjectYAML] - Make ELFYAML::Relocation::Offset optional.
Currently `yaml2obj` require `Offset` field in a relocation description.
There are many cases when `Offset` is insignificant in a context of a test case.

Making `Offset` optional allows to simplify our test cases.
This is what this patch does.

Also, with this patch `obj2yaml` does not dump a zero offset of a relocation.

Differential revision: https://reviews.llvm.org/D75608
2020-03-06 13:59:58 +03:00

55 lines
1.6 KiB
Plaintext

# RUN: yaml2obj %s -o %t.o
# RUN: ld.lld %t.o %t.o -o %t -r
# RUN: llvm-readobj -S %t | FileCheck %s
# CHECK: Name: .text.foo
# CHECK: Name: .rela.text.foo
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .group
Type: SHT_GROUP
Link: .symtab
Info: foo
Members:
- SectionOrType: GRP_COMDAT
- SectionOrType: .text.foo
- SectionOrType: .text.bar
- SectionOrType: .note
- Name: .note
Type: SHT_NOTE
Flags: [ SHF_GROUP ]
Content: ""
- Name: .text.foo
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
- Name: .text.bar
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
- Name: .rela.text.foo
Type: SHT_RELA
Flags: [ SHF_INFO_LINK, SHF_GROUP ]
Link: .symtab
Info: .text.foo
Relocations:
- Symbol: foo
Type: R_X86_64_64
- Name: .rela.text.bar
Type: SHT_RELA
Flags: [ SHF_INFO_LINK, SHF_GROUP ]
Link: .symtab
Info: .text.bar
Relocations:
- Symbol: bar
Type: R_X86_64_64
Symbols:
- Name: foo
Binding: STB_GLOBAL
- Name: bar
Binding: STB_GLOBAL