@@ -7,7 +7,10 @@ targets += $(head-srcs:.S=.o)
head-srcs := $(addprefix $(obj)/, $(head-srcs))
-$(obj)/head.o: $(head-srcs)
+# For .incbin - add $(obj) to the include path and add the dependencies
+# manually as they're not included in .d
+$(obj)/head.o: AFLAGS-y += -Wa$(comma)-I$(obj)
+$(obj)/head.o: $(head-srcs:.S=.bin)
CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
$(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
@@ -18,10 +21,6 @@ CFLAGS_x86_32 += -I$(srctree)/include
$(head-srcs:.S=.o): CFLAGS_stack_boundary :=
$(head-srcs:.S=.o): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
-$(head-srcs): %.S: %.bin
- (od -v -t x $< | tr -s ' ' | awk 'NR > 1 {print s} {s=$$0}' | \
- sed 's/ /,0x/g' | sed 's/,0x$$//' | sed 's/^[0-9]*,/ .long /') >$@
-
%.bin: %.lnk
$(OBJCOPY) -j .text -O binary $< $@
@@ -777,11 +777,17 @@ trampoline_setup:
/* Jump into the relocated trampoline. */
lret
+ /*
+ * cmdline and reloc are written in C, and linked to be 32bit PIC with
+ * entrypoints at 0 and using the stdcall convention.
+ */
+ ALIGN
cmdline_parse_early:
-#include "cmdline.S"
+ .incbin "cmdline.bin"
+ ALIGN
reloc:
-#include "reloc.S"
+ .incbin "reloc.bin"
ENTRY(trampoline_start)
#include "trampoline.S"
There's no point wasting time converting binaries back to asm source. Just use .incbin directly. Explain in head.S what these binaries are. Also, align the blobs. While there's very little static data in the blobs, they should have at least 4 byte alignment. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Roger Pau Monné <roger.pau@citrix.com> CC: Wei Liu <wl@xen.org> CC: Anthony PERARD <anthony.perard@citrix.com> Cleanup to $(head-srcs) deferred to the subsequent patch to make the change legible. --- xen/arch/x86/boot/Makefile | 9 ++++----- xen/arch/x86/boot/head.S | 10 ++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-)