This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sparc ASAN


From: Konstantin Serebryany <konstantin.s.serebryany@gmail.com>
Date: Mon, 3 Dec 2012 22:33:12 +0400

> On Mon, Dec 3, 2012 at 10:29 PM, David Miller <davem@davemloft.net> wrote:
>> We could also add a __sparc__ block to sanitizer_stacktrace.cc:patch_pc().
>> The Sparc PC is actually 8 bytes after the caller's jump.  Sparc has
>> a delay slot, the place to return to is 2 instructions after the call/jump,
>> and instructions are all 4 bytes long.
> 
> Like this?
> 
> --- sanitizer_common/sanitizer_stacktrace.cc    (revision 169136)
> +++ sanitizer_common/sanitizer_stacktrace.cc    (working copy)
> @@ -36,6 +36,8 @@
>  #if defined(__powerpc__) || defined(__powerpc64__)
>    // PCs are always 4 byte aligned.
>    return pc - 4;
> +#elif defined(__sparc__)
> +  return pc - 8;
>  #else
>    return pc - 1;
>  #endif
> 

Perfect.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]