[PATCH 1/3] kexec-tools: powerpc: Fix 64bit optimize for size (gcc -Os) build

Anton Blanchard anton at samba.org
Mon Nov 14 17:24:06 EST 2011


Hi Alan,

> > commit 46b2d0b8a719 (kexec/powerpc fix optimization for size (gcc
> > -Os) build) added out of line GPR save/restore handlers for 32bit
> > -Os builds. This patch adds the handlers for 64bit builds.
> 
> The linker is supposed to add these functions magically on final link
> for powerpc64.  Um, I suppose you're doing something horrible with
> kexec, ld -r instead of normal final link at a guess?

Yeah:

gcc -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes
-fno-zero-initialized-in-bss -m64 -Os -fno-builtin -ffreestanding -m64
-Wl,--no-undefined -nostartfiles -nostdlib -nodefaultlibs -e
purgatory_start -r -o purgatory/purgatory.ro purgatory/purgatory.o
purgatory/printf.o purgatory/string.o purgatory/arch/ppc64/v2wrap.o
purgatory/arch/ppc64/hvCall.o purgatory/arch/ppc64/purgatory-ppc64.o
purgatory/arch/ppc64/console-ppc64.o
purgatory/arch/ppc64/crashdump_backup.o purgatory/arch/ppc64/misc.o
purgatory/sha256.o

bin/bin-to-hex purgatory < purgatory/purgatory.ro > kexec/purgatory.c

I wonder why we aren't building and linking an -fpic object, wouldn't
it make the relocation code much simpler?

Anton



More information about the kexec mailing list