Message ID | 20230712015747.77263-1-wangkefeng.wang@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp871303vqm; Tue, 11 Jul 2023 19:42:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhx/9qIMPHXo8pFvnJUmZQimXfNLVr0b0LXxmWctA3R2EWmcN4+KNxrZIwnqmTl7lEKcck X-Received: by 2002:a17:906:224a:b0:977:d660:c5aa with SMTP id 10-20020a170906224a00b00977d660c5aamr915481ejr.31.1689129761484; Tue, 11 Jul 2023 19:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689129761; cv=none; d=google.com; s=arc-20160816; b=SrJk65PVXMWa7wmXdxi4HUYb/pl1W+KJOyAsECT7ffCi11TQ82gVhbGbNKvcFu0DVv b9x7Inf7pNeST31ws/i0YLXLpMHTw1B3wOMvDuEQj8V/feWoTfGcuYUrnRzBVjfu/1m9 uzwNd89Wsiu2TzOO6nj5sqg6CxDZSAHOVAPpJ872+8P3fYKAXdFCLgGsF5Jpm1WggEp9 fI4FHvmGeG5DM0CXZOBdd0y2xGKBI2DO78vxcxTRCu+3lZd5WRJNw6CU54LwU7tNuLUf qzhe5uXOIUYxA9xCts9D7MxZWh2C1+M1aHW2Y/bcPcMwk6+pyV+UJduJr74zenKhbXzP GDRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ox5EMXepqWa6WGU88zHM5BVeH6HeysTJAKLj3WklMiQ=; fh=m3s8vxWP4dgNFSWKQWR0ITfJ2DNQ2GhRrt8NdTgaa28=; b=Jx/b/bbBp4EoeNZMLcvnxql6UOJSY4i6oUF2JrTZ/rzTJMPYCHCiQOo2MUA2dtvSaU 1aCLTl/LfsQc5rzf4Xbif/V30WO1hVPf85EFIm+qc054b8tkMGMjiv+NBiIFfIEuODL3 jfwHpm1g5qGoaMO0kz8JRFTeXtkttTrT5umlS76si/hRS6NY/4V83vojds8n2KVKmhvx acGmaKMhEbFKtGzN5wT9ZX6G2/CvlCqdCyfHvGiTOtTjY0yBcfpcvB2Mc4PoJ3s7xtbw ot0pUXSB6//+o3/mnSkgZCXYV7zblcxLYBZwxnYK+ug1tmRM04rZWp5+a+tJkFgYhuSF CVqg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ox10-20020a170907100a00b00993a37985dfsi3514763ejb.179.2023.07.11.19.42.18; Tue, 11 Jul 2023 19:42:41 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231238AbjGLBoN (ORCPT <rfc822;gnulinuxfreebsd@gmail.com> + 99 others); Tue, 11 Jul 2023 21:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjGLBoL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 11 Jul 2023 21:44:11 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 570B01712; Tue, 11 Jul 2023 18:44:10 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R10rP6Hspz1JC9d; Wed, 12 Jul 2023 09:43:33 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 12 Jul 2023 09:44:07 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, <linux-kbuild@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: Palmer Dabbelt <palmer@rivosinc.com>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH -next] modpost: move some defines to the file head Date: Wed, 12 Jul 2023 09:57:47 +0800 Message-ID: <20230712015747.77263-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771180928965732380 X-GMAIL-MSGID: 1771180928965732380 |
Series |
[-next] modpost: move some defines to the file head
|
|
Commit Message
Kefeng Wang
July 12, 2023, 1:57 a.m. UTC
with "module: Ignore RISC-V mapping symbols too", build error occurs,
scripts/mod/modpost.c: In function ‘is_valid_name’:
scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function)
return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV);
Fix it by moving the EM_RISCV to the file head, also some other
defines in case of similar problem in the future.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
scripts/mod/modpost.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
Comments
+To: Luis Chamberlain, the commiter of the breakage On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote: > > with "module: Ignore RISC-V mapping symbols too", build error occurs, > > scripts/mod/modpost.c: In function ‘is_valid_name’: > scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function) > return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); > > Fix it by moving the EM_RISCV to the file head, also some other > defines in case of similar problem in the future. BTW, why is the flag 'is_riscv' needed? All symbols starting with '$' look special to me. Why not like this? if (str[0] == '$') return true; return false; > > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> > --- > scripts/mod/modpost.c | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 7c71429d6502..885cca272eb8 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -60,6 +60,22 @@ static unsigned int nr_unresolved; > > #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) > > +#ifndef EM_RISCV > +#define EM_RISCV 243 > +#endif > + > +#ifndef R_RISCV_SUB32 > +#define R_RISCV_SUB32 39 > +#endif > + > +#ifndef EM_LOONGARCH > +#define EM_LOONGARCH 258 > +#endif > + > +#ifndef R_LARCH_SUB32 > +#define R_LARCH_SUB32 55 > +#endif > + > void __attribute__((format(printf, 2, 3))) > modpost_log(enum loglevel loglevel, const char *fmt, ...) > { > @@ -1428,22 +1444,6 @@ static int addend_mips_rel(uint32_t *location, Elf_Rela *r) > return 0; > } > > -#ifndef EM_RISCV > -#define EM_RISCV 243 > -#endif > - > -#ifndef R_RISCV_SUB32 > -#define R_RISCV_SUB32 39 > -#endif > - > -#ifndef EM_LOONGARCH > -#define EM_LOONGARCH 258 > -#endif > - > -#ifndef R_LARCH_SUB32 > -#define R_LARCH_SUB32 55 > -#endif > - > static void section_rela(struct module *mod, struct elf_info *elf, > Elf_Shdr *sechdr) > { > -- > 2.41.0 > -- Best Regards Masahiro Yamada
On Wed, 12 Jul 2023 08:55:23 PDT (-0700), masahiroy@kernel.org wrote: > +To: Luis Chamberlain, the commiter of the breakage > > > > On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote: >> >> with "module: Ignore RISC-V mapping symbols too", build error occurs, >> >> scripts/mod/modpost.c: In function ‘is_valid_name’: >> scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function) >> return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); >> >> Fix it by moving the EM_RISCV to the file head, also some other >> defines in case of similar problem in the future. > > > > BTW, why is the flag 'is_riscv' needed? > > > All symbols starting with '$' look special to me. > > > > Why not like this? > > > if (str[0] == '$') > return true; > > return false; There's a bit of commentary in the v1 <https://lore.kernel.org/all/20230707054007.32591-1-palmer@rivosinc.com/>, but essentially it's not necessary. I just wanted to play things safe and avoid changing the mapping symbol detection elsewhere in order to deal with RISC-V. IIRC we decided $ was special in RISC-V because there were some other ports that behaved that way, but it wasn't universal. If folks are OK treating $-prefixed symbols as special everywhere that's fine with me, I just wasn't sure what the right answer was. There's also some similar arch-specific-ness with the labels and such in here. >> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> >> --- >> scripts/mod/modpost.c | 32 ++++++++++++++++---------------- >> 1 file changed, 16 insertions(+), 16 deletions(-) >> >> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c >> index 7c71429d6502..885cca272eb8 100644 >> --- a/scripts/mod/modpost.c >> +++ b/scripts/mod/modpost.c >> @@ -60,6 +60,22 @@ static unsigned int nr_unresolved; >> >> #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) >> >> +#ifndef EM_RISCV >> +#define EM_RISCV 243 >> +#endif >> + >> +#ifndef R_RISCV_SUB32 >> +#define R_RISCV_SUB32 39 >> +#endif >> + >> +#ifndef EM_LOONGARCH >> +#define EM_LOONGARCH 258 >> +#endif >> + >> +#ifndef R_LARCH_SUB32 >> +#define R_LARCH_SUB32 55 >> +#endif >> + >> void __attribute__((format(printf, 2, 3))) >> modpost_log(enum loglevel loglevel, const char *fmt, ...) >> { >> @@ -1428,22 +1444,6 @@ static int addend_mips_rel(uint32_t *location, Elf_Rela *r) >> return 0; >> } >> >> -#ifndef EM_RISCV >> -#define EM_RISCV 243 >> -#endif >> - >> -#ifndef R_RISCV_SUB32 >> -#define R_RISCV_SUB32 39 >> -#endif >> - >> -#ifndef EM_LOONGARCH >> -#define EM_LOONGARCH 258 >> -#endif >> - >> -#ifndef R_LARCH_SUB32 >> -#define R_LARCH_SUB32 55 >> -#endif >> - >> static void section_rela(struct module *mod, struct elf_info *elf, >> Elf_Shdr *sechdr) >> { >> -- >> 2.41.0 >>
Hi, kindly ping, the build issue still exist in Linux-next. On 2023/7/13 0:28, Palmer Dabbelt wrote: > On Wed, 12 Jul 2023 08:55:23 PDT (-0700), masahiroy@kernel.org wrote: >> +To: Luis Chamberlain, the commiter of the breakage >> >> >> >> On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang >> <wangkefeng.wang@huawei.com> wrote: >>> >>> with "module: Ignore RISC-V mapping symbols too", build error occurs, >>> >>> scripts/mod/modpost.c: In function ‘is_valid_name’: >>> scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first >>> use in this function) >>> return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); >>> >>> Fix it by moving the EM_RISCV to the file head, also some other >>> defines in case of similar problem in the future. >> >> >> >> BTW, why is the flag 'is_riscv' needed? >> >> >> All symbols starting with '$' look special to me. >> >> >> >> Why not like this? >> >> >> if (str[0] == '$') >> return true; >> >> return false; > > There's a bit of commentary in the v1 > <https://lore.kernel.org/all/20230707054007.32591-1-palmer@rivosinc.com/>, but essentially it's not necessary. I just wanted to play things safe and avoid changing the mapping symbol detection elsewhere in order to deal with RISC-V. > > IIRC we decided $ was special in RISC-V because there were some other > ports that behaved that way, but it wasn't universal. If folks are OK > treating $-prefixed symbols as special everywhere that's fine with me, I > just wasn't sure what the right answer was. > There's also some similar arch-specific-ness with the labels and such in > here. > >>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> >>> --- >>> scripts/mod/modpost.c | 32 ++++++++++++++++---------------- >>> 1 file changed, 16 insertions(+), 16 deletions(-) >>> >>> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c >>> index 7c71429d6502..885cca272eb8 100644 >>> --- a/scripts/mod/modpost.c >>> +++ b/scripts/mod/modpost.c >>> @@ -60,6 +60,22 @@ static unsigned int nr_unresolved; >>> >>> #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) >>> >>> +#ifndef EM_RISCV >>> +#define EM_RISCV 243 >>> +#endif >>> + >>> +#ifndef R_RISCV_SUB32 >>> +#define R_RISCV_SUB32 39 >>> +#endif >>> + >>> +#ifndef EM_LOONGARCH >>> +#define EM_LOONGARCH 258 >>> +#endif >>> + >>> +#ifndef R_LARCH_SUB32 >>> +#define R_LARCH_SUB32 55 >>> +#endif >>> + >>> void __attribute__((format(printf, 2, 3))) >>> modpost_log(enum loglevel loglevel, const char *fmt, ...) >>> { >>> @@ -1428,22 +1444,6 @@ static int addend_mips_rel(uint32_t *location, >>> Elf_Rela *r) >>> return 0; >>> } >>> >>> -#ifndef EM_RISCV >>> -#define EM_RISCV 243 >>> -#endif >>> - >>> -#ifndef R_RISCV_SUB32 >>> -#define R_RISCV_SUB32 39 >>> -#endif >>> - >>> -#ifndef EM_LOONGARCH >>> -#define EM_LOONGARCH 258 >>> -#endif >>> - >>> -#ifndef R_LARCH_SUB32 >>> -#define R_LARCH_SUB32 55 >>> -#endif >>> - >>> static void section_rela(struct module *mod, struct elf_info *elf, >>> Elf_Shdr *sechdr) >>> { >>> -- >>> 2.41.0 >>>
On Thu, Jul 13, 2023 at 1:28 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > On Wed, 12 Jul 2023 08:55:23 PDT (-0700), masahiroy@kernel.org wrote: > > +To: Luis Chamberlain, the commiter of the breakage > > > > > > > > On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote: > >> > >> with "module: Ignore RISC-V mapping symbols too", build error occurs, > >> > >> scripts/mod/modpost.c: In function ‘is_valid_name’: > >> scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function) > >> return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); > >> > >> Fix it by moving the EM_RISCV to the file head, also some other > >> defines in case of similar problem in the future. > > > > > > > > BTW, why is the flag 'is_riscv' needed? > > > > > > All symbols starting with '$' look special to me. > > > > > > > > Why not like this? > > > > > > if (str[0] == '$') > > return true; > > > > return false; > > There's a bit of commentary in the v1 > <https://lore.kernel.org/all/20230707054007.32591-1-palmer@rivosinc.com/>, > but essentially it's not necessary. I just wanted to play things safe > and avoid changing the mapping symbol detection elsewhere in order to > deal with RISC-V. > > IIRC we decided $ was special in RISC-V because there were some other > ports that behaved that way, but it wasn't universal. If folks are OK > treating $-prefixed symbols as special everywhere that's fine with me, I > just wasn't sure what the right answer was. > > There's also some similar arch-specific-ness with the labels and such in > here. Hi Palmer, I am not a toolchain expert, but my gut feeling is that the code was safer than needed. I'd like to remove the 'is_riscv' switch rather than applying this patch. Will you send a patch, or do you want me to do so? -- Best Regards Masahiro Yamada
On Fri, 21 Jul 2023 04:58:20 PDT (-0700), masahiroy@kernel.org wrote: > On Thu, Jul 13, 2023 at 1:28 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: >> >> On Wed, 12 Jul 2023 08:55:23 PDT (-0700), masahiroy@kernel.org wrote: >> > +To: Luis Chamberlain, the commiter of the breakage >> > >> > >> > >> > On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote: >> >> >> >> with "module: Ignore RISC-V mapping symbols too", build error occurs, >> >> >> >> scripts/mod/modpost.c: In function ‘is_valid_name’: >> >> scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function) >> >> return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); >> >> >> >> Fix it by moving the EM_RISCV to the file head, also some other >> >> defines in case of similar problem in the future. >> > >> > >> > >> > BTW, why is the flag 'is_riscv' needed? >> > >> > >> > All symbols starting with '$' look special to me. >> > >> > >> > >> > Why not like this? >> > >> > >> > if (str[0] == '$') >> > return true; >> > >> > return false; >> >> There's a bit of commentary in the v1 >> <https://lore.kernel.org/all/20230707054007.32591-1-palmer@rivosinc.com/>, >> but essentially it's not necessary. I just wanted to play things safe >> and avoid changing the mapping symbol detection elsewhere in order to >> deal with RISC-V. >> >> IIRC we decided $ was special in RISC-V because there were some other >> ports that behaved that way, but it wasn't universal. If folks are OK >> treating $-prefixed symbols as special everywhere that's fine with me, I >> just wasn't sure what the right answer was. >> >> There's also some similar arch-specific-ness with the labels and such in >> here. > > Hi Palmer, > > I am not a toolchain expert, but my gut feeling is > that the code was safer than needed. > > > I'd like to remove the 'is_riscv' switch rather than > applying this patch. > > Will you send a patch, or do you want me to do so? I've pretty much got it already. Do you want it on top of the original patch, or just squashed in so you can drop it?
On Fri, Jul 21, 2023 at 11:01 PM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > On Fri, 21 Jul 2023 04:58:20 PDT (-0700), masahiroy@kernel.org wrote: > > On Thu, Jul 13, 2023 at 1:28 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > >> > >> On Wed, 12 Jul 2023 08:55:23 PDT (-0700), masahiroy@kernel.org wrote: > >> > +To: Luis Chamberlain, the commiter of the breakage > >> > > >> > > >> > > >> > On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote: > >> >> > >> >> with "module: Ignore RISC-V mapping symbols too", build error occurs, > >> >> > >> >> scripts/mod/modpost.c: In function ‘is_valid_name’: > >> >> scripts/mod/modpost.c:1055:57: error: ‘EM_RISCV’ undeclared (first use in this function) > >> >> return !is_mapping_symbol(name, elf->hdr->e_machine == EM_RISCV); > >> >> > >> >> Fix it by moving the EM_RISCV to the file head, also some other > >> >> defines in case of similar problem in the future. > >> > > >> > > >> > > >> > BTW, why is the flag 'is_riscv' needed? > >> > > >> > > >> > All symbols starting with '$' look special to me. > >> > > >> > > >> > > >> > Why not like this? > >> > > >> > > >> > if (str[0] == '$') > >> > return true; > >> > > >> > return false; > >> > >> There's a bit of commentary in the v1 > >> <https://lore.kernel.org/all/20230707054007.32591-1-palmer@rivosinc.com/>, > >> but essentially it's not necessary. I just wanted to play things safe > >> and avoid changing the mapping symbol detection elsewhere in order to > >> deal with RISC-V. > >> > >> IIRC we decided $ was special in RISC-V because there were some other > >> ports that behaved that way, but it wasn't universal. If folks are OK > >> treating $-prefixed symbols as special everywhere that's fine with me, I > >> just wasn't sure what the right answer was. > >> > >> There's also some similar arch-specific-ness with the labels and such in > >> here. > > > > Hi Palmer, > > > > I am not a toolchain expert, but my gut feeling is > > that the code was safer than needed. > > > > > > I'd like to remove the 'is_riscv' switch rather than > > applying this patch. > > > > Will you send a patch, or do you want me to do so? > > I've pretty much got it already. Do you want it on top of the original > patch, or just squashed in so you can drop it? It is up to Luis Chamberlain. The original patch does not exist in my kbuild tree. (and I was not even not CC'ed, so I had not noticed it before I saw this report) commit c05780ef3c190c2dafbf0be8e65d4f01103ad577 Author: Palmer Dabbelt <palmer@rivosinc.com> AuthorDate: Fri Jul 7 09:00:51 2023 -0700 Commit: Luis Chamberlain <mcgrof@kernel.org> CommitDate: Mon Jul 10 12:45:23 2023 -0700 module: Ignore RISC-V mapping symbols too RISC-V has an extended form of mapping symbols that we use to encode the ISA when it changes in the middle of an ELF. This trips up modpost as a build failure, I haven't yet verified it yet but I believe the kallsyms difference should result in stacks looking sane again. Reported-by: Randy Dunlap <rdunlap@infradead.org> Closes: https://lore.kernel.org/all/9d9e2902-5489-4bf0-d9cb-556c8e5d71c2@infradead.org/ Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> -- Best Regards Masahiro Yamada
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 7c71429d6502..885cca272eb8 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -60,6 +60,22 @@ static unsigned int nr_unresolved; #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif + +#ifndef R_RISCV_SUB32 +#define R_RISCV_SUB32 39 +#endif + +#ifndef EM_LOONGARCH +#define EM_LOONGARCH 258 +#endif + +#ifndef R_LARCH_SUB32 +#define R_LARCH_SUB32 55 +#endif + void __attribute__((format(printf, 2, 3))) modpost_log(enum loglevel loglevel, const char *fmt, ...) { @@ -1428,22 +1444,6 @@ static int addend_mips_rel(uint32_t *location, Elf_Rela *r) return 0; } -#ifndef EM_RISCV -#define EM_RISCV 243 -#endif - -#ifndef R_RISCV_SUB32 -#define R_RISCV_SUB32 39 -#endif - -#ifndef EM_LOONGARCH -#define EM_LOONGARCH 258 -#endif - -#ifndef R_LARCH_SUB32 -#define R_LARCH_SUB32 55 -#endif - static void section_rela(struct module *mod, struct elf_info *elf, Elf_Shdr *sechdr) {