lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Jul 2023 00:55:23 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>,
        Luis Chamberlain <mcgrof@...nel.org>
Cc:     Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Palmer Dabbelt <palmer@...osinc.com>
Subject: Re: [PATCH -next] modpost: move some defines to the file head

+To: Luis Chamberlain, the commiter of the breakage



On Wed, Jul 12, 2023 at 10:44 AM Kefeng Wang <wangkefeng.wang@...wei.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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ