Bail out if there were not two loadable sections. Add XXX comment about

one other issue.

Approved by:	re/rwatson.
This commit is contained in:
Poul-Henning Kamp 2003-05-12 15:08:10 +00:00
parent 1964fb9ba2
commit 87b1831f1d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114946
2 changed files with 16 additions and 0 deletions

View File

@ -646,6 +646,9 @@ link_elf_load_file(linker_class_t cls, const char* filename,
error = ENOEXEC;
goto out;
}
/*
* XXX: We just trust they come in right order ??
*/
segs[nsegs] = phdr;
++nsegs;
break;
@ -671,6 +674,11 @@ link_elf_load_file(linker_class_t cls, const char* filename,
error = ENOEXEC;
goto out;
}
if (nsegs != 2) {
link_elf_error("Too few sections");
error = ENOEXEC;
goto out;
}
/*
* Allocate the entire address space of the object, to stake out our

View File

@ -646,6 +646,9 @@ link_elf_load_file(linker_class_t cls, const char* filename,
error = ENOEXEC;
goto out;
}
/*
* XXX: We just trust they come in right order ??
*/
segs[nsegs] = phdr;
++nsegs;
break;
@ -671,6 +674,11 @@ link_elf_load_file(linker_class_t cls, const char* filename,
error = ENOEXEC;
goto out;
}
if (nsegs != 2) {
link_elf_error("Too few sections");
error = ENOEXEC;
goto out;
}
/*
* Allocate the entire address space of the object, to stake out our