Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp746450rwd; Thu, 15 Jun 2023 01:13:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Py/AI0CcjmAG86+PY4Qb7KRR9vjqBrEvt96Azs9dqDYil24JMsjk8Lx1uSKUzlH/LIj7p X-Received: by 2002:a17:902:d2c8:b0:1b2:43a5:a5e5 with SMTP id n8-20020a170902d2c800b001b243a5a5e5mr17016935plc.34.1686816782555; Thu, 15 Jun 2023 01:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686816782; cv=none; d=google.com; s=arc-20160816; b=yZISGhMECxI6GXing0yV8zP2OHwSNJQeelNjt7QsvdEJdYh8I/1kdK+W46a64acAIp fxC+uu9aiwlzztkKoqh4zhh0NH0cTtQnCGiCwE5QTT8mVFn+RBZPVeXDvjdQIowHS69h Au0Q/UizlIhElea8V5Xnqw+nUaQdGneFuHGCXjveDuPUsofwRDwOVH9utyE6TWsfnRJA Mddq+E9RNpgsMPBnhAh10xoqg4MM7fRo7XhG7YhToYVye1Nw/zOPUIJHSlczz0n03wQ2 2vBIqVJ2THZdaZWuxkgSyy+plvIyPfGNRub0LovVdFvB+8oJsGWTEPGbBKB6EJErkKES igGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=i8q2ev12Hzipi3ZacGQEgJITfJxx4LQWLJ80FtEdwq8=; b=FwkUNWniofBuFVks+/bkQ44Y8wVF/dG8ReABhpIUVen4ddQAvMyN2buA8tk232R3D3 aSv50tjlMsSspvBGvY/IjTIHBa3WEg1kTJGuHWKHZxEUBUHncjdmfNFRlWsj3T9Cw4D4 3YzEGs89mII5XSe+kXwF4vlhs7lYISgRr8thIl8Wg/edjepwght4QK2nDUPe4MQr+N9m 9hyjZeOsXOTBepqz3EMKccnot+D9QYpBq/6LcCTufhheyfrIKtnG4uzExCgcsSErAFep mxjVITNmd0PIwwv8U2yYQgTD1eWmrNC5ro/uqz+j0HDMgnzm2NYbPKKbuc3GcC7bmOwP W//A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ukJZJukQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170902e5c500b001b50186212dsi2733127plf.541.2023.06.15.01.12.50; Thu, 15 Jun 2023 01:13:02 -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=@microchip.com header.s=mchp header.b=ukJZJukQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245025AbjFOHle (ORCPT + 99 others); Thu, 15 Jun 2023 03:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245312AbjFOHkD (ORCPT ); Thu, 15 Jun 2023 03:40:03 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE1112D4B for ; Thu, 15 Jun 2023 00:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1686814778; x=1718350778; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=PyAZ+UQySht1Ggox4vj01CIS3UNR5OIbU5jcrfJvb9c=; b=ukJZJukQgnKMjSsZBmtaCSlvjetmkKNMmNiqRddxEwonJck/zNc3Wfq6 y91GVtFQlYplsMgAuaUW413gcE5JWoNfhyBd3NR1ql9F0LCc7/YibetuW mFL/bjqqXq3og6Iari3qlYTe3IPeAnUZrmppWxiBUupBerJ9vgp1g+DFe 3DUsa5jdLwJTrjo6XYNVa061Iwr/2FzS6NgewG/4mVo707nF1omR7eWNO 59PoNSKQsSkzjEEThCR1MwJVDkIdJdd2qJ26eRxR55WtNJOtY8LlWQhqT R/iiu0ewzITkp5huzNF2tW94S3+yRZ3OlxVEMea4mrreq3k7v2qxkSHD4 Q==; X-IronPort-AV: E=Sophos;i="6.00,244,1681196400"; d="asc'?scan'208";a="220398517" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2023 00:38:30 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 15 Jun 2023 00:38:27 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 15 Jun 2023 00:38:25 -0700 Date: Thu, 15 Jun 2023 08:37:59 +0100 From: Conor Dooley To: Nylon Chen CC: , , , , , , , , , Subject: Re: [PATCH v2] RISC-V: Support 32_PCREL relocation type in kernel module Message-ID: <20230615-unvisited-deceit-9beab8ce987a@wendy> References: <20230615072302.25638-1-nylon.chen@sifive.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X3uZfQHN9blau7pK" Content-Disposition: inline In-Reply-To: <20230615072302.25638-1-nylon.chen@sifive.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --X3uZfQHN9blau7pK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Nylon, thanks for the update. On Thu, Jun 15, 2023 at 03:23:02PM +0800, Nylon Chen wrote: > Fix the 'unsupported relocation type' error caused by > enabling the -fasynchronous-unwind-tables flag, > which generates relocation types that are not supported. What commit adds the -fasynchronous-unwind-tables flag? Should there be a Fixes: tag for that commit? Cheers, Conor. >=20 > Signed-off-by: Nylon Chen > Reviewed-by: Zong Li > --- > Changed in v2: > - add commit message. >=20 > arch/riscv/kernel/module.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c > index 7c651d55fcbd..65be0360a494 100644 > --- a/arch/riscv/kernel/module.c > +++ b/arch/riscv/kernel/module.c > @@ -310,6 +310,15 @@ static int apply_r_riscv_sub64_rela(struct module *m= e, u32 *location, > return 0; > } > =20 > +static int apply_r_riscv_pcrel_32_rela(struct module *me, u32 *location, > + Elf_Addr v) > +{ > + ptrdiff_t offset =3D (void *)v - (void *)location; > + > + *location =3D (*location & 0xffff0000) | (offset & 0xffff); > + return 0; > +} > + > static int (*reloc_handlers_rela[]) (struct module *me, u32 *location, > Elf_Addr v) =3D { > [R_RISCV_32] =3D apply_r_riscv_32_rela, > @@ -335,6 +344,7 @@ static int (*reloc_handlers_rela[]) (struct module *m= e, u32 *location, > [R_RISCV_SUB16] =3D apply_r_riscv_sub16_rela, > [R_RISCV_SUB32] =3D apply_r_riscv_sub32_rela, > [R_RISCV_SUB64] =3D apply_r_riscv_sub64_rela, > + [R_RISCV_32_PCREL] =3D apply_r_riscv_pcrel_32_rela, > }; > =20 > int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, > --=20 > 2.40.1 >=20 --X3uZfQHN9blau7pK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZIq/ywAKCRB4tDGHoIJi 0keJAQDIkc/zpv4sa2yC/D7U/ZNdjXyjn1F4e5TOctnC6ykUpAD+KeZHi+Wx/6e9 ONGjEQkKXwjDw/MTgIei7DiKwsSShAw= =bAj9 -----END PGP SIGNATURE----- --X3uZfQHN9blau7pK--