summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-08-29 20:22:24 +0000
committerHal Finkel <hfinkel@anl.gov>2012-08-29 20:22:24 +0000
commit1859d265281b20413cbfc2717569112abc8443e4 (patch)
treeda3b6a99d1cc09c2a76e1a64731bc60d70649c71 /llvm/lib
parent16ee0057ab6781b9606bc39935e94f3c005e5040 (diff)
downloadbcm5719-llvm-1859d265281b20413cbfc2717569112abc8443e4.tar.gz
bcm5719-llvm-1859d265281b20413cbfc2717569112abc8443e4.zip
Reserve space for the mandatory traceback fields on PPC64.
We need to reserve space for the mandatory traceback fields, though leaving them as zero is appropriate for now. Although the ABI calls for these fields to be filled in fully, no compiler on Linux currently does this, and GDB does not read these fields. GDB uses the first word of zeroes during exception handling to find the end of the function and the size field, allowing it to compute the beginning of the function. DWARF information is used for everything else. We need the extra 8 bytes of pad so the size field is found in the right place. As a comparison, GCC fills in a few of the fields -- language, number of saved registers -- but ignores the rest. IBM's proprietary OSes do make use of the full traceback table facility. Patch by Bill Schmidt. llvm-svn: 162854
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index de3241504dc..1c9a23aa684 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -458,11 +458,15 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
void PPCLinuxAsmPrinter::EmitFunctionBodyEnd() {
// Only the 64-bit target requires a traceback table. For now,
// we only emit the word of zeroes that GDB requires to find
- // the end of the function.
- // FIXME: Eventually we should add the eight-byte mandatory fields
- // described in the PPC64 ELF ABI.
- if (Subtarget.isPPC64())
+ // the end of the function, and zeroes for the eight-byte
+ // mandatory fields.
+ // FIXME: We should fill in the eight-byte mandatory fields as described in
+ // the PPC64 ELF ABI (this is a low-priority item because GDB does not
+ // currently make use of these fields).
+ if (Subtarget.isPPC64()) {
OutStreamer.EmitIntValue(0, 4/*size*/);
+ OutStreamer.EmitIntValue(0, 8/*size*/);
+ }
}
void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) {
OpenPOWER on IntegriCloud