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

[Xen-devel] [PATCH] fix mkelf32 when cross compiling on i386 for x86-64


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Muli Ben-Yehuda <mulix@xxxxxxxxx>
  • Date: Sat, 25 Feb 2006 19:27:15 +0200
  • Delivery-date: Sat, 25 Feb 2006 17:27:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Use strtoull to parse the final_exec_addr value from the command
line. Whe cross compiling on i386 for x86-64 unsigned long is 32 bit,
which leads to final_exec_addr being truncated to 32 bits by strtoul,
which leads to grub refusing to load the resulting image. Please
apply.

Signed-Off-By: Muli Ben-Yehuda <mulix@xxxxxxxxx>

diff -r 86eba2e17a39 -r ef4fe9970b03 xen/arch/x86/boot/mkelf32.c
--- a/xen/arch/x86/boot/mkelf32.c       Sat Feb 25 18:36:23 2006 +0200
+++ b/xen/arch/x86/boot/mkelf32.c       Sat Feb 25 19:07:43 2006 +0200
@@ -245,7 +245,7 @@ int main(int argc, char **argv)
     inimage  = argv[1];
     outimage = argv[2];
     loadbase = strtoul(argv[3], NULL, 16);
-    final_exec_addr = strtoul(argv[4], NULL, 16);
+    final_exec_addr = strtoull(argv[4], NULL, 16);
 
     infd = open(inimage, O_RDONLY);
     if ( infd == -1 )

-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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