Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8588/1: localise objcopy flags

We currently define OBJCOPYFLAGS in the top-level arm Makefile, and thus
these flags will be passed to all uses of objcopy, kernel-wide, for
which they are not explicitly overridden. The flags we set are intended
for converting a few ELF files into raw binaries, and thus the flags
chosen are problematic for some other uses which do not expect a raw
binary result, e.g. the upcoming lkdtm rodata test:

http://www.openwall.com/lists/kernel-hardening/2016/06/08/2

This patch localises the objcopy flags such that they are only used for
the cases we require them for today.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Kees Cook <keescook@chromium.org>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Mark Rutland and committed by
Russell King
3cb59581 bf31c5e0

+2 -1
-1
arch/arm/Makefile
··· 23 23 LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds 24 24 endif 25 25 26 - OBJCOPYFLAGS :=-O binary -R .comment -S 27 26 GZFLAGS :=-9 28 27 #KBUILD_CFLAGS +=-pipe 29 28
+2
arch/arm/boot/Makefile
··· 11 11 # Copyright (C) 1995-2002 Russell King 12 12 # 13 13 14 + OBJCOPYFLAGS :=-O binary -R .comment -S 15 + 14 16 ifneq ($(MACHINE),) 15 17 include $(MACHINE)/Makefile.boot 16 18 endif