elf.c: better error message when memory is unavailable
authorH. Peter Anvin <hpa@zytor.com>
Tue, 2 Oct 2007 20:41:55 +0000 (13:41 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 2 Oct 2007 20:41:55 +0000 (13:41 -0700)
Print something other than just "invalid ELF file or insufficient
memory" when the specific error is that a specific memory segment is
not available.

com32/modules/elf.c

index 3fb1ad6..35463c2 100644 (file)
@@ -141,7 +141,8 @@ int boot_elf(void *ptr, size_t len, char **argv)
       dprintf("Segment at 0x%08x len 0x%08x\n", ph->p_paddr, ph->p_memsz);
 
       if (syslinux_memmap_type(amap, ph->p_paddr, ph->p_memsz) != SMT_FREE) {
-       dprintf("Region not free!\n");
+       printf("Memory segment at 0x%08x (len 0x%08x) is unavailable\n",
+              ph->p_paddr, ph->p_memsz);
        goto bail;              /* Memory region unavailable */
       }