[PATCH 1/4] purgatory: Add no-zero-initialized-in-bss flag

Geoff Levand geoff at infradead.org
Wed Mar 18 16:04:03 PDT 2015

It seems some toolchains will put zero-initialized variables like purgatory's
sha256_regions into the BSS section.  These symbols cannot be processed by
machine_apply_elf_rel() and lead to build errors.  To avoid this problem add
the compiler flag no-zero-initialized-in-bss to the purgatory CFLAGS.

Fixes build errors like these:

  Symbol: sha256_regions is in a bss section cannot set

Reported here:


Signed-off-by: Geoff Levand <geoff at infradead.org>
 purgatory/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/purgatory/Makefile b/purgatory/Makefile
index 1945702..1c7d2c0 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -47,7 +47,8 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
-		      -Os -fno-builtin -ffreestanding
+		      -Os -fno-builtin -ffreestanding \
+		      -fno-zero-initialized-in-bss
 			-I$(srcdir)/purgatory/include \

More information about the kexec mailing list