Allow use define symbols to override linker defined ones.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 17 Nov 2016 21:20:16 +0000 (21:20 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 17 Nov 2016 21:20:16 +0000 (21:20 +0000)
commitdab02d4b6851bc0230660edd494ea57aee73f317
tree8bebd8940fd3860a2b28e817290e69dad67e112c
parent3165945a419e4882b94f73f005f9ea4d3d10a985
Allow use define symbols to override linker defined ones.

I hit an internal linker script that was defining _DYNAMIC instead of
letting the linker do it. It turns out that both bfd and gold allow
that.

This is pretty easy to implement, just make the linker defined symbol
weak. This should have no impact in the case where there is no user
defined symbol: The visibility is hidden, which causes the output to
still be local.

llvm-svn: 287260
lld/ELF/Writer.cpp
lld/test/ELF/duplicate-internal.s [deleted file]
lld/test/ELF/linkerscript/dynamic-sym.s [new file with mode: 0644]