summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-12-04 00:45:43 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-12-04 00:45:43 +0000
commit2bb9c5ca221efe2c1ad77e85f13d8531c457807f (patch)
tree34ba78123475c1d2c81b9c92936c9ef6e20f83c7 /llvm/lib/CodeGen
parentd6487b23a9c0caa059898e0a497393fb824966aa (diff)
downloadbcm5719-llvm-2bb9c5ca221efe2c1ad77e85f13d8531c457807f.tar.gz
bcm5719-llvm-2bb9c5ca221efe2c1ad77e85f13d8531c457807f.zip
Emit function alias to data as a function symbol.
CFI emits jump slots for indirect functions as a byte array constant, and declares function-typed aliases to these constants. This change fixes AsmPrinter to emit these aliases as function symbols and not data symbols. llvm-svn: 254674
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 2cfea650872..b8604240b5d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1187,6 +1187,11 @@ bool AsmPrinter::doFinalization(Module &M) {
else
assert(Alias.hasLocalLinkage() && "Invalid alias linkage");
+ // Set the symbol type to function if the alias has a function type.
+ // This affects codegen when the aliasee is not a function.
+ if (Alias.getType()->getPointerElementType()->isFunctionTy())
+ OutStreamer->EmitSymbolAttribute(Name, MCSA_ELF_TypeFunction);
+
EmitVisibility(Name, Alias.getVisibility());
// Emit the directives as assignments aka .set:
OpenPOWER on IntegriCloud