aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-02-23 20:22:07 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-02-23 20:22:07 +0000
commit21451e533f4c46cdb38d338cfed26cece1d7be54 (patch)
treea4507e94d53c5fa83f7d77e81c7f6c0b6966af45 /lib/MC/ELFObjectWriter.cpp
parentd04b4937d1bc4ed14642926321127e9922e66c3b (diff)
downloadexternal_llvm-21451e533f4c46cdb38d338cfed26cece1d7be54.zip
external_llvm-21451e533f4c46cdb38d338cfed26cece1d7be54.tar.gz
external_llvm-21451e533f4c46cdb38d338cfed26cece1d7be54.tar.bz2
Put in the symbol table symbols only used in a .globl statement.
Fixes PR9292. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/ELFObjectWriter.cpp')
-rw-r--r--lib/MC/ELFObjectWriter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp
index 8067b52..ea1629d 100644
--- a/lib/MC/ELFObjectWriter.cpp
+++ b/lib/MC/ELFObjectWriter.cpp
@@ -833,7 +833,11 @@ static bool isInSymtab(const MCAssembler &Asm, const MCSymbolData &Data,
return true;
const MCSymbol &A = Symbol.AliasedSymbol();
- if (!A.isVariable() && A.isUndefined() && !Data.isCommon())
+ if (Symbol.isVariable() && !A.isVariable() && A.isUndefined())
+ return false;
+
+ bool IsGlobal = GetBinding(Data) == ELF::STB_GLOBAL;
+ if (!Symbol.isVariable() && Symbol.isUndefined() && !IsGlobal)
return false;
if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())