[ELF] Do not skip relocation scanning checking if the symbol gets dynamic COPY reloca...
authorSimon Atanasyan <simon@atanasyan.com>
Sun, 10 Apr 2016 21:48:55 +0000 (21:48 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Sun, 10 Apr 2016 21:48:55 +0000 (21:48 +0000)
commit2615c3846fc9f4e5e6b05825f757409a1612e035
treed1084eccb4196436c5719d58c5bcde770912ccbd
parentf9e4576e080501459e22e75775e6b931a8e7fd85
[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
lld/ELF/Writer.cpp
lld/test/ELF/i386-got-and-copy.s [new file with mode: 0644]
lld/test/ELF/mips-got-and-copy.s [new file with mode: 0644]