From 819cd3f41cacd487e927f7e2bad24b26750e4387 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Jan 2007 17:06:25 +0000 Subject: Limit -ENOEXEC to mean "this is not in my format". --- src/image/elf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/image') diff --git a/src/image/elf.c b/src/image/elf.c index 5233a64c4..cf58a5c33 100644 --- a/src/image/elf.c +++ b/src/image/elf.c @@ -53,7 +53,7 @@ static int elf_load_segment ( struct image *image, Elf_Phdr *phdr ) { /* Check segment lies within image */ if ( ( phdr->p_offset + phdr->p_filesz ) > image->len ) { DBG ( "ELF segment outside ELF file\n" ); - return -ENOEXEC; + return -ERANGE; } /* Find start address: use physical address for preference, @@ -65,7 +65,7 @@ static int elf_load_segment ( struct image *image, Elf_Phdr *phdr ) { dest = phdr->p_vaddr; if ( ! dest ) { DBG ( "ELF segment loads to physical address 0\n" ); - return -ENOEXEC; + return -ERANGE; } buffer = phys_to_user ( dest ); @@ -113,7 +113,7 @@ int elf_load ( struct image *image ) { if ( phoff > image->len ) { DBG ( "ELF program header %d outside ELF image\n", phnum ); - return -ENOEXEC; + return -ERANGE; } copy_from_user ( &phdr, image->data, phoff, sizeof ( phdr ) ); if ( ( rc = elf_load_segment ( image, &phdr ) ) != 0 ) -- cgit v1.2.3-55-g7522