On Wed, Feb 28, 2018 at 04:43:56PM -0800, Kees Cook wrote:
> On Wed, Feb 28, 2018 at 4:39 PM, Segher Boessenkool
> <seg...@kernel.crashing.org> wrote:
> > On Wed, Feb 28, 2018 at 04:15:23PM -0800, Kees Cook wrote:
> >> On Wed, Feb 28, 2018 at 3:23 PM, Segher Boessenkool
> >> <seg...@kernel.crashing.org> wrote:
> >> > I'm trying to figure out how to get that file to build at all :-)
> >
> >> $ CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc make wii_defconfig
> >> $ for i in CONFIG_STRICT_KERNEL_RWX \
> >>            CONFIG_DEBUG_KERNEL \
> >>            CONFIG_DEBUG_RODATA_TEST ; do
> >>     CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc ./scripts/config -e $i
> >> done
> >
> > I use ppc6xx_defconfig normally; I had to disable CONFIG_HIBERNATION
> > as well.
> >
> > Without the new flag, rodata_test_data ends up in .sdata in the object
> > file and in .data in vmlinux.
> >
> > Adding
> >
> > ===
> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> > index ccd2556..31b9613 100644
> > --- a/arch/powerpc/Makefile
> > +++ b/arch/powerpc/Makefile
> > @@ -143,6 +143,8 @@ CFLAGS-$(CONFIG_PPC64)      += $(call 
> > cc-option,-mcmodel=med
> >  CFLAGS-$(CONFIG_PPC64) += $(call 
> > cc-option,-mno-pointers-to-nested-functions)
> >  CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
> >
> > +CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata)
> > +
> >  ifeq ($(CONFIG_PPC_BOOK3S_64),y)
> >  CFLAGS-$(CONFIG_GENERIC_CPU) += $(call 
> > cc-option,-mtune=power7,-mtune=power4)
> >  CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4
> > ===
> >
> > it ends up in .rodata in both.
> 
> Excellent! That's perfect. :)
> 
> > It would be nice to have a more comprehensive test, but this will do; I'll
> > commit it tomorrow (will resend, with doc and changelog and all that).
> 
> Thank you! Do you want to send the Makefile fix upstream too, or
> should I route that?

If you could?  Have my

Signed-off-by: Segher Boessenkool <seg...@kernel.crashing.org>

if you want.

It'll be a while before all users have a compiler with the new flag, but
I'll backport it to GCC 7 and GCC 6 (the open release branches) to speed
that up a bit.


Segher

Reply via email to