summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-05-16 21:14:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-05-16 21:14:24 +0000
commite64619ce6e9a67354668790e842d9313e3ac6e74 (patch)
tree5c9d3dbfd5a7aac81b553919df823caa0340f243 /llvm/lib/CodeGen/AsmPrinter
parent01704bb1dbc3febdd7eb09ed0cd8f3ee65be5e98 (diff)
downloadbcm5719-llvm-e64619ce6e9a67354668790e842d9313e3ac6e74.tar.gz
bcm5719-llvm-e64619ce6e9a67354668790e842d9313e3ac6e74.zip
Fail early on unknown appending linkage variables.
In practice only a few well known appending linkage variables work. Currently if codegen sees an unknown appending linkage variable it will just print it as a regular global. That is wrong as the symbol in the produced object file has different semantics as the one provided by the appending linkage. This just errors early instead of producing a broken .o. llvm-svn: 269706
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index ed16eea8270..e9335054275 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -318,17 +318,14 @@ void AsmPrinter::EmitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const {
OutStreamer->EmitSymbolAttribute(GVSym, MCSA_Weak);
}
return;
- case GlobalValue::AppendingLinkage:
- // FIXME: appending linkage variables should go into a section of
- // their name or something. For now, just emit them as external.
case GlobalValue::ExternalLinkage:
- // If external or appending, declare as a global symbol.
- // .globl _foo
+ // If external, declare as a global symbol: .globl _foo
OutStreamer->EmitSymbolAttribute(GVSym, MCSA_Global);
return;
case GlobalValue::PrivateLinkage:
case GlobalValue::InternalLinkage:
return;
+ case GlobalValue::AppendingLinkage:
case GlobalValue::AvailableExternallyLinkage:
case GlobalValue::ExternalWeakLinkage:
llvm_unreachable("Should never emit this");
@@ -1562,7 +1559,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
return true;
}
- return false;
+ report_fatal_error("unknown special variable");
}
/// EmitLLVMUsedList - For targets that define a MAI::UsedDirective, mark each
OpenPOWER on IntegriCloud