]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
x86/boot: check for not allowed sections before linking
authorDaniel Kiper <daniel.kiper@oracle.com>
Wed, 25 Nov 2015 16:24:36 +0000 (17:24 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Nov 2015 16:24:36 +0000 (17:24 +0100)
Currently check for not allowed sections is performed just after
compilation. However, if compilation succeeds and check fails then
second build will create xen.gz/xen.efi without any visible error.
This happens because %.o: %.c recipe created object file during first
run and make do not execute this recipe during second run. So, look
for not allowed sections before linking. This way check will be
executed every time.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/build32.mk

index c208249ca8e5b46575cf5fc9c11c24c6bc766474..4a1421f6badca76a5eb005597bc9afe2f6dcd9ee 100644 (file)
@@ -16,11 +16,7 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
        $(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-       $(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
-
-%.o: %.c
-       $(CC) $(CFLAGS) -c -fpic $< -o $@
-       $(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
+       $(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.*) \
@@ -29,6 +25,10 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
                                exit $$(expr $$idx + 1);; \
                        esac; \
                done
+       $(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
+
+%.o: %.c
+       $(CC) $(CFLAGS) -c -fpic $< -o $@
 
 reloc.o: reloc.c $(RELOC_DEPS)