From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbdDCXa1 (ORCPT ); Mon, 3 Apr 2017 19:30:27 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:35208 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdDCXaZ (ORCPT ); Mon, 3 Apr 2017 19:30:25 -0400 MIME-Version: 1.0 In-Reply-To: <1491259387-15869-1-git-send-email-jeyu@redhat.com> References: <1491259387-15869-1-git-send-email-jeyu@redhat.com> From: Kees Cook Date: Mon, 3 Apr 2017 16:30:24 -0700 X-Google-Sender-Auth: 6b6p3Mymbkg5fSIfJDeXjqLTQzc Message-ID: Subject: Re: [PATCH] vmlinux.lds: add missing VMLINUX_SYMBOL macros To: Jessica Cc: Andrew Morton , Arnd Bergmann , Eddie Kovsky , linux-arch , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 3, 2017 at 3:43 PM, Jessica wrote: > From: Jessica Yu > > 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 Thanks! Acked-by: Kees Cook -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