[lld] r256446 - Rename SharedCopy -> CopyRel.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 26 02:07:05 PST 2015
Author: ruiu
Date: Sat Dec 26 04:07:03 2015
New Revision: 256446
URL: http://llvm.org/viewvc/llvm-project?rev=256446&view=rev
Log:
Rename SharedCopy -> CopyRel.
Because I think CopyRel is a better name for copy relocations
than SharedCopy.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=256446&r1=256445&r2=256446&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Sat Dec 26 04:07:03 2015
@@ -70,7 +70,7 @@ private:
OutputSection<ELFT> *getBSS();
void addCommonSymbols(std::vector<DefinedCommon *> &Syms);
- void addSharedCopySymbols(std::vector<SharedSymbol<ELFT> *> &Syms);
+ void addCopyRelSymbols(std::vector<SharedSymbol<ELFT> *> &Syms);
std::unique_ptr<llvm::FileOutputBuffer> Buffer;
@@ -500,16 +500,11 @@ void Writer<ELFT>::addCommonSymbols(std:
Out<ELFT>::Bss->setSize(Off);
}
+// Reserve space in .bss for copy relocations.
template <class ELFT>
-void Writer<ELFT>::addSharedCopySymbols(
- std::vector<SharedSymbol<ELFT> *> &Syms) {
- typedef typename ELFFile<ELFT>::uintX_t uintX_t;
- typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
- typedef typename ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
-
+void Writer<ELFT>::addCopyRelSymbols(std::vector<SharedSymbol<ELFT> *> &Syms) {
if (Syms.empty())
return;
-
uintX_t Off = getBSS()->getSize();
for (SharedSymbol<ELFT> *C : Syms) {
const Elf_Sym &Sym = C->Sym;
@@ -798,7 +793,7 @@ template <class ELFT> void Writer<ELFT>:
addRelIpltSymbols();
std::vector<DefinedCommon *> CommonSymbols;
- std::vector<SharedSymbol<ELFT> *> SharedCopySymbols;
+ std::vector<SharedSymbol<ELFT> *> CopyRelSymbols;
for (auto &P : Symtab.getSymbols()) {
SymbolBody *Body = P.second->Body;
if (auto *U = dyn_cast<Undefined>(Body))
@@ -809,7 +804,7 @@ template <class ELFT> void Writer<ELFT>:
CommonSymbols.push_back(C);
if (auto *SC = dyn_cast<SharedSymbol<ELFT>>(Body))
if (SC->NeedsCopy)
- SharedCopySymbols.push_back(SC);
+ CopyRelSymbols.push_back(SC);
if (!includeInSymtab<ELFT>(*Body))
continue;
@@ -820,7 +815,7 @@ template <class ELFT> void Writer<ELFT>:
Out<ELFT>::DynSymTab->addSymbol(Body);
}
addCommonSymbols(CommonSymbols);
- addSharedCopySymbols(SharedCopySymbols);
+ addCopyRelSymbols(CopyRelSymbols);
// So far we have added sections from input object files.
// This function adds linker-created Out<ELFT>::* sections.
More information about the llvm-commits
mailing list