diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-03 21:52:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-03 21:52:06 +0000 |
commit | 212fdde20540d79cf227f3e5a5e008099aad37b8 (patch) | |
tree | dfbceb001f81e0a9069ef22cd396da49dfb2b383 /llvm/lib/MC/MCSymbolELF.cpp | |
parent | 9f0c63bfdfe849095ff8c673f7b6bdb993144fa5 (diff) | |
download | bcm5719-llvm-212fdde20540d79cf227f3e5a5e008099aad37b8.tar.gz bcm5719-llvm-212fdde20540d79cf227f3e5a5e008099aad37b8.zip |
Remember if a weakref of a symbol has been used.
This avoids yet another last minute patching of the binding.
While at it, also simplify the weakref implementation a bit by not walking
past it in the expression evaluation.
llvm-svn: 238982
Diffstat (limited to 'llvm/lib/MC/MCSymbolELF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSymbolELF.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSymbolELF.cpp b/llvm/lib/MC/MCSymbolELF.cpp index 4e6def0c2e1..458248104e0 100644 --- a/llvm/lib/MC/MCSymbolELF.cpp +++ b/llvm/lib/MC/MCSymbolELF.cpp @@ -35,6 +35,8 @@ unsigned MCSymbolELF::getBinding() const { return ELF::STB_LOCAL; if (isUsedInReloc()) return ELF::STB_GLOBAL; + if (isWeakrefUsedInReloc()) + return ELF::STB_WEAK; if (isSignature()) return ELF::STB_LOCAL; return ELF::STB_GLOBAL; @@ -96,6 +98,10 @@ bool MCSymbolELF::isUsedInReloc() const { return UsedInReloc; } +void MCSymbolELF::setIsWeakrefUsedInReloc() const { WeakrefUsedInReloc = true; } + +bool MCSymbolELF::isWeakrefUsedInReloc() const { return WeakrefUsedInReloc; } + void MCSymbolELF::setIsSignature() const { IsSignature = true; } bool MCSymbolELF::isSignature() const { return IsSignature; } |