summaryrefslogtreecommitdiffstats
path: root/src/image/elf.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-11 18:06:25 +0100
committerMichael Brown2007-01-11 18:06:25 +0100
commit819cd3f41cacd487e927f7e2bad24b26750e4387 (patch)
treec313b5ef7bdc29e0550dfaf0644ade5ca25fd57e /src/image/elf.c
parentDistinguish between ENOMEM (as representing a lack of internal memory (diff)
downloadipxe-819cd3f41cacd487e927f7e2bad24b26750e4387.tar.gz
ipxe-819cd3f41cacd487e927f7e2bad24b26750e4387.tar.xz
ipxe-819cd3f41cacd487e927f7e2bad24b26750e4387.zip
Limit -ENOEXEC to mean "this is not in my format".
Diffstat (limited to 'src/image/elf.c')
-rw-r--r--src/image/elf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/image/elf.c b/src/image/elf.c
index 5233a64c..cf58a5c3 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 )