summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-08-15 11:43:00 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-08-15 11:43:00 +0000
commit5290af8ad9ad8f5258305a11ca82936504fe5f42 (patch)
tree2ee8b799fb840d5030328d9c68678ad1e8f26012 /llvm/tools/yaml2obj
parent4b2317ebfb816d53cce4cd19f265e1aab0e04268 (diff)
downloadbcm5719-llvm-5290af8ad9ad8f5258305a11ca82936504fe5f42.tar.gz
bcm5719-llvm-5290af8ad9ad8f5258305a11ca82936504fe5f42.zip
[yaml2obj] - Teach tool to produce SHT_GROUP section with a custom type.
Currently, it is possible to use yaml2obj for producing SHT_GROUP sections of type GRP_COMDAT. For LLD test case I need to produce an object with a broken (different from GRP_COMDAT) type. The patch teaches tool to do such things. Differential revision: https://reviews.llvm.org/D50761 llvm-svn: 339764
Diffstat (limited to 'llvm/tools/yaml2obj')
-rw-r--r--llvm/tools/yaml2obj/yaml2elf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp
index 18f8a271d1b..ccf1bc82865 100644
--- a/llvm/tools/yaml2obj/yaml2elf.cpp
+++ b/llvm/tools/yaml2obj/yaml2elf.cpp
@@ -537,7 +537,8 @@ bool ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
unsigned int sectionIndex = 0;
if (member.sectionNameOrType == "GRP_COMDAT")
sectionIndex = llvm::ELF::GRP_COMDAT;
- else if (SN2I.lookup(member.sectionNameOrType, sectionIndex)) {
+ else if (SN2I.lookup(member.sectionNameOrType, sectionIndex) &&
+ !to_integer(member.sectionNameOrType, sectionIndex)) {
WithColor::error() << "Unknown section referenced: '"
<< member.sectionNameOrType << "' at YAML section' "
<< Section.Name << "\n";
OpenPOWER on IntegriCloud