summaryrefslogtreecommitdiff
path: root/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
commit1b68a68c0409cb30dcdfbac1d04a6d5541dedd36 (patch)
tree655446f47ab118a9dcff647ed85442d340799995 /lib
parent3152576ea4768187f545efbffa1b542ab48eb9bc (diff)
downloadllvm-1b68a68c0409cb30dcdfbac1d04a6d5541dedd36.tar.gz
llvm-1b68a68c0409cb30dcdfbac1d04a6d5541dedd36.tar.bz2
llvm-1b68a68c0409cb30dcdfbac1d04a6d5541dedd36.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
index e55aa66713..3f5f42318f 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ b/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;
}