Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp854694rwb; Sat, 3 Sep 2022 04:14:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7dfQU2iVc5Bnc9mBfncT+bBIVSO/MIegL4T05vv5amcXPTjbxnIsIaf7S6LNeh9u1CVD1x X-Received: by 2002:a62:4ec8:0:b0:538:3dea:2518 with SMTP id c191-20020a624ec8000000b005383dea2518mr29038960pfb.39.1662203685026; Sat, 03 Sep 2022 04:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662203685; cv=none; d=google.com; s=arc-20160816; b=N2FSWeHvUrI+TDs5WIoE9BbJApocGh5dCSl8sVILSlmFSgrK6M4n4AwdWVSG3hk03o EOLl7bgedAXGbY6yyz/ecxN2NqM7/CbBkpJebGA+TRGBGHgmgT3dWhSVd0vMXoCv21Z2 GBT7H9QJGnKi/CM7//1fTvqcOhhHqIFSDmBv/ZoxweWQDZGF6ClnYsMIjau55//zzRYQ hdamdwfsCl/3z9qG5KLzVdH4oOovE5Iq0ZBRScn0rE3q9hpyeuYUTcSDoqdL8NWsK/AP byV/wsDblYEOC0agWcvEQc5E19CFkbV4lb55+1zjkO2g/C0Lx09SHMHFa1Y12pfjEE5S /qNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=oKhATyKUrbW9ShEBqyKZkbeJOnR0wK/egdrvKFwOI+U=; b=NB6QIZ9jFh8scIgLdKmP1svo2vxXLuwhwIc2E3hjhbuWwn822vfcD1vh0YWS79Lvxe 9v7eBcVNdjesGM83vfv9b9EL0l1JsDKDmZEcenD9NT883sxTkACOI7ujhtMyp99lxQ6B CHhx9euuAsoxuG5fEcW5iEEpLyh5V4UCtPFsaFNRyr0wWrEtwhdd4xpmGBTAQa76UHzH Y5LBdhQZCIsqLd8oErGXsDdLlQ0OhHYhLLO/hZzQZlCZECrQyfkJRdd9wfLnMdUOMAF8 57ZrrB8tPCh7XrrtGMEZnOPxYiIOekK9jR949BpDr2Hmebn3qAq7EOVzhaHKutI7xevj fM7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=g5DNxviT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a056a000a1300b0052bceb2fe4esi4946760pfh.221.2022.09.03.04.14.10; Sat, 03 Sep 2022 04:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=g5DNxviT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbiICKtc (ORCPT + 99 others); Sat, 3 Sep 2022 06:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbiICKta (ORCPT ); Sat, 3 Sep 2022 06:49:30 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC34E6B for ; Sat, 3 Sep 2022 03:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1662202165; bh=8I2CCom6GzLdMkmqYuc6ZCbm5jRcJA32i6ToxSl5Zkg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=g5DNxviT7XZuksCX+3hFQNGEDISb+9Nr+bXh2GWC+RI87IcV6c0kwnpV3xVnVeUcn K7NAxY9hGbkY/LEcEA+xeTma50VvqksF7tWiwIbnhm5KJge35asDjQMenIjmdoXVNt dywTOcPpJCZd6uf8GaBMTRUJQk2fdcfkwwVL5Pog= Received: from [IPv6:240e:358:1104:1500:dc73:854d:832e:4] (unknown [IPv6:240e:358:1104:1500: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 10E1065907; Sat, 3 Sep 2022 06:49:20 -0400 (EDT) Message-ID: <78a4a6b0970c309daa336a2329e69d28df486552.camel@xry111.site> Subject: Re: [PATCH 1/3] LoongArch: tools: Add relocs tool support From: Xi Ruoyao To: Youling Tang , Huacai Chen Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Xuerui Wang , Jiaxun Yang , Jinyang He Date: Sat, 03 Sep 2022 18:49:14 +0800 In-Reply-To: References: <1662113335-14282-1-git-send-email-tangyouling@loongson.cn> <1662113335-14282-2-git-send-email-tangyouling@loongson.cn> <4df8a26c49a35c1fce36d80c370f738fa71a2bef.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=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2022-09-03 at 09:57 +0800, Youling Tang wrote: > > > Unlike (pre-r6) MIPS, LoongArch has a complete support for PIC, and > > > currently LoongArch toolchain always produces PIC (except, if -Wa,-ml= a- > > > {local,global}-with-abs or la.abs macros are used explicitly). > > >=20 > > > So would it be easier to review and correct the uses of "la.abs" in t= he > > > code, and make the main kernel image a real PIE?=C2=A0 Then we can lo= ad it > > > everywhere w/o any need to do relocation at load time. >=20 > At the beginning I also wanted to make the main kernel image a real PIE > and tried it, some of the "la.abs" can be modified, but I encountered > difficulties in modifying the=C2=A0 exception handling code part, the ker= nel > will not=C2=A0 boot after modification :(, I will continue to work hard t= ry. I just tried the same thing and get the same result :(. Will spend several hours reading the LoongArch manual about exception... --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University