From: Mark Rutland <mark.rutland@arm.com>
To: Joey Gouly <joey.gouly@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, nd@arm.com,
andre.przywara@arm.com, catalin.marinas@arm.com,
vincenzo.frascino@arm.com, will@kernel.org
Subject: Re: [PATCH v1 1/3] arm64: module: move find_section to header
Date: Thu, 25 Aug 2022 14:19:55 +0100 [thread overview]
Message-ID: <Ywd2+2NwPugxntyL@FVFF77S0Q05N> (raw)
In-Reply-To: <20220825102025.53916-2-joey.gouly@arm.com>
On Thu, Aug 25, 2022 at 11:20:23AM +0100, Joey Gouly wrote:
> Move it to the header so that the implementation can be shared
> by the alternatives code.
>
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> arch/arm64/include/asm/module.h | 15 +++++++++++++++
> arch/arm64/kernel/module.c | 15 ---------------
> 2 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm64/include/asm/module.h b/arch/arm64/include/asm/module.h
> index 4e7fa2623896..22f1be47cc92 100644
> --- a/arch/arm64/include/asm/module.h
> +++ b/arch/arm64/include/asm/module.h
> @@ -65,4 +65,19 @@ static inline bool plt_entry_is_initialized(const struct plt_entry *e)
> return e->adrp || e->add || e->br;
> }
>
> +static inline const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
> + const Elf_Shdr *sechdrs,
> + const char *name)
> +{
> + const Elf_Shdr *s, *se;
> + const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
> +
> + for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) {
> + if (strcmp(name, secstrs + s->sh_name) == 0)
> + return s;
> + }
> +
> + return NULL;
> +}
> +
> #endif /* __ASM_MODULE_H */
> diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
> index f2d4bb14bfab..76b41e4ca9fa 100644
> --- a/arch/arm64/kernel/module.c
> +++ b/arch/arm64/kernel/module.c
> @@ -476,21 +476,6 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
> return -ENOEXEC;
> }
>
> -static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
> - const Elf_Shdr *sechdrs,
> - const char *name)
> -{
> - const Elf_Shdr *s, *se;
> - const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
> -
> - for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) {
> - if (strcmp(name, secstrs + s->sh_name) == 0)
> - return s;
> - }
> -
> - return NULL;
> -}
> -
> static inline void __init_plt(struct plt_entry *plt, unsigned long addr)
> {
> *plt = get_plt_entry(addr, plt);
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-08-25 13:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 10:20 [PATCH v1 0/3] Use CNTVCTSS_EL0 in gettimeofday() Joey Gouly
2022-08-25 10:20 ` [PATCH v1 1/3] arm64: module: move find_section to header Joey Gouly
2022-08-25 13:19 ` Mark Rutland [this message]
2022-08-25 10:20 ` [PATCH v1 2/3] arm64: alternative: patch alternatives in the vDSO Joey Gouly
2022-08-25 13:19 ` Mark Rutland
2022-08-25 14:57 ` Joey Gouly
2022-08-25 10:20 ` [PATCH v1 3/3] arm64: vdso: use SYS_CNTVCTSS_EL0 for gettimeofday Joey Gouly
2022-08-25 13:24 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ywd2+2NwPugxntyL@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=andre.przywara@arm.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=nd@arm.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox