[ELF][MIPS] Revert r264761 and add test case to demonstrate the problem
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 30 Mar 2016 22:43:14 +0000 (22:43 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 30 Mar 2016 22:43:14 +0000 (22:43 +0000)
commitcf8c42f54605ad0d941751cd3b7d65b9a5463265
treeeed557b5ed179c678c654f1b316da728447cffbc
parenta7e5210eec1abec0a88454cf3f655aafd028fcfc
[ELF][MIPS] Revert r264761 and add test case to demonstrate the problem

If we make R_MIPS_LO16 a relative relocation, linker:
- never creates R_MIPS_COPY relocation for it
- attempts to create R_MIPS_REL32 dynamic relocation if R_MIPS_LO16's
  target is a preemptible symbol

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

llvm-svn: 264956
lld/ELF/Target.cpp
lld/ELF/Writer.cpp
lld/test/ELF/mips-lo16-not-relative.s [new file with mode: 0644]