forked from OSchip/llvm-project
[ELF] Fix uninitialized variables
Properly initialize _exportDynamic in ELFLinkingContext and an ELF_Sym object created in CRuntimeFile with default values. llvm-svn: 219380
This commit is contained in:
parent
147c2ea05a
commit
9fe8db2e02
|
@ -390,6 +390,7 @@ public:
|
||||||
symbol->st_name = 0;
|
symbol->st_name = 0;
|
||||||
symbol->st_value = 0;
|
symbol->st_value = 0;
|
||||||
symbol->st_shndx = llvm::ELF::SHN_UNDEF;
|
symbol->st_shndx = llvm::ELF::SHN_UNDEF;
|
||||||
|
symbol->setBindingAndType(llvm::ELF::STB_GLOBAL, llvm::ELF::STT_NOTYPE);
|
||||||
symbol->st_other = llvm::ELF::STV_DEFAULT;
|
symbol->st_other = llvm::ELF::STV_DEFAULT;
|
||||||
symbol->st_size = 0;
|
symbol->st_size = 0;
|
||||||
auto newAtom = this->handleUndefinedSymbol(symbolName, symbol);
|
auto newAtom = this->handleUndefinedSymbol(symbolName, symbol);
|
||||||
|
|
|
@ -57,10 +57,11 @@ ELFLinkingContext::ELFLinkingContext(
|
||||||
: _outputELFType(elf::ET_EXEC), _triple(triple),
|
: _outputELFType(elf::ET_EXEC), _triple(triple),
|
||||||
_targetHandler(std::move(targetHandler)), _baseAddress(0),
|
_targetHandler(std::move(targetHandler)), _baseAddress(0),
|
||||||
_isStaticExecutable(false), _noInhibitExec(false),
|
_isStaticExecutable(false), _noInhibitExec(false),
|
||||||
_mergeCommonStrings(false), _runLayoutPass(true),
|
_exportDynamic(false), _mergeCommonStrings(false),
|
||||||
_useShlibUndefines(true), _dynamicLinkerArg(false),
|
_runLayoutPass(true), _useShlibUndefines(true),
|
||||||
_noAllowDynamicLibraries(false), _mergeRODataToTextSegment(true),
|
_dynamicLinkerArg(false), _noAllowDynamicLibraries(false),
|
||||||
_outputMagic(OutputMagic::DEFAULT), _sysrootPath("") {}
|
_mergeRODataToTextSegment(true), _outputMagic(OutputMagic::DEFAULT),
|
||||||
|
_sysrootPath("") {}
|
||||||
|
|
||||||
bool ELFLinkingContext::is64Bits() const { return getTriple().isArch64Bit(); }
|
bool ELFLinkingContext::is64Bits() const { return getTriple().isArch64Bit(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue