ELF: Create dynamic symbols for symbol aliases of copy relocations.
For each copy relocation that we create, look through the DSO's symbol table
for aliases and create a dynamic symbol for each one. This causes the copy
relocation to correctly interpose any aliases.
Copy relocations are relatively uncommon (on my machine, 56% of binaries in
/usr/bin have no copy relocations probably due to being PIEs, 97% of them
have <10, and the binary with the largest number of them has 97) so it's
probably fine to do this in a relatively inefficient way.
Differential Revision: http://reviews.llvm.org/D18731
llvm-svn: 265354
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index c019fa0..7617585 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -839,7 +839,7 @@
// This function is called after we sort input sections
// and scan relocations to setup sections' offsets.
template <class ELFT> void OutputSection<ELFT>::assignOffsets() {
- uintX_t Off = 0;
+ uintX_t Off = this->Header.sh_size;
for (InputSection<ELFT> *S : Sections) {
Off = alignTo(Off, S->Align);
S->OutSecOff = Off;