diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2018-06-11 08:37:19 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2018-06-11 08:37:19 +0000 |
commit | 00d8843fa39e917882023c54f43eb4b77c113e4c (patch) | |
tree | a66a700907988c60ec55851f0a33b7dd8a22c7eb /lld/ELF/SyntheticSections.cpp | |
parent | f4f6899cdf0d7dff6d06e26ac71d782ae9d18292 (diff) | |
download | bcm5719-llvm-00d8843fa39e917882023c54f43eb4b77c113e4c.tar.gz bcm5719-llvm-00d8843fa39e917882023c54f43eb4b77c113e4c.zip |
[ELF] Pass a pointer to InputFile to the getRelocTargetVA to escape dereferencing of nullptr. NFC
llvm-svn: 334392
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index cd0d3fe525c..4195ed9a2e8 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -708,10 +708,10 @@ MipsGotSection::FileGot &MipsGotSection::getGot(InputFile &F) { return Gots[*F.MipsGotIndex]; } -uint64_t MipsGotSection::getPageEntryOffset(const InputFile &F, +uint64_t MipsGotSection::getPageEntryOffset(const InputFile *F, const Symbol &Sym, int64_t Addend) const { - const FileGot &G = Gots[*F.MipsGotIndex]; + const FileGot &G = Gots[*F->MipsGotIndex]; uint64_t Index = 0; if (const OutputSection *OutSec = Sym.getOutputSection()) { uint64_t SecAddr = getMipsPageAddr(OutSec->Addr); @@ -723,9 +723,9 @@ uint64_t MipsGotSection::getPageEntryOffset(const InputFile &F, return Index * Config->Wordsize; } -uint64_t MipsGotSection::getSymEntryOffset(const InputFile &F, const Symbol &S, +uint64_t MipsGotSection::getSymEntryOffset(const InputFile *F, const Symbol &S, int64_t Addend) const { - const FileGot &G = Gots[*F.MipsGotIndex]; + const FileGot &G = Gots[*F->MipsGotIndex]; Symbol *Sym = const_cast<Symbol *>(&S); if (Sym->isTls()) return G.Tls.find(Sym)->second * Config->Wordsize; @@ -734,14 +734,14 @@ uint64_t MipsGotSection::getSymEntryOffset(const InputFile &F, const Symbol &S, return G.Local16.find({Sym, Addend})->second * Config->Wordsize; } -uint64_t MipsGotSection::getTlsIndexOffset(const InputFile &F) const { - const FileGot &G = Gots[*F.MipsGotIndex]; +uint64_t MipsGotSection::getTlsIndexOffset(const InputFile *F) const { + const FileGot &G = Gots[*F->MipsGotIndex]; return G.DynTlsSymbols.find(nullptr)->second * Config->Wordsize; } -uint64_t MipsGotSection::getGlobalDynOffset(const InputFile &F, +uint64_t MipsGotSection::getGlobalDynOffset(const InputFile *F, const Symbol &S) const { - const FileGot &G = Gots[*F.MipsGotIndex]; + const FileGot &G = Gots[*F->MipsGotIndex]; Symbol *Sym = const_cast<Symbol *>(&S); return G.DynTlsSymbols.find(Sym)->second * Config->Wordsize; } |