summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/OutputSections.cpp1
-rw-r--r--lld/ELF/OutputSections.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 08fed9a43ae..acbdd31cb1a 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -44,6 +44,7 @@ template <class ELFT>
OutputSectionBase<ELFT>::OutputSectionBase(StringRef Name, uint32_t Type,
uintX_t Flags)
: Name(Name) {
+ memset(&Header, 0, sizeof(Elf_Shdr));
Header.sh_type = Type;
Header.sh_flags = Flags;
}
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index 85808a820c5..19ea8ddaa84 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -97,7 +97,7 @@ public:
protected:
StringRef Name;
- Elf_Shdr Header = {};
+ Elf_Shdr Header;
};
template <class ELFT> class GotSection final : public OutputSectionBase<ELFT> {
OpenPOWER on IntegriCloud