public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/xry111/heads/mips-n32-asan)] Mips: Fix the ASAN shadow offset hook for the n32 ABI
@ 2022-07-06 18:00 Xi Ruoyao
0 siblings, 0 replies; only message in thread
From: Xi Ruoyao @ 2022-07-06 18:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ad6e4e9af4bb22400b46fb9a886299c0f3a9c5fb
commit ad6e4e9af4bb22400b46fb9a886299c0f3a9c5fb
Author: Dimitrije Milosevic <Dimitrije.Milosevic@Syrmia.com>
Date: Thu Jul 7 01:58:20 2022 +0800
Mips: 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.
Diff:
---
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 5eb845960e1..e81a245dcf4 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -22743,7 +22743,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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-06 18:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 18:00 [gcc(refs/users/xry111/heads/mips-n32-asan)] Mips: Fix the ASAN shadow offset hook for the n32 ABI Xi Ruoyao
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).