ia64/xen-unstable
changeset 10077:dbe396fd6fd8
Theoretically a 0 VIRT_BASE is okay. Change the bail code when
parsing elf headers to bail only when VIRT_BASE is not specified
at all.
Signed-off-by: Keir Fraser <keir@xensource.com>
parsing elf headers to bail only when VIRT_BASE is not specified
at all.
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Wed May 17 23:41:59 2006 +0100 (2006-05-17) |
parents | 18c3da3ad6f7 |
children | 345464c2fd47 |
files | tools/libxc/xc_load_elf.c |
line diff
1.1 --- a/tools/libxc/xc_load_elf.c Wed May 17 23:28:22 2006 +0100 1.2 +++ b/tools/libxc/xc_load_elf.c Wed May 17 23:41:59 2006 +0100 1.3 @@ -148,16 +148,14 @@ static int parseelfimage(const char *ima 1.4 1.5 dsi->xen_guest_string = guestinfo; 1.6 1.7 - virt_base = 0; 1.8 - if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL ) 1.9 - virt_base = strtoul(p+10, &p, 0); 1.10 - 1.11 - if ( virt_base == 0 ) 1.12 + if ( (p = strstr(guestinfo, "VIRT_BASE=")) == NULL ) 1.13 { 1.14 - ERROR("Malformed ELF image. VIRT_BASE in '__xen_guest' section set incorrectly"); 1.15 + ERROR("Malformed ELF image. No VIRT_BASE specified"); 1.16 return -EINVAL; 1.17 } 1.18 1.19 + virt_base = strtoul(p+10, &p, 0); 1.20 + 1.21 dsi->elf_paddr_offset = virt_base; 1.22 if ( (p = strstr(guestinfo, "ELF_PADDR_OFFSET=")) != NULL ) 1.23 dsi->elf_paddr_offset = strtoul(p+17, &p, 0);