On Tue, Dec 02, 2014 at 09:56:36PM +0400, Dmitry Vyukov wrote:
> --- gcc/ChangeLog (revision 218280)
> +++ gcc/ChangeLog (working copy)
> @@ -1,3 +1,8 @@
> +2014-12-02  Dmitry Vyukov  <dvyu...@google.com>
> +
> + * asan.c: (asan_finish_file): Use default priority for constructors
> + in kernel mode.

Seems your MUA is eating tabs, I'll assume they are where I'd expect them to
be.

> @@ -2440,6 +2442,7 @@
>  {
>    varpool_node *vnode;
>    unsigned HOST_WIDE_INT gcount = 0;
> +  int priority;
> 
>    if (shadow_ptr_types[0] == NULL_TREE)
>      asan_init_shadow_ptr_types ();

No need to declare this separately, 

> @@ -2448,6 +2451,13 @@
>       nor after .LASAN* array.  */
>    flag_sanitize &= ~SANITIZE_ADDRESS;
> 
> +  /* For user-space we want asan constructors to run first.
> +     Linux kernel does not support priorities other than default, and the 
> only
> +     other user of constructors is coverage. So we run with the default
> +     priority.  */
> +  priority = flag_sanitize & SANITIZE_USER_ADDRESS ?
> +      MAX_RESERVED_INIT_PRIORITY - 1 : DEFAULT_INIT_PRIORITY;

formatting plus declare it here too.  This should be
  int priority = flag_sanitize & SANITIZE_USER_ADDRESS
                 ? MAX_RESERVED_INIT_PRIORITY - 1 : DEFAULT_INIT_PRIORITY;
(? should be on the second line and aligned below flag_sanitize).

Ok for trunk with that change.

Shall we backport it to 4.9 branch too?

        Jakub

Reply via email to