Store the real binding of shared symbols.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Nov 2017 01:04:51 +0000 (01:04 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 28 Nov 2017 01:04:51 +0000 (01:04 +0000)
commit9e3381e8dc447c936834cf291162a52cace2a517
treee51f3a7ded91fb325ae37ca7ed0ba1c86a1d405b
parentd7f6f1636d53c3e2faf55cdf20fbb44a1a149df1
Store the real binding of shared symbols.

Currently we mark every shared symbol as STB_WEAK.

That is a hack to make it easy to decide when a .so is needed or not
because of a reference to a given symbol.

That hack leaks when we create copy relocations as shown by the update
to relocation-copy-alias.s.

This patch stores the original binding when we first read a shared
symbol. We still have to update the binding to weak if we see a weak
undef, but I find the logic easier to read where it is now.

llvm-svn: 319127
lld/ELF/SymbolTable.cpp
lld/ELF/Symbols.h
lld/test/ELF/relocation-copy-alias.s