summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-06-14 14:25:34 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-06-14 14:25:34 +0000
commit0aecabae141be2e4ce94b64eda482a7a5d58815d (patch)
treec9ba80671392f3bff3b2100d1dd415f67d5625b5 /llvm/tools/yaml2obj
parent00e3968b8a411eb95eb2cc544a6b499ca0ad299d (diff)
downloadbcm5719-llvm-0aecabae141be2e4ce94b64eda482a7a5d58815d.tar.gz
bcm5719-llvm-0aecabae141be2e4ce94b64eda482a7a5d58815d.zip
Revert "Revert r363377: [yaml2obj] - Allow setting custom section types for implicit sections."
LLD test case will be fixed in a following commit. Original commit message: [yaml2obj] - Allow setting custom section types for implicit sections. We were hardcoding the final section type for sections that are usually implicit. The patch fixes that. This also fixes a few issues in existent test cases and removes one precompiled object. Differential revision: https://reviews.llvm.org/D63267 llvm-svn: 363401
Diffstat (limited to 'llvm/tools/yaml2obj')
-rw-r--r--llvm/tools/yaml2obj/yaml2elf.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp
index 098c3d6f6bf..8e4ea786c85 100644
--- a/llvm/tools/yaml2obj/yaml2elf.cpp
+++ b/llvm/tools/yaml2obj/yaml2elf.cpp
@@ -403,7 +403,11 @@ void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader,
zero(SHeader);
SHeader.sh_name = DotShStrtab.getOffset(IsStatic ? ".symtab" : ".dynsym");
- SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM;
+
+ if (YAMLSec)
+ SHeader.sh_type = YAMLSec->Type;
+ else
+ SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM;
if (RawSec && !RawSec->Link.empty()) {
// If the Link field is explicitly defined in the document,
@@ -467,7 +471,7 @@ void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
ELFYAML::Section *YAMLSec) {
zero(SHeader);
SHeader.sh_name = DotShStrtab.getOffset(Name);
- SHeader.sh_type = ELF::SHT_STRTAB;
+ SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_STRTAB;
SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1;
ELFYAML::RawContentSection *RawSec =
OpenPOWER on IntegriCloud