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

Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines



> > +static int xsplice_header_check(const struct xsplice_elf *elf)
> > +{
> > +    const Elf_Ehdr *hdr = elf->hdr;
> > +
> > +    if ( sizeof(*elf->hdr) > elf->len )
> > +    {
> > +        dprintk(XENLOG_ERR, XSPLICE "%s: Section header is bigger than 
> > payload!\n",
> > +                elf->name);
> > +        return -EINVAL;
> > +    }
> > +
> > +    if ( !IS_ELF(*hdr) )
> > +    {
> > +        dprintk(XENLOG_ERR, XSPLICE "%s: Not an ELF payload!\n", 
> > elf->name);
> > +        return -EINVAL;
> > +    }
> > +
> > +    if ( hdr->e_ident[EI_CLASS] != ELFCLASS64 ||
> > +         hdr->e_ident[EI_DATA] != ELFDATA2LSB ||
> > +         hdr->e_ident[EI_OSABI] != ELFOSABI_SYSV ||
> 
> What about EI_VERSION and EI_ABIVERSION, btw?

As I did some prototype on ARM32 I realized that the EI_CLASS is wrong
in common code (as ELFCLASS32 is what ARM32 has). And the EI_ABIVERSION
too.

So EI_CLASS check moves to arch/x86/xsplice.c (and not in this
patch but in xsplice: Implement payload loading).


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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