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 C1350385AC22 for ; Tue, 9 Aug 2022 14:04:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C1350385AC22 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 E40E965F24; Tue, 9 Aug 2022 10:04:50 -0400 (EDT) Message-ID: Subject: Re: =?gb2312?Q?=BB=D8=B8=B4=A3=BA=5BPATCH?= v5] LoongArch: add movable attribute From: Xi Ruoyao To: Lulu Cheng , "gcc-patches@gcc.gnu.org" Cc: WANG Xuerui , Youling Tang , Chenghua Xu , Huacai Chen , Jinyang He Date: Tue, 09 Aug 2022 22:04:48 +0800 In-Reply-To: References: <90d2f698eaa2ef88712e9aef453b1deff197b533.camel@xry111.site> <44a2cb6f-b8b2-babb-bfcc-3dd17d8fce42@loongson.cn> <60bac545a09ee202d41421a596ac64a4cb83d89c.camel@xry111.site> <3aebe438b53e84eab24824f6cc79ae655cfb0f72.camel@xry111.site> <4789106a3b8ca37bd0f810b818eb14cae5fc9cac.camel@xry111.site> <76ddfa4a-6c7c-8c67-c6cd-4d6ae0bc87a5@xen0n.name> <069670e7-faf3-ecd4-be4f-3b0f8debb508@loongson.cn> <7c1d15a6-4e29-99b5-4b66-41af2fece9a6@loongson.cn> <6393bd75250c1cb46377b7eee4afd7db4bda7e25.camel@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=3.7 required=5.0 tests=BAYES_00, BODY_8BITS, CHARSET_FARAWAY_HEADER, 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-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: Tue, 09 Aug 2022 14:04:56 -0000 On Tue, 2022-08-09 at 21:03 +0800, Lulu Cheng wrote: >=20 > =E5=9C=A8 2022/8/9 =E4=B8=8B=E5=8D=887:30, Xi Ruoyao =E5=86=99=E9=81=93: > =C2=A0 >=20 >=20 >=20 > > Sorry for late reply, I'm rebuilding my entire Linux system (from > > scratch) for Glibc-2.36 and Binutils-2.39 update and I just reached the > > mail client. > >=20 > > On Mon, 2022-08-08 at 12:53 +0800, Lulu Cheng wrote: > > =C2=A0 > >=20 > >=20 > >=20 > > > I still think it makes a little bit more sense to put attribute(model= ) > > > and -mcmodel together. > > >=20 > > > -mcmodel sets the access range of all symbols in a single fileand=20 > > > attribute (model) sets the > > >=20 > > > accsess range of a single symbol in a file. For example=20 > > > __attribute__((model(normal/large/extreme))). > > It might make sense, but then it would not be what we want for per-CPU > > symbols. What we want here is "treat a local symbol as-if it's global"= , > > while each code model may already treat local symbol and global symbol > > differently. > >=20 > > Disambiguation: here "local" means "defined in this TU", "global" > > otherwise (not "local variable" in C). > >=20 > > I'll send v6 with the name "addr_global" if no objection. > >=20 > I am implementing the mode of cmodel=3Dextreme. > In this mode, the value of the relative offset is a signed 64-bit value, > so this can solve the access problem of the variables of the kernel precp= u. > So I wonder if it is necessary to add another attribute like addr_global? If we use GOT I can implement only PC_HI20 and PC_LO12 relocs in kernel module loader. If we use extreme I'll need to implement 4 ABS relocations along with them. But "the less the better" is not a very strong reason anyway. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University