]> xenbits.xensource.com Git - xen.git/commitdiff
xen/xsplice: add ELFOSABI_FREEBSD as a supported OSABI for payloads
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 3 May 2016 10:55:09 +0000 (12:55 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 6 May 2016 16:32:02 +0000 (12:32 -0400)
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é <roger.pau@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ross Lagerwall <ross.lagerwall@citrix.com>
xen/common/xsplice_elf.c

index 1e1f167dba5f995aa1bcb1e331c2559465f4eecc..d59759f5a59c20ac056734b9f0ca5ed3e87c7e3a 100644 (file)
@@ -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 )
     {