linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmlinux.lds: add missing VMLINUX_SYMBOL macros
@ 2017-04-03 22:43 Jessica
  2017-04-03 23:30 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Jessica @ 2017-04-03 22:43 UTC (permalink / raw)
  To: Andrew Morton, Arnd Bergmann, Kees Cook
  Cc: Eddie Kovsky, linux-arch, linux-kernel, Jessica Yu

From: Jessica Yu <jeyu@redhat.com>

When __{start,end}_ro_after_init is referenced from C code, we run into the
following build errors on blackfin:

  kernel/extable.c:169: undefined reference to `__start_ro_after_init'
  kernel/extable.c:169: undefined reference to `__end_ro_after_init'

The build error is due to the fact that blackfin is one of the few arches
that prepends an underscore '_' to all symbols defined in C. Fix this by
wrapping __{start,end}_ro_after_init in vmlinux.lds.h with VMLINUX_SYMBOL(),
which adds the necessary prefix for arches that have HAVE_UNDERSCORE_SYMBOL_PREFIX.

Signed-off-by: Jessica Yu <jeyu@redhat.com>
---
This patch is based on next-20170403.

 include/asm-generic/vmlinux.lds.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 979b573..54918ae 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -261,9 +261,9 @@
  */
 #ifndef RO_AFTER_INIT_DATA
 #define RO_AFTER_INIT_DATA						\
-	__start_ro_after_init = .;					\
+	VMLINUX_SYMBOL(__start_ro_after_init) = .;			\
 	*(.data..ro_after_init)						\
-	__end_ro_after_init = .;
+	VMLINUX_SYMBOL(__end_ro_after_init) = .;
 #endif
 
 /*
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vmlinux.lds: add missing VMLINUX_SYMBOL macros
  2017-04-03 22:43 [PATCH] vmlinux.lds: add missing VMLINUX_SYMBOL macros Jessica
@ 2017-04-03 23:30 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2017-04-03 23:30 UTC (permalink / raw)
  To: Jessica; +Cc: Andrew Morton, Arnd Bergmann, Eddie Kovsky, linux-arch, LKML

On Mon, Apr 3, 2017 at 3:43 PM, Jessica <jeyu@redhat.com> wrote:
> From: Jessica Yu <jeyu@redhat.com>
>
> When __{start,end}_ro_after_init is referenced from C code, we run into the
> following build errors on blackfin:
>
>   kernel/extable.c:169: undefined reference to `__start_ro_after_init'
>   kernel/extable.c:169: undefined reference to `__end_ro_after_init'
>
> The build error is due to the fact that blackfin is one of the few arches
> that prepends an underscore '_' to all symbols defined in C. Fix this by
> wrapping __{start,end}_ro_after_init in vmlinux.lds.h with VMLINUX_SYMBOL(),
> which adds the necessary prefix for arches that have HAVE_UNDERSCORE_SYMBOL_PREFIX.
>
> Signed-off-by: Jessica Yu <jeyu@redhat.com>

Thanks!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
> This patch is based on next-20170403.
>
>  include/asm-generic/vmlinux.lds.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 979b573..54918ae 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -261,9 +261,9 @@
>   */
>  #ifndef RO_AFTER_INIT_DATA
>  #define RO_AFTER_INIT_DATA                                             \
> -       __start_ro_after_init = .;                                      \
> +       VMLINUX_SYMBOL(__start_ro_after_init) = .;                      \
>         *(.data..ro_after_init)                                         \
> -       __end_ro_after_init = .;
> +       VMLINUX_SYMBOL(__end_ro_after_init) = .;
>  #endif
>
>  /*
> --
> 2.5.5
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-03 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 22:43 [PATCH] vmlinux.lds: add missing VMLINUX_SYMBOL macros Jessica
2017-04-03 23:30 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).