From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 1E84D3858405 for ; Wed, 3 Aug 2022 01:17:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E84D3858405 Received: from [192.168.0.105] (unknown [183.200.25.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 68C0166986; Tue, 2 Aug 2022 21:17:23 -0400 (EDT) Message-ID: <7a042cad563f7e302c79db07068c1a2949a4e5c1.camel@xry111.site> Subject: Re: [PATCH] Mips: Fix the ASAN shadow offset hook for the n32 ABI From: Xi Ruoyao To: "Maciej W. Rozycki" , Dimitrije Milosevic Cc: Djordje Todorovic , "gcc-patches@gcc.gnu.org" Date: Wed, 03 Aug 2022 09:17:16 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 MIME-Version: 1.0 X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2022 01:17:28 -0000 On Sat, 2022-07-30 at 14:22 +0100, Maciej W. Rozycki wrote: > On Mon, 6 Jun 2022, Dimitrije Milosevic wrote: >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * config/mips/mips.cc (mips_= asan_shadow_offset): Reformat > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 to handle the N32 ABI. >=20 > =C2=A0That's not what the change does. >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * config/mips/mips.h (SUBTAR= GET_SHADOW_OFFSET): Remove > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the macro, as it is not need= ed anymore. >=20 > =C2=A0Why is the macro not needed anymore? Because it's only used by mips_asan_shadow_offset and now we directly code its content into mips_asan_shadow_offset. SUBTARGET_SHADOW_OFFSET is only needed if a different subtarget (say, mips64el-freebsd) needs a different shadow offset. But for MIPS we don't have any subtarget other than mips*-linux-gnu* supporting ASAN so we can omit SUBTARGET_SHADOW_OFFSET and fold the content directly into the asan_shadow_offset target hook. RISCV port does the same. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University