llvm.org GIT mirror llvm / 312924a
[yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info field. This allows to set custom Info field value for SHT_GROUP sections. It is useful to allow this because we would be able to replace at least one binary object committed in LLD and replace it with the yaml2obj based test. Differential revision: https://reviews.llvm.org/D50776 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339772 91177308-0d34-0410-b5e6-96231b3b80d8 George Rimar 1 year, 1 month ago
2 changed file(s) with 28 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 # RUN: yaml2obj %s -o %t
1 # RUN: llvm-readobj -sections %t | FileCheck %s
2
3 --- !ELF
4 FileHeader:
5 Class: ELFCLASS64
6 Data: ELFDATA2LSB
7 Type: ET_REL
8 Machine: EM_X86_64
9 Sections:
10 - Name: .group
11 Type: SHT_GROUP
12 Link: .symtab
13 Info: 12345
14 Members:
15 - SectionOrType: GRP_COMDAT
16
17 ## Check we are able to produce SHT_GROUP section with a custom Info value (12345).
18 # CHECK: Name: .group
19 # CHECK-NEXT: Type: SHT_GROUP
20 # CHECK-NEXT: Flags [
21 # CHECK-NEXT: ]
22 # CHECK-NEXT: Address:
23 # CHECK-NEXT: Offset:
24 # CHECK-NEXT: Size:
25 # CHECK-NEXT: Link:
26 # CHECK-NEXT: Info: 12345
273273 return false;
274274 } else if (auto S = dyn_cast(Sec.get())) {
275275 unsigned SymIdx;
276 if (SymN2I.lookup(S->Info, SymIdx)) {
276 if (SymN2I.lookup(S->Info, SymIdx) && !to_integer(S->Info, SymIdx)) {
277277 WithColor::error() << "Unknown symbol referenced: '" << S->Info
278278 << "' at YAML section '" << S->Name << "'.\n";
279279 return false;