|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines
>>> On 27.04.16 at 03:59, <konrad.wilk@xxxxxxxxxx> wrote:
>> > +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.
EI_CLASS I can easily see (and in fact EI_DATA would need to
move there too, now that you menton this aspect), but why
EI_ABIVERSION? Afaik there are no versions other than 0
defined for ELFOSABI_NONE (which btw we wrongly call
ELFOSABI_SYSV). That imo is either EI_OSABI and EI_ABIVERSION
need to move, or both should be in common code.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |