From: Roger Pau Monne Date: Tue, 3 May 2016 10:55:09 +0000 (+0200) Subject: xen/xsplice: add ELFOSABI_FREEBSD as a supported OSABI for payloads X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1147 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f8c66c2ad2efdb281e4ebf15bf329d73c4f02ce7;p=xen.git xen/xsplice: add ELFOSABI_FREEBSD as a supported OSABI for payloads The calling convention used by the FreeBSD ELF OSABI is exactly the same as the the one defined by System V, so payloads with a FreeBSD OSABI should be accepted by the xsplice machinery. Specifically "the FreeBSD ELF OSABI only has a meaning for userspace applications, it's used by FreeBSD in order to detect if an application is native or if it needs to be run in the linuxator (the Linux emulator, or any other emulator that is available and matches the ELF OSABI specified in the binary FWIW). The only difference from SYSV to FreeBSD OSABI is the sysentvec that's selected inside of the FreeBSD kernel (the ABI between the kernel and the user-space application), but of course this doesn't apply to kernel code, which is what Xen and the xsplice payloads are. Sadly this is not written anywhere. " And since the ELF tools on FreeBSD by default build with this - they would stick this OSABI entry. Signed-off-by: Roger Pau Monné Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Acked-by: Ross Lagerwall --- diff --git a/xen/common/xsplice_elf.c b/xen/common/xsplice_elf.c index 1e1f167dba..d59759f5a5 100644 --- a/xen/common/xsplice_elf.c +++ b/xen/common/xsplice_elf.c @@ -397,7 +397,8 @@ static int xsplice_header_check(const struct xsplice_elf *elf) if ( hdr->e_version != EV_CURRENT || hdr->e_ident[EI_VERSION] != EV_CURRENT || hdr->e_ident[EI_ABIVERSION] != 0 || - hdr->e_ident[EI_OSABI] != ELFOSABI_NONE || + (hdr->e_ident[EI_OSABI] != ELFOSABI_NONE && + hdr->e_ident[EI_OSABI] != ELFOSABI_FREEBSD) || hdr->e_type != ET_REL || hdr->e_phnum != 0 ) {