Commit Graph

2 Commits

Author SHA1 Message Date
Rafael Espindola a85efd985c Don't create dynamic relocations to ro segments.
These would just crash at runtime.

If we ever decide to support rw text segments this should make it easier
to implement as there is now a single point where we notice the problem.

I have tested this with a freebsd buildworld. It found a non pic
assembly file being linked into a .so,. With that fixed, buildworld
finished.

llvm-svn: 268149
2016-04-30 01:15:17 +00:00
Simon Atanasyan 2615c3846f [ELF] Do not skip relocation scanning checking if the symbol gets dynamic COPY relocation already
It is possible that the same symbol referenced by two kinds of
relocations at the same time. The first type requires say GOT entry
creation, the second type requires dynamic copy relocation. For MIPS
targets they might be R_MIPS_GOT16 and R_MIPS_HI16 relocations. For X86
target they might be R_386_GOT32 and R_386_32 respectively.

Now LLD never creates GOT entry for a symbol if this symbol already has
related copy relocation. This patch solves this problem.

Differential Revision: http://reviews.llvm.org/D18862

llvm-svn: 265910
2016-04-10 21:48:55 +00:00