From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932966AbcFQPdG (ORCPT ); Fri, 17 Jun 2016 11:33:06 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38553 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932130AbcFQPdE (ORCPT ); Fri, 17 Jun 2016 11:33:04 -0400 MIME-Version: 1.0 In-Reply-To: <20160617100745.1956133-1-arnd@arndb.de> References: <20160617100745.1956133-1-arnd@arndb.de> From: Kees Cook Date: Fri, 17 Jun 2016 08:33:00 -0700 X-Google-Sender-Auth: WaKK13qN7LkQXHpZnGfH6rN14Vs Message-ID: Subject: Re: [PATCH] lkdtm: avoid link error on ARM To: Greg Kroah-Hartman Cc: Arnd Bergmann , 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 Fri, Jun 17, 2016 at 3:07 AM, Arnd Bergmann wrote: > The lkdtm_rodata file is built so that a function in it gets linked into > the .rodata ELF section. This works fine normally, but on 32-bit ARM > with really large kernels, it prevents the linker from inserting a > veneer for the call to __gnu_mcount_nc in case we are building with > "gcc -pg": > > drivers/misc/built-in.o: In function `lkdtm_rodata_do_nothing': > panel.c:(.rodata+0x1480): relocation truncated to fit: R_ARM_CALL against symbol `__gnu_mcount_nc' defined in .text section in arch/arm/kernel/built-in.o > > We probably never want the profiling code to be enabled for this file > anyway, so this just removes the option here, and for the sake of > consistency also in the lkdtm core module. > > Signed-off-by: Arnd Bergmann > Fixes: 9a49a528dcf3 ("lkdtm: add function for testing .rodata section") Looks fine to me, thanks! Acked-by: Kees Cook Greg, can you take this into your tree for -next? Thanks! -Kees > --- > drivers/misc/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile > index 7d45ed4a1549..4a25eeaa30f9 100644 > --- a/drivers/misc/Makefile > +++ b/drivers/misc/Makefile > @@ -60,6 +60,8 @@ obj-$(CONFIG_PANEL) += panel.o > > lkdtm-$(CONFIG_LKDTM) += lkdtm_core.o > lkdtm-$(CONFIG_LKDTM) += lkdtm_rodata_objcopy.o > +CFLAGS_REMOVE_lkdtm_core.o += -pg > +CFLAGS_REMOVE_lkdtm_rodata.o += -pg > > OBJCOPYFLAGS := > OBJCOPYFLAGS_lkdtm_rodata_objcopy.o := \ > -- > 2.9.0 > -- Kees Cook Chrome OS & Brillo Security