From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from xry111.site (xry111.site [89.208.246.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED7D24C77 for ; Fri, 29 Jul 2022 17:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1659117333; bh=4pZFEPPW1rCD+FxOWH5IvuT+sX+ksBOFETw6F8Vgj8U=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PRF5VNP27p6ja7lRqq7yVkXXSkaMOp+kkK03ZIOakIIior+DFJ3SIN8qilDlw4Ijy zmjfgYulz7PRICqylcVscRR7DuMzBUK2arHVt9ku1SPnki18CWp/DufnfFPrJbSHjS K3TkLuZ4TTxxnUzFvVD08daYPjn0Za5g5YRjwT30= 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 6638D66898; Fri, 29 Jul 2022 13:55:31 -0400 (EDT) Message-ID: <7cad6e78014168a8906e130e1cf3809077d2bda7.camel@xry111.site> Subject: Re: [PATCH v4 0/4] LoongArch: Support new relocation types From: Xi Ruoyao To: Youling Tang , loongarch@lists.linux.dev Cc: linux-kernel@vger.kernel.org, WANG Xuerui , Huacai Chen , Jinyang He , Lulu Cheng Date: Sat, 30 Jul 2022 01:55:29 +0800 In-Reply-To: References: <32a74a218c76611f897fd1df1ad0059068621133.camel@xry111.site> <0179679b736aea7258981dec2d83107cce74dfc1.camel@xry111.site> <6b5d2188f93ed72b67a4bbb7116113f833fe1ee5.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2022-07-29 at 20:19 +0800, Youling Tang wrote: > On 07/29/2022 07:45 PM, Xi Ruoyao wrote: > > Hmm... The problem is the "addresses" of per-cpu symbols are faked: the= y > > are actually offsets from $r21.=C2=A0 So we can't just load such an off= set > > with PCALA addressing. > >=20 > > It looks like we'll need to introduce an attribute for GCC to make an > > variable "must be addressed via GOT", and add the attribute into > > PER_CPU_ATTRIBUTES. > Yes, we need a GCC attribute to specify the per-cpu variable. GCC patch adding "addr_global" attribute for LoongArch: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/599064.html An experiment to use it: https://github.com/xry111/linux/commit/c1d5d70 This fixes "modprobe x_tables" for me. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University