Fix assigning to _gp in linker scripts.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 20 Sep 2017 18:30:57 +0000 (18:30 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 20 Sep 2017 18:30:57 +0000 (18:30 +0000)
commit9be24cf516c79322e53d2d7b3a391117c4460883
treef1bf36758ce7bdd7597d8884265f6d2ff67ab294
parent1b30d63aeb3a7dec4084cc6d0a2de91a4be7f805
Fix assigning to _gp in linker scripts.

The previous logic was to try to detect if a linker script defined _gp
by checking !ElfSym::MipsGp->Value. That doesn't work in all cases as
the assigned value can be 0.

We now just always defined it Writer.cpp and always overwrite it
afterwards if needed.

llvm-svn: 313788
lld/ELF/LinkerScript.cpp
lld/ELF/Writer.cpp
lld/test/ELF/mips-gp-ext.s