WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Endian safe mkelf32.c

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Endian safe mkelf32.c
From: "Vincent Hanquez" <tab@xxxxxxxxx>
Date: Thu, 24 Feb 2005 13:10:49 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 24 Feb 2005 12:36:33 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: <FA76FCFB-85C9-11D9-A117-000D932C71E6@xxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
References: <FA76FCFB-85C9-11D9-A117-000D932C71E6@xxxxxxxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Wed, Feb 23, 2005 at 01:37:32PM -0500, Jimi Xenidis wrote:
> apply in xen/arch/x86/boot

> +    if ( (in32_ehdr.e_type >> 8) == ET_EXEC &&
> +        (in32_ehdr.e_type & 0xff) != ET_EXEC )
> +    {
> +       swap = 1;
> +       swap_ehdr32(&in32_ehdr);
> +    }
> +    else if ( (in32_ehdr.e_type >> 8) != ET_EXEC &&
> +             (in32_ehdr.e_type & 0xff) == ET_EXEC )

This looks wrong. The endianess is figured by e.ident[EI_DATA] not by
reading e_type to see if we can recognize the type in all endianess.

Since you didn't remove the test just before

if ( !IS_ELF(in32_ehdr) ||
        (in32_ehdr.e_ident[EI_DATA] != ELFDATA2LSB) )
{
        fprintf(stderr, "Input image must be a little-endian Elf image.\n");
        return 1;
}

so you can't be there with a valid MSB ELF image.

the only explanation I have for the patch, is that you have an ELF file
that report to be LSB but is in fact MSB ...
what's the point to allow broken ELF file ?

please explain why this patch is necessary, thanks,

-- 
Vincent Hanquez


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>