powerpc/boot: Add support for 64bit little endian wrapper

The code is only slightly modified : entry points now use the
FIXUP_ENDIAN trampoline to switch endian order. The 32bit wrapper
is kept for big endian kernels and 64bit is enforced for little
endian kernels with a PPC64_BOOT_WRAPPER config option.

The linker script is generated using the kernel preprocessor flags
to make use of the CONFIG_* definitions and the wrapper script is
modified to take into account the new elf64ppc format.

Finally, the zImage file is compiled as a position independent
executable (-pie) which makes it loadable at any address by the
firmware.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Cédric Le Goater
2014-04-24 09:23:39 +02:00
committed by Benjamin Herrenschmidt
parent 2d9afb369b
commit 147c05168f
7 changed files with 72 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ cacheit=
binary=
gzip=.gz
pie=
format=
# cross-compilation prefix
CROSS=
@@ -136,6 +137,14 @@ if [ -z "$kernel" ]; then
kernel=vmlinux
fi
elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
case "$elfformat" in
elf64-powerpcle) format=elf64lppc ;;
elf64-powerpc) format=elf32ppc ;;
elf32-powerpc) format=elf32ppc ;;
esac
platformo=$object/"$platform".o
lds=$object/zImage.lds
ext=strip
@@ -154,6 +163,10 @@ of)
pseries)
platformo="$object/pseries-head.o $object/of.o $object/epapr.o"
link_address='0x4000000'
if [ "$format" != "elf32ppc" ]; then
link_address=
pie=-pie
fi
make_space=n
;;
maple)
@@ -379,7 +392,7 @@ if [ "$platform" != "miboot" ]; then
if [ -n "$link_address" ] ; then
text_start="-Ttext $link_address"
fi
${CROSS}ld -m elf32ppc -T $lds $text_start $pie -o "$ofile" \
${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \
$platformo $tmp $object/wrapper.a
rm $tmp
fi