From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 7A53238362CE for ; Thu, 1 Sep 2022 01:41:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A53238362CE 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=1661996485; bh=oOIHvbo7aX0FUFiyzNoHa+Da7UuYojjc+j8WCPCRazM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PiDCHG35SVWqI9k8UVMr+iBuUUtfE1baiYAotCR78LK+Pj8MOD8xLZO05jTTUm0Ag xa6Te9IP72GbDZjFhydoJ4LVZmZg9yWyUO1DZ3GgV5yuXcVNpQAQOO80anMslZc8Tg MuZdOhH7U0MQmUJR5igIrfFxKx4Pa+xZFgb4nW/U= Received: from [IPv6:240e:358:118a:f800:dc73:854d:832e:4] (unknown [IPv6:240e:358:118a:f800:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 28EBC66915; Wed, 31 Aug 2022 21:41:22 -0400 (EDT) Message-ID: Subject: Re: [PATCH] LoongArch: Use copy relocation for %pc_lo12 against external symbol From: Xi Ruoyao To: liuzhensong , binutils@sourceware.org Cc: WANG Xuerui , chenglulu@loongson.cn Date: Thu, 01 Sep 2022 09:41:17 +0800 In-Reply-To: References: <20220831132259.71417-1-xry111@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,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,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 Thu, 2022-09-01 at 09:27 +0800, liuzhensong wrote: > The R_LARCH_COPY is supported in older versions, we removed this > feature and are not going to support. Hmm, then for extern int x; int f() { return x; } it will produce a GOT access. If x is in another TU but not in a shared library, such a GOT access and the GOT entry is unneeded. This will be really a pain for situations like building an OS kernel, or with -static or -static-pie. Even for this simple example, there is no way to tell "x" is not in a shared library (maybe, expect LTO or linker relaxation, but IIRC LTO or relaxation do not *guarantee* to avoid the GOT, just "try to" avoid the GOT). So is there any serious reason forbidding us from using R_LARCH_COPY? Or any options for this "unneeded GOT" issue? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University