Now that the ELFFile constructor does nothing, create it when needed.
This avoids duplicating the buffer in InputFile.
llvm-svn: 285965
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 99f7ac1..23d929f 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -776,7 +776,7 @@
template <class ELFT>
void scanRelocations(InputSectionBase<ELFT> &S,
const typename ELFT::Shdr &RelSec) {
- ELFFile<ELFT> &EObj = S.getFile()->getObj();
+ ELFFile<ELFT> EObj = S.getFile()->getObj();
if (RelSec.sh_type == SHT_RELA)
scanRelocs(S, check(EObj.relas(&RelSec)));
else
@@ -806,7 +806,7 @@
template <class ELFT>
void createThunks(InputSectionBase<ELFT> &S,
const typename ELFT::Shdr &RelSec) {
- ELFFile<ELFT> &EObj = S.getFile()->getObj();
+ ELFFile<ELFT> EObj = S.getFile()->getObj();
if (RelSec.sh_type == SHT_RELA)
createThunks(S, check(EObj.relas(&RelSec)));
else