-O $(BASEDIR)/include/xen/compile.h ]; then \
echo '$(TARGET).efi'; fi)
+shim-$(CONFIG_PVH_GUEST) := $(TARGET)-shim
+
ifneq ($(build_id_linker),)
notes_phdrs = --notes
else
>$(@D)/$(@F).map
rm -f $(@D)/.$(@F).[0-9]*
+# Use elf32-x86-64 if toolchain support exists, elf32-i386 otherwise.
+$(TARGET)-shim: FORMAT = $(firstword $(filter elf32-x86-64,$(shell $(OBJCOPY) --help)) elf32-i386)
+$(TARGET)-shim: $(TARGET)-syms
+ $(OBJCOPY) -O $(FORMAT) $< $@
+
note.o: $(TARGET)-syms
$(OBJCOPY) -O binary --only-section=.note.gnu.build-id $(BASEDIR)/xen-syms $@.bin
$(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 \
rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32
rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d
rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/disabled efi/mkreloc
+ rm -f $(BASEDIR)/xen-shim
rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin
rm -f note.o
#include <asm/page.h>
#include <asm/msr.h>
#include <asm/cpufeature.h>
+#include <public/elfnote.h>
.text
.code32
/* Jump to earlier loaded address. */
jmp *%edi
+#ifdef CONFIG_PVH_GUEST
+ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY, .long sym_offs(__pvh_start))
+
+__pvh_start:
+ ud2a
+
+#endif /* CONFIG_PVH_GUEST */
+
__start:
cld
cli
PHDRS
{
text PT_LOAD ;
-#if defined(BUILD_ID) && !defined(EFI)
+#if (defined(BUILD_ID) || defined (CONFIG_PVH_GUEST)) && !defined(EFI)
note PT_NOTE ;
#endif
}
__param_end = .;
} :text
+#if defined(CONFIG_PVH_GUEST) && !defined(EFI)
+ DECL_SECTION(.note.Xen) {
+ *(.note.Xen)
+ } :note :text
+#endif
+
#if defined(BUILD_ID)
#if !defined(EFI)
/*
#ifdef EFI
*(.comment)
*(.comment.*)
+ *(.note.Xen)
#endif
}