Skip to contentSkip to conversation

fix mkelf32 when cross compiling on i386 for x86-64

PATCH In review Muli Ben-Yehuda 2 participants 2 messages Feb 25, 2006 – Feb 26, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix mkelf32 when cross compiling on i386 for x86-64

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.

xen/arch/x86/boot/mkelf32.c +1 -1
diff -r 86eba2e17a39 -r ef4fe9970b03 xen/arch/x86/boot/mkelf32.c
@@ -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 )
Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
#1 lore raw

thanks, worked on cross compile w/ x86_64 target system
--------------------------------------------

Quoted 7 lines · Muli Ben-Yehuda

fix mkelf32 when cross compiling on
i386 for x86-64
Date:
Sat, 25 Feb 2006 19:27:15 +0200
(09:27 PST)

Signature · 6 lines
Sincerely,      Woody Marvel
IBM Linux Technology Center
Open Source Virtualization
email: [email protected]
503-578-3833   Beaverton, OR 97006
**********************************