[llvm-commits] [llvm] r93841 - in /llvm/trunk/lib/Target: PowerPC/PPCTargetMachine.cpp X86/X86TargetMachine.cpp

Bill Wendling isanbard at gmail.com
Mon Jan 18 18:44:01 PST 2010


Author: void
Date: Mon Jan 18 20:44:01 2010
New Revision: 93841

URL: http://llvm.org/viewvc/llvm-project?rev=93841&view=rev
Log:
Even more explanation.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
    llvm/trunk/lib/Target/X86/X86TargetMachine.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=93841&r1=93840&r2=93841&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Jan 18 20:44:01 2010
@@ -201,6 +201,18 @@
 /// to bugs or other conditions. We will default to a 4-byte encoding unless the
 /// system tells us otherwise.
 ///
+/// The issue is when the CIE says their is an LSDA. That mandates that every
+/// FDE have an LSDA slot. But if the function does not need an LSDA. There
+/// needs to be some way to signify there is none. The LSDA is encoded as
+/// pc-rel. But you don't look for some magic value after adding the pc. You
+/// have to look for a zero before adding the pc. The problem is that the size
+/// of the zero to look for depends on the encoding. The unwinder bug in SL is
+/// that it always checks for a pointer-size zero. So on x86_64 it looks for 8
+/// bytes of zero. If you have an LSDA, it works fine since the 8-bytes are
+/// non-zero so it goes ahead and then reads the value based on the encoding.
+/// But if you use sdata4 and there is no LSDA, then the test for zero gives a
+/// false negative and the unwinder thinks there is an LSDA.
+///
 /// FIXME: This call-back isn't good! We should be using the correct encoding
 /// regardless of the system. However, there are some systems which have bugs
 /// that prevent this from occuring.

Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=93841&r1=93840&r2=93841&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Jan 18 20:44:01 2010
@@ -257,6 +257,18 @@
 /// to bugs or other conditions. We will default to a 4-byte encoding unless the
 /// system tells us otherwise.
 ///
+/// The issue is when the CIE says their is an LSDA. That mandates that every
+/// FDE have an LSDA slot. But if the function does not need an LSDA. There
+/// needs to be some way to signify there is none. The LSDA is encoded as
+/// pc-rel. But you don't look for some magic value after adding the pc. You
+/// have to look for a zero before adding the pc. The problem is that the size
+/// of the zero to look for depends on the encoding. The unwinder bug in SL is
+/// that it always checks for a pointer-size zero. So on x86_64 it looks for 8
+/// bytes of zero. If you have an LSDA, it works fine since the 8-bytes are
+/// non-zero so it goes ahead and then reads the value based on the encoding.
+/// But if you use sdata4 and there is no LSDA, then the test for zero gives a
+/// false negative and the unwinder thinks there is an LSDA.
+///
 /// FIXME: This call-back isn't good! We should be using the correct encoding
 /// regardless of the system. However, there are some systems which have bugs
 /// that prevent this from occuring.





More information about the llvm-commits mailing list