[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200508082504.GA15302@linux-8ccs.fritz.box>
Date: Fri, 8 May 2020 10:25:07 +0200
From: Jessica Yu <jeyu@...nel.org>
To: Vincent Whitchurch <vincent.whitchurch@...s.com>
Cc: linux@...linux.org.uk, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, kernel@...s.com
Subject: Re: [PATCH 1/2] module: allow arch overrides for .init section names
+++ Vincent Whitchurch [06/05/20 17:25 +0200]:
>ARM stores unwind information for .init.text in sections named
>.ARM.extab.init.text and .ARM.exidx.init.text. Since those aren't
>currently recognized as init sections, they're allocated along with the
>core section, and relocation fails if the core and the init section are
>allocated from different regions and can't reach other.
>
> final section addresses:
> ...
> 0x7f800000 .init.text
> ..
> 0xcbb54078 .ARM.exidx.init.text
> ..
>
> section 16 reloc 0 sym '': relocation 42 out of range (0xcbb54078 ->
> 0x7f800000)
>
>Allow architectures to override the section name so that ARM can fix
>this.
>
>Signed-off-by: Vincent Whitchurch <vincent.whitchurch@...s.com>
>---
> include/linux/moduleloader.h | 2 ++
> kernel/module.c | 9 +++++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
>diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
>index ca92aea8a6bd..07d079085f11 100644
>--- a/include/linux/moduleloader.h
>+++ b/include/linux/moduleloader.h
>@@ -29,6 +29,8 @@ void *module_alloc(unsigned long size);
> /* Free memory returned from module_alloc. */
> void module_memfree(void *module_region);
>
>+bool module_init_section(const char *name);
>+
Hi, I just have two small nits. Could you please add a comment on top of
module_init_section to document it? (similar to module_exit_section())
> /* Determines if the section name is an exit section (that is only used during
> * module unloading)
> */
>diff --git a/kernel/module.c b/kernel/module.c
>index 33569a01d6e1..a5f2b4e1ef53 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2370,6 +2370,11 @@ static long get_offset(struct module *mod, unsigned int *size,
> return ret;
> }
>
>+bool __weak module_init_section(const char *name)
>+{
>+ return strstarts(name, ".init");
>+}
>+
Could you move this next to module_exit_section()? Just trying to keep
similar functions together. Otherwise, the patch looks fine to me.
Thanks!
Jessica
Powered by blists - more mailing lists