This is a more useful failure mode than hanging at boot time, and
incidentally fixes the clang/LLVM build by removing a .subsection rune.
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Tim Deegan <tim@xen.org>
%.o: %.c
$(CC) $(CFLAGS) -c -fpic $< -o $@
+ $(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p}' |\
+ while read idx name sz rest; do \
+ case "$$name" in \
+ .data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
+ test $$sz != 0 || continue; \
+ echo "Error: non-empty $$name: 0x$$sz" >&2; \
+ exit $$(expr $$idx + 1);; \
+ esac; \
+ done
reloc.o: $(BASEDIR)/include/asm-x86/config.h
.PRECIOUS: %.bin %.lnk
" call 1f \n"
"1: pop %ebx \n"
" mov %eax,alloc-1b(%ebx) \n"
- " mov $_end,%ecx \n" /* check that BSS is empty! */
- " sub $__bss_start,%ecx \n"
- " jz reloc \n"
- "1: jmp 1b \n"
+ " jmp reloc \n"
);
/* This is our data. Because the code must be relocatable, no BSS is
asm (
"alloc: \n"
" .long 0 \n"
- " .subsection 1 \n"
- " .p2align 4, 0xcc \n"
- " .subsection 0 \n"
);
typedef unsigned int u32;