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

Jay Foad jay.foad at gmail.com
Sat Nov 15 00:08:34 PST 2014


On 14 November 2014 22:01, Peter Bergner <bergner at vnet.ibm.com> wrote:
> 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?

Not really; just that the sanitizers currently only support 64-bit
PowerPC, and I have no way of testing the 32-bit case.

> 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.

Will do!

Thanks,
Jay.



More information about the llvm-commits mailing list