Initialize the RelocationSectionBase::Section member.
authorJames Y Knight <jyknight@google.com>
Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)
committerJames Y Knight <jyknight@google.com>
Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)
In r314227, it wasn't always, and would thus contain random garbage.

llvm-svn: 314256

llvm/tools/llvm-objcopy/Object.cpp

index cb7fdde..103937e 100644 (file)
@@ -218,6 +218,8 @@ void RelocationSectionBase<SymTabType>::initialize(SectionTableRef SecTable) {
     setSection(SecTable.getSection(Info,
                                    "Info field value " + Twine(Info) +
                                        " in section " + Name + " is invalid"));
+  else
+    setSection(nullptr);
 }
 
 template <class SymTabType> void RelocationSectionBase<SymTabType>::finalize() {