rk: add and fix PIE support
author黄涛 <huangtao@rock-chips.com>
Fri, 22 Nov 2013 10:38:07 +0000 (18:38 +0800)
committer黄涛 <huangtao@rock-chips.com>
Fri, 22 Nov 2013 10:38:07 +0000 (18:38 +0800)
1) PIE depends on GENERIC_ALLOCATOR
2) fix old version objcopy -j do not support wildcard
3) add rockchip PIE section group

arch/arm/kernel/pie.lds.S
lib/Kconfig
pie/Makefile

index 4fd5ac5b08072fb3b225cf457254f4dc77a50c13..7950758f36fb81fae0a8396a21c4f38850438883 100644 (file)
@@ -23,6 +23,7 @@ SECTIONS
 
        PIE_OVERLAY_START
        OVERLAY : NOCROSSREFS {
 
        PIE_OVERLAY_START
        OVERLAY : NOCROSSREFS {
+               PIE_OVERLAY_SECTION(rockchip)
        }
        PIE_OVERLAY_SEND
 
        }
        PIE_OVERLAY_SEND
 
index 8d428a5c8f016f51944318c20ba9e8fc4184beeb..61b4be9e603bc302928ffc86528682af237f24ea 100644 (file)
@@ -345,6 +345,7 @@ config HAVE_PIE
 config PIE
        bool "Embedded position independant executables"
        depends on HAVE_PIE
 config PIE
        bool "Embedded position independant executables"
        depends on HAVE_PIE
+       select GENERIC_ALLOCATOR
        help
          This option adds support for embedding position indepentant (PIE)
          executables into the kernel. The PIEs can then be copied into
        help
          This option adds support for embedding position indepentant (PIE)
          executables into the kernel. The PIEs can then be copied into
index 9afed70fa0c56d5e35c32c2e3ee65374da70eefc..954ae12d9cddfc1b418fcbb321af0420dd5966e0 100644 (file)
@@ -62,6 +62,8 @@ $(obj)/pie_stage2.o: $(obj)/pie_stage1.o $(obj)/libpie_stage2.o
 
 # Drop everything but the pie sections
 OBJCOPYFLAGS_pie_stage3.o += -j ".pie.*"
 
 # Drop everything but the pie sections
 OBJCOPYFLAGS_pie_stage3.o += -j ".pie.*"
+OBJCOPYFLAGS_pie_stage3.o += -j ".pie.text"
+OBJCOPYFLAGS_pie_stage3.o += -j ".pie.rockchip.text" -j ".pie.rockchip.data"
 
 $(obj)/pie_stage3.o: $(obj)/pie_stage2.o
        $(call if_changed,objcopy)
 
 $(obj)/pie_stage3.o: $(obj)/pie_stage2.o
        $(call if_changed,objcopy)