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 58B973858D32 for ; Sun, 4 Sep 2022 13:29:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 58B973858D32 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1662298182; bh=QrHvcuBLhf4DQD5gmrh8vpupm1v1aYWJvpaHfTVtHII=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YKzHJzaHJqJ4d7hSYtNfPoswB3fju8C9cOdzWvk5al8/pIMfLgneO7D6CG+RTl+Vs 92r5QXyZMiYWq9HgsENaOGQk4+xzFYnvotxMniRcQNmFymXNDLQsi28HdPdWghZAD0 iT9Kr1TPmM/bMnqPoQpmBhgfw2K0YAjL6j2E2H4s= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (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 C45C566982; Sun, 4 Sep 2022 09:29:40 -0400 (EDT) Message-ID: <85f5b71117deb7a8d83931d79466357d29b749cf.camel@xry111.site> Subject: Re: [PATCH] LoongArch: add -mdirect-extern-access option From: Xi Ruoyao To: Lulu Cheng Cc: gcc-patches@gcc.gnu.org, liuzhensong , Chenghua Xu , Huacai Chen , Wang Xuerui , Fangrui Song Date: Sun, 04 Sep 2022 21:29:38 +0800 In-Reply-To: References: <20220901105412.42242-1-xry111@xry111.site> <11ab925378eb7f4ee3a0e8a6a81be45c64aebe00.camel@xry111.site> <496bac6b-95b0-00ec-a212-0142104950c4@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.3 MIME-Version: 1.0 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD,KAM_SHORT,LIKELY_SPAM_FROM,PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, 2022-09-04 at 00:38 -0700, Fangrui Song wrote: > On Sun, Sep 4, 2022 at 12:00 AM Lulu Cheng > wrote: > > I have thought about this problem. For example, there is no '%plt' > > in > > aarch64, but I think it can be added and easily distinguished at the > > assembly code level, > >=20 > > so this is not removed. >=20 > I think @plt should be removed unconditionally. It was a mistake in > some ABI (e.g. i386, riscv). I've sent v2 (https://gcc.gnu.org/pipermail/gcc-patches/2022-September/600955.html), with TARGET_DIRECT_EXTERN_ACCESS check in loongarch_symbol_binds_local_p so we don't need to duplicate the check 3 times. Regarding "%plt", I still suggest to remove it globally. It's not so easy to be distinguished in the compile time, as only the linker will know if the PLT should be used (unless, if -fPIC -fplt and calling a default-visible function then we know PLT must be used). An explicit "%plt" sometimes misleads newbies to think %plt would force the linker to emit a PLT entry but it's not true. You can discuss this with Zhensong internally in the following week, I think. But let's defer the "controversial" thing and eliminate the GOT in upcoming Linux-6.1 first... --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University