summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-01 12:45:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-01 12:45:43 +0000
commit4a04294882bdd530bd0c3b388980e5326423e1b2 (patch)
tree567b6b8c47363745ec6739451d36139aae8ce254 /llvm/lib
parentc5f2bca86615322f0295f0cf448dfc350f6e7d1e (diff)
downloadbcm5719-llvm-4a04294882bdd530bd0c3b388980e5326423e1b2.tar.gz
bcm5719-llvm-4a04294882bdd530bd0c3b388980e5326423e1b2.zip
Don't force symbols to be globals in .thumb_set.
We currently force symbols to be globals in .thumb_set. The intent seems to be that given .thumb_set foo, bar we emit an undefined symbol to bar if it is never defined. The side effect is that we mark bar as global, even if it is defined, which gas does not. Producing an undefined reference to bar is a general difference from MC and gas. For example, given a = b gas will produce an undefined reference to b, MC will not. I would be surprised if any code depends on this, but it it does, we should fix the general difference, not special case .thumb_set. llvm-svn: 207757
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
index e55aa667134..3f5f42318ff 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -1003,11 +1003,8 @@ ARMTargetELFStreamer::AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *S) {
void ARMTargetELFStreamer::emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) {
if (const MCSymbolRefExpr *SRE = dyn_cast<MCSymbolRefExpr>(Value)) {
- // FIXME: Doing a lookup in here is a hack.
- MCSymbol *Sym =
- getStreamer().getContext().LookupSymbol(SRE->getSymbol().getName());
- if (!Sym->isDefined()) {
- getStreamer().EmitSymbolAttribute(Sym, MCSA_Global);
+ const MCSymbol &Sym = SRE->getSymbol();
+ if (!Sym.isDefined()) {
getStreamer().EmitAssignment(Symbol, Value);
return;
}
OpenPOWER on IntegriCloud