public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dimitrije Milosevic <Dimitrije.Milosevic@Syrmia.com>
To: Xi Ruoyao <xry111@xry111.site>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Djordje Todorovic <Djordje.Todorovic@syrmia.com>
Subject: Re: [PATCH] Mips: Fix the ASAN shadow offset hook for the n32 ABI
Date: Tue, 7 Jun 2022 10:12:29 +0000	[thread overview]
Message-ID: <AM0PR03MB488289C0F67FA18CAD5FCD6A82A59@AM0PR03MB4882.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <5e2a5b29aaa1243b30946af478852cda50fb226b.camel@xry111.site>

Correct, it should be committed very soon.
________________________________
From: Xi Ruoyao <xry111@xry111.site>
Sent: Tuesday, June 7, 2022 10:17 AM
To: Dimitrije Milosevic <Dimitrije.Milosevic@Syrmia.com>; gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>
Cc: Djordje Todorovic <Djordje.Todorovic@syrmia.com>
Subject: Re: [PATCH] Mips: Fix the ASAN shadow offset hook for the n32 ABI

On Mon, 2022-06-06 at 09:28 +0000, Dimitrije Milosevic wrote:
> Fix the ASAN shadow offset hook for the n32 ABI.
>
> gcc/ChangeLog:
>
>         * config/mips/mips.cc (mips_asan_shadow_offset): Reformat
>         to handle the N32 ABI.
>         * config/mips/mips.h (SUBTARGET_SHADOW_OFFSET): Remove
>         the macro, as it is not needed anymore.
>
> ---
>
>  gcc/config/mips/mips.cc | 7 ++++++-
>  gcc/config/mips/mips.h  | 7 -------
>  2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
> index 2dce4007678..91e651c458e 100644
> --- a/gcc/config/mips/mips.cc
> +++ b/gcc/config/mips/mips.cc
> @@ -22745,7 +22745,12 @@ mips_constant_alignment (const_tree exp,
> HOST_WIDE_INT align)
>  static unsigned HOST_WIDE_INT
>  mips_asan_shadow_offset (void)
>  {
> -  return SUBTARGET_SHADOW_OFFSET;
> +  if (mips_abi == ABI_N32)
> +    return (HOST_WIDE_INT_1 << 29);
> +  if (POINTER_SIZE == 64)
> +    return (HOST_WIDE_INT_1 << 37);
> +  else
> +    return HOST_WIDE_INT_C (0x0aaa0000);
>  }
>
>  /* Implement TARGET_STARTING_FRAME_OFFSET.  See
> mips_compute_frame_info
> diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
> index 858bbba3a36..0029864fdcd 100644
> --- a/gcc/config/mips/mips.h
> +++ b/gcc/config/mips/mips.h
> @@ -3463,10 +3463,3 @@ struct GTY(())  machine_function {
>     && !TARGET_MICROMIPS && !TARGET_FIX_24K)
>
>  #define NEED_INDICATE_EXEC_STACK 0
> -
> -/* Define the shadow offset for asan. Other OS's can override in the
> -   respective tm.h files.  */
> -#ifndef SUBTARGET_SHADOW_OFFSET
> -#define SUBTARGET_SHADOW_OFFSET \
> -  (POINTER_SIZE == 64 ? HOST_WIDE_INT_1 << 37 : HOST_WIDE_INT_C
> (0x0aaa0000))
> -#endif
>
> ---

I think this depends on https://reviews.llvm.org/D127096 (not committed
yet)?

--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2022-06-07 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06  9:28 Dimitrije Milosevic
2022-06-07  8:17 ` Xi Ruoyao
2022-06-07 10:12   ` Dimitrije Milosevic [this message]
2022-07-30 13:22 ` Maciej W. Rozycki
2022-08-03  1:17   ` Xi Ruoyao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR03MB488289C0F67FA18CAD5FCD6A82A59@AM0PR03MB4882.eurprd03.prod.outlook.com \
    --to=dimitrije.milosevic@syrmia.com \
    --cc=Djordje.Todorovic@syrmia.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).