summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2019-03-04 19:12:56 +0000
committerNirav Dave <niravd@google.com>2019-03-04 19:12:56 +0000
commit05e233507697ab81007a6b48728add2ee4627e5b (patch)
treeec7bf318f1a211b36a73fd1187ca1b6a6b1f3ed9 /llvm/lib/MC/ELFObjectWriter.cpp
parent509a8a3cf11aac07e51342c46545cff461373ed6 (diff)
downloadbcm5719-llvm-05e233507697ab81007a6b48728add2ee4627e5b.tar.gz
bcm5719-llvm-05e233507697ab81007a6b48728add2ee4627e5b.zip
[MC] Teach ELFObjectWriter that parse-time variables do not appear in
symbol table. llvm-svn: 355325
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index aec2bdeded3..4e0a4f45431 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -577,6 +577,10 @@ bool ELFWriter::isInSymtab(const MCAsmLayout &Layout, const MCSymbolELF &Symbol,
bool Used, bool Renamed) {
if (Symbol.isVariable()) {
const MCExpr *Expr = Symbol.getVariableValue();
+ // Target Expressions that are always inlined do not appear in the symtab
+ if (const auto *T = dyn_cast<MCTargetExpr>(Expr))
+ if (T->inlineAssignedExpr())
+ return false;
if (const MCSymbolRefExpr *Ref = dyn_cast<MCSymbolRefExpr>(Expr)) {
if (Ref->getKind() == MCSymbolRefExpr::VK_WEAKREF)
return false;
OpenPOWER on IntegriCloud