Skip to content

Commit b8083f8

Browse files
jaustinRussell King
authored and
Russell King
committed
ARM: 7666/1: decompressor: add -mno-single-pic-base for building the decompressor
Before jumping to (position independent) C-code from the decompressor's assembler world we set-up the C environment. This setup currently does not set r9, which for arm-none-uclinux-uclibceabi toolchains is by default expected to be the PIC offset base register (IE should point to the beginning of the GOT). Currently, therefore, in order to build working kernels that use the decompressor it is necessary to use an arm-linux-gnueabi toolchain, or similar. uClinux toolchains cause a prefetch abort to occur at the beginning of the decompress_kernel function. This patch allows uClinux toolchains to build bootable zImages by forcing the -mno-single-pic-base option, which ensures that the location of the GOT is re-derived each time it is required, and r9 becomes free for use as a general purpose register. This has a small (4% in instruction terms) advantage over the alternative of setting r9 to point to the GOT before calling into the C-world. Signed-off-by: Jonathan Austin <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 3f7d1fe commit b8083f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/boot/compressed/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
120120
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
121121
endif
122122

123-
ccflags-y := -fpic -fno-builtin -I$(obj)
123+
ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
124124
asflags-y := -Wa,-march=all -DZIMAGE
125125

126126
# Supply kernel BSS size to the decompressor via a linker symbol.

0 commit comments

Comments
 (0)