diff options
| author | Rui Ueyama <ruiu@google.com> | 2015-12-26 10:22:16 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2015-12-26 10:22:16 +0000 |
| commit | 1b2a8bf643791e38e083a03325dc0a9656f389cd (patch) | |
| tree | 61d4b991206f30291fc620d65cf92d1bff7b2695 | |
| parent | 7b7ec71fea5c51cd1f5707a1560c4e0b4d2da2bf (diff) | |
| download | bcm5719-llvm-1b2a8bf643791e38e083a03325dc0a9656f389cd.tar.gz bcm5719-llvm-1b2a8bf643791e38e083a03325dc0a9656f389cd.zip | |
Add comments.
llvm-svn: 256447
| -rw-r--r-- | lld/ELF/Writer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 3c81eb46b43..fb74a3153d9 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -727,12 +727,13 @@ template <class ELFT> void Writer<ELFT>::addReservedSymbols() { // Create output section objects and add them to OutputSections. template <class ELFT> void Writer<ELFT>::createSections() { - // .interp needs to be on the first page in the output file. + // Add .interp first because some loaders want to see that section + // on the first page of the executable file when loaded into memory. if (needsInterpSection()) OutputSections.push_back(Out<ELFT>::Interp); + // Create output sections for input object file sections. std::vector<OutputSectionBase<ELFT> *> RegularSections; - OutputSectionFactory<ELFT> Factory; for (const std::unique_ptr<ObjectFile<ELFT>> &F : Symtab.getObjectFiles()) { for (InputSectionBase<ELFT> *C : F->getSections()) { @@ -792,6 +793,8 @@ template <class ELFT> void Writer<ELFT>::createSections() { // Define __rel[a]_iplt_{start,end} symbols if needed. addRelIpltSymbols(); + // Now that we have defined all possible symbols including linker- + // synthesized ones. Visit all symbols to give the finishing touches. std::vector<DefinedCommon *> CommonSymbols; std::vector<SharedSymbol<ELFT> *> CopyRelSymbols; for (auto &P : Symtab.getSymbols()) { |

