[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdk7u5Yj8+Y6WeSpdohz25Tcrpo9Gc9BuAhpbac7RibEjQ@mail.gmail.com>
Date: Wed, 17 May 2023 13:58:43 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Pitre <npitre@...libre.com>,
Nicolas Schier <nicolas@...sle.eu>
Subject: Re: [PATCH v5 08/21] modpost: pass 'tosec' down to default_mismatch_handler()
On Sun, May 14, 2023 at 8:28 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> default_mismatch_handler() does not need to compute 'tosec' because
> it is calculated by the caller.
>
> Pass it down to default_mismatch_handler() instead of calling
> sec_name() twice.
Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> scripts/mod/modpost.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 49357a716519..2cc9c2a4aadc 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1203,9 +1203,9 @@ static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
>
> static void default_mismatch_handler(const char *modname, struct elf_info *elf,
> const struct sectioncheck* const mismatch,
> - Elf_Rela *r, Elf_Sym *sym, const char *fromsec)
> + Elf_Rela *r, Elf_Sym *sym, const char *fromsec,
> + const char *tosec)
> {
> - const char *tosec;
> Elf_Sym *to;
> Elf_Sym *from;
> const char *tosym;
> @@ -1214,7 +1214,6 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
> from = find_elf_symbol2(elf, r->r_offset, fromsec);
> fromsym = sym_name(elf, from);
>
> - tosec = sec_name(elf, get_secindex(elf, sym));
> to = find_elf_symbol(elf, r->r_addend, sym);
> tosym = sym_name(elf, to);
>
> @@ -1276,7 +1275,7 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
> if (!mismatch)
> return;
>
> - default_mismatch_handler(modname, elf, mismatch, r, sym, fromsec);
> + default_mismatch_handler(modname, elf, mismatch, r, sym, fromsec, tosec);
> }
>
> static unsigned int *reloc_location(struct elf_info *elf,
> --
> 2.39.2
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists