llvm.org GIT mirror llvm / f23f849
[yaml2obj] - Allow to use numeric sh_link (Link) value for sections. That change allows using numeric values for Link field. It is consistent with the code for another fields in this method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339873 91177308-0d34-0410-b5e6-96231b3b80d8 George Rimar 1 year, 1 month ago
2 changed file(s) with 26 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 # CHECK: Name: .text
4 # CHECK-NEXT: Type: SHT_PROGBITS
5 # CHECK-NEXT: Flags [
6 # CHECK-NEXT: SHF_ALLOC
7 # CHECK-NEXT: SHF_EXECINSTR
8 # CHECK-NEXT: ]
9 # CHECK-NEXT: Address:
10 # CHECK-NEXT: Offset:
11 # CHECK-NEXT: Size:
12 # CHECK-NEXT: Link: 12345
13
14 --- !ELF
15 FileHeader:
16 Class: ELFCLASS64
17 Data: ELFDATA2LSB
18 Type: ET_REL
19 Machine: EM_X86_64
20 Sections:
21 - Name: .text
22 Type: SHT_PROGBITS
23 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
24 Link: 12345
244244
245245 if (!Sec->Link.empty()) {
246246 unsigned Index;
247 if (SN2I.lookup(Sec->Link, Index)) {
247 if (SN2I.lookup(Sec->Link, Index) && !to_integer(Sec->Link, Index)) {
248248 WithColor::error() << "Unknown section referenced: '" << Sec->Link
249249 << "' at YAML section '" << Sec->Name << "'.\n";
250250 return false;