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:
parent
1964fb9ba2
commit
87b1831f1d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user