[PATCH] [ASan] Improved stack overflow detection for PowerPC64

Peter Bergner bergner at vnet.ibm.com
Fri Nov 14 14:01:44 PST 2014


On Fri, 2014-11-14 at 15:29 +0000, Jay Foad wrote:
+#if __powerpc64__
+  // Large stack frames can be allocated with e.g.
+  //   lis r0,-10000
+  //   stdux r1,r1,r0 # store sp to [sp-10000] and update sp by -10000
+  // If the store faults then sp will not have been updated, so test above
+  // will not work, becase the fault address will be more than just "slightly"
+  // below sp.
[snip]

Is there a reason you are limiting this to 64-bit compiles and not
allowing this for 32-bit compiles?  If not, then you should probably
be using:

  #if defined (__powerpc__)

since 32-bit, 64-bit ELFv1 (ie, BE) and ELFv2 (ie, LE) compiles
define that macro.

Peter






More information about the llvm-commits mailing list