aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/Makefile
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2012-11-26 12:39:03 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-01-10 01:00:25 -0500
commit5ac47f7a6efbd4fa9141c249e8af3f74e7944eb7 (patch)
tree33c65b022ecc9e3ca2c5d506bf7ceb4764f626d5 /arch/powerpc/kernel/Makefile
parente95e09ce6790b456325bc8b5e95ccad647bff033 (diff)
powerpc: Relocate prom_init.c on 64bit
The ppc64 kernel can get loaded at any address which means our very early init code in prom_init.c must be relocatable. We do this with a pretty nasty RELOC() macro that we wrap accesses of variables with. It is very fragile and sometimes we forget to add a RELOC() to an uncommon path or sometimes a compiler change breaks it. 32bit has a much more elegant solution where we build prom_init.c with -mrelocatable and then process the relocations manually. Unfortunately we can't do the equivalent on 64bit and we would have to build the entire kernel relocatable (-pie), resulting in a large increase in kernel footprint (megabytes of relocation data). The relocation data will be marked __initdata but it still creates more pressure on our already tight memory layout at boot. Alan Modra pointed out that the 64bit ABI is relocatable even if we don't build with -pie, we just need to relocate the TOC. This patch implements that idea and relocates the TOC entries of prom_init.c. An added bonus is there are very few relocations to process which helps keep boot times on simulators down. gcc does not put 64bit integer constants into the TOC but to be safe we may want a build time script which passes through the prom_init.c TOC entries to make sure everything looks reasonable. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/Makefile')
-rw-r--r--arch/powerpc/kernel/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 44fbbea7697a..2f6ef4ed5abf 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -91,7 +91,6 @@ obj-$(CONFIG_RELOCATABLE_PPC32) += reloc_32.o
91obj-$(CONFIG_PPC32) += entry_32.o setup_32.o 91obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
92obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o 92obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
93obj-$(CONFIG_KGDB) += kgdb.o 93obj-$(CONFIG_KGDB) += kgdb.o
94obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
95obj-$(CONFIG_MODULES) += ppc_ksyms.o 94obj-$(CONFIG_MODULES) += ppc_ksyms.o
96obj-$(CONFIG_BOOTX_TEXT) += btext.o 95obj-$(CONFIG_BOOTX_TEXT) += btext.o
97obj-$(CONFIG_SMP) += smp.o 96obj-$(CONFIG_SMP) += smp.o
@@ -142,6 +141,7 @@ GCOV_PROFILE_kprobes.o := n
142extra-$(CONFIG_PPC_FPU) += fpu.o 141extra-$(CONFIG_PPC_FPU) += fpu.o
143extra-$(CONFIG_ALTIVEC) += vector.o 142extra-$(CONFIG_ALTIVEC) += vector.o
144extra-$(CONFIG_PPC64) += entry_64.o 143extra-$(CONFIG_PPC64) += entry_64.o
144extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
145 145
146extra-y += systbl_chk.i 146extra-y += systbl_chk.i
147$(obj)/systbl.o: systbl_chk 147$(obj)/systbl.o: systbl_chk