[PATCH] D50776: [yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info field.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 06:56:07 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339772: [yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info… (authored by grimar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50776?vs=160793&id=160797#toc
Repository:
rL LLVM
https://reviews.llvm.org/D50776
Files:
llvm/trunk/test/tools/yaml2obj/elf-comdat-broken-info.yaml
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Index: llvm/trunk/test/tools/yaml2obj/elf-comdat-broken-info.yaml
===================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-comdat-broken-info.yaml
+++ llvm/trunk/test/tools/yaml2obj/elf-comdat-broken-info.yaml
@@ -0,0 +1,27 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-readobj -sections %t | FileCheck %s
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .group
+ Type: SHT_GROUP
+ Link: .symtab
+ Info: 12345
+ Members:
+ - SectionOrType: GRP_COMDAT
+
+## Check we are able to produce SHT_GROUP section with a custom Info value (12345).
+# CHECK: Name: .group
+# CHECK-NEXT: Type: SHT_GROUP
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address:
+# CHECK-NEXT: Offset:
+# CHECK-NEXT: Size:
+# CHECK-NEXT: Link:
+# CHECK-NEXT: Info: 12345
Index: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
===================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp
@@ -274,7 +274,7 @@
return false;
} else if (auto S = dyn_cast<ELFYAML::Group>(Sec.get())) {
unsigned SymIdx;
- if (SymN2I.lookup(S->Info, SymIdx)) {
+ if (SymN2I.lookup(S->Info, SymIdx) && !to_integer(S->Info, SymIdx)) {
WithColor::error() << "Unknown symbol referenced: '" << S->Info
<< "' at YAML section '" << S->Name << "'.\n";
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50776.160797.patch
Type: text/x-patch
Size: 1626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180815/c3509d82/attachment.bin>
More information about the llvm-commits
mailing list