]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Mips: Fix the ASAN shadow offset hook for the n32 ABI
authorDimitrije Milosevic <Dimitrije.Milosevic@Syrmia.com>
Wed, 6 Jul 2022 17:58:20 +0000 (01:58 +0800)
committerXi Ruoyao <xry111@xry111.site>
Thu, 7 Jul 2022 02:20:03 +0000 (10:20 +0800)
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
gcc/config/mips/mips.h

index 5eb845960e1e64d57b3fa5d0cc229a3031aae364..e81a245dcf46e903eb9d254f20237d92e31eed9a 100644 (file)
@@ -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
index 858bbba3a369a9cc5a65cbac345c83b56c75455c..0029864fdcdf0b68a5467dcad9bdb991aae40fe1 100644 (file)
@@ -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