summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj/yaml2elf.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2015-07-03 14:07:06 +0000
committerSimon Atanasyan <simon@atanasyan.com>2015-07-03 14:07:06 +0000
commitb776eaed2e604d1b16041178ded4e74ab83a3555 (patch)
treeb4f24290b9698669f69572ad855fa62ebe62ef39 /llvm/tools/yaml2obj/yaml2elf.cpp
parent3b25b479bf8156ad340bec1e7ee287791bda240e (diff)
downloadbcm5719-llvm-b776eaed2e604d1b16041178ded4e74ab83a3555.tar.gz
bcm5719-llvm-b776eaed2e604d1b16041178ded4e74ab83a3555.zip
[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
SHT_NOBITS sections do not have content in an object file. Now yaml2obj tool does not accept `Content` field for such sections, and obj2yaml tool does not attempt to read the section content from a file. llvm-svn: 241350
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2elf.cpp')
-rw-r--r--llvm/tools/yaml2obj/yaml2elf.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp
index 772b5b918ec..795d5426291 100644
--- a/llvm/tools/yaml2obj/yaml2elf.cpp
+++ b/llvm/tools/yaml2obj/yaml2elf.cpp
@@ -241,6 +241,8 @@ bool ELFState<ELFT>::initSectionHeaders(std::vector<Elf_Shdr> &SHeaders,
} else if (auto S = dyn_cast<ELFYAML::MipsABIFlags>(Sec.get())) {
if (!writeSectionContent(SHeader, *S, CBA))
return false;
+ } else if (isa<ELFYAML::NoBitsSection>(Sec.get())) {
+ // SHT_NOBITS section does not have content so nothing to do here.
} else
llvm_unreachable("Unknown section type");
OpenPOWER on IntegriCloud