diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-02-22 21:11:47 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-02-22 21:11:47 +0000 |
commit | d55a2664f9493a4c3be242a75d339fac0ebe2e21 (patch) | |
tree | 9d8ab0c9cdcdc7648633e9e839c955c503ad73ef /lib/Target/PowerPC | |
parent | 13b151c111de2dbd37aea7cdf1ca46d78073e066 (diff) | |
download | external_llvm-d55a2664f9493a4c3be242a75d339fac0ebe2e21.zip external_llvm-d55a2664f9493a4c3be242a75d339fac0ebe2e21.tar.gz external_llvm-d55a2664f9493a4c3be242a75d339fac0ebe2e21.tar.bz2 |
Allow the use of an alternate symbol for calculating a function's size.
The standard function epilog includes a .size directive, but ppc64 uses
an alternate local symbol to tag the actual start of each function.
Until recently, binutils accepted the .size directive as:
.size test1, .Ltmp0-test1
however, using this directive with recent binutils will result in the error:
.size expression for XXX does not evaluate to a constant
so we must use the label which actually tags the start of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 0380472..505559b 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -398,7 +398,11 @@ void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() { OutStreamer.EmitRawText("\t.quad .L." + Twine(CurrentFnSym->getName()) + ",.TOC.@tocbase"); OutStreamer.EmitRawText(StringRef("\t.previous")); - OutStreamer.EmitRawText(".L." + Twine(CurrentFnSym->getName()) + ":"); + + MCSymbol *RealFnSym = OutContext.GetOrCreateSymbol( + ".L." + Twine(CurrentFnSym->getName())); + OutStreamer.EmitLabel(RealFnSym); + CurrentFnSymForSize = RealFnSym; } |