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

>>>>> "VH" == Vincent Hanquez <tab@xxxxxxxxx> writes:

 VH> 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 )

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

This test is discover if the build machine is the same endian of the
image or not.

 VH> Since you didn't remove the test just before

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

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

This is a different test, AFAIK this program is not relavent for any
MSB ELF image.  If we find an MSB ELF that does require this
"massaging" then we can revisit this last test.

 VH> the only explanation I have for the patch, is that you have an ELF file
 VH> that report to be LSB but is in fact MSB ...

This patch is to solve the problem of running the program on then MSB
build machine that is operating on the LSB ELF image.

 VH> please explain why this patch is necessary, thanks,

I think I've addressed your issues.
-JX


-------------------------------------------------------
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>