[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.4] x86/boot: check for not allowed sections before linking



commit 2f287a78df9192a4194b8146ed0e4661fdb92092
Author:     Daniel Kiper <daniel.kiper@xxxxxxxxxx>
AuthorDate: Tue Dec 15 15:55:00 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Dec 15 15:55:00 2015 +0100

    x86/boot: check for not allowed sections before linking
    
    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@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: d380b3559734739ae009cd3c0e9aabb5602863e2
    master date: 2015-11-25 17:24:36 +0100
---
 xen/arch/x86/boot/build32.mk |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index a2d4b34..8ca1de8 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -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: $(BASEDIR)/include/asm-x86/config.h
 .PRECIOUS: %.bin %.lnk
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.