diff options
| author | Shankar Easwaran <shankare@codeaurora.org> | 2013-10-07 02:47:09 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankare@codeaurora.org> | 2013-10-07 02:47:09 +0000 |
| commit | a96f3a3da45cf6f37998df918f3c90ec9e6e2fec (patch) | |
| tree | 8c69bcec8537cf344963c094feb68de6664f63de /lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h | |
| parent | 4f44079a2ca1467d0d6a0bb053a338a6b6e795d6 (diff) | |
| download | bcm5719-llvm-a96f3a3da45cf6f37998df918f3c90ec9e6e2fec.tar.gz bcm5719-llvm-a96f3a3da45cf6f37998df918f3c90ec9e6e2fec.zip | |
[lld][InputGraph] Change the Resolver to use inputGraph
Changes :-
a) Functionality in InputGraph to insert Input elements at any position
b) Functionality in the Resolver to use nextFile
c) Move the functionality of assigning file ordinals to InputGraph
d) Changes all inputs to MemoryBuffers
e) Remove LinkerInput, InputFiles, ReaderArchive
llvm-svn: 192081
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h')
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h index 9d057becbeb..176a14f912f 100644 --- a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h @@ -26,16 +26,17 @@ template<class ELFT> class DynamicLibraryWriter : public OutputELFWriter<ELFT> { public: DynamicLibraryWriter(const ELFLinkingContext &context) - : OutputELFWriter<ELFT>(context), _runtimeFile(context) {} + : OutputELFWriter<ELFT>(context), + _runtimeFile(new CRuntimeFile<ELFT>(context)) {} private: void buildDynamicSymbolTable(const File &file); void addDefaultAtoms(); - virtual void addFiles(InputFiles &); + virtual bool createImplicitFiles(std::vector<std::unique_ptr<File> > &); void finalizeDefaultAtomValues(); llvm::BumpPtrAllocator _alloc; - CRuntimeFile<ELFT> _runtimeFile; + std::unique_ptr<CRuntimeFile<ELFT> > _runtimeFile; }; //===----------------------------------------------------------------------===// @@ -62,19 +63,18 @@ void DynamicLibraryWriter<ELFT>::buildDynamicSymbolTable(const File &file) { } template <class ELFT> void DynamicLibraryWriter<ELFT>::addDefaultAtoms() { - _runtimeFile.addAbsoluteAtom("_end"); + _runtimeFile->addAbsoluteAtom("_end"); } /// \brief Hook in lld to add CRuntime file template <class ELFT> -void DynamicLibraryWriter<ELFT>::addFiles(InputFiles &inputFiles) { +bool DynamicLibraryWriter<ELFT>::createImplicitFiles( + std::vector<std::unique_ptr<File> > &result) { // Add the default atoms as defined by executables addDefaultAtoms(); - // Add the runtime file - inputFiles.prependFile(_runtimeFile); - // Add the Linker internal file for symbols that are defined by - // command line options - OutputELFWriter<ELFT>::addFiles(inputFiles); + OutputELFWriter<ELFT>::createImplicitFiles(result); + result.push_back(std::move(_runtimeFile)); + return true; } template <class ELFT> |

