summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2009-02-10 15:50:19 +0000
committerattilio <attilio@FreeBSD.org>2009-02-10 15:50:19 +0000
commit5c1db5bb2b6aa984560d4fe53345ff76d054f244 (patch)
treecbc7f972e68875419580625b01212e8ca9a248e6 /sys/kern/link_elf.c
parenta2362df98bbeb27fc9edbc9eaa9fc2166b1b763d (diff)
downloadFreeBSD-src-5c1db5bb2b6aa984560d4fe53345ff76d054f244.zip
FreeBSD-src-5c1db5bb2b6aa984560d4fe53345ff76d054f244.tar.gz
Scanning all the formats for binary translation of modules loading can
result in errors for a format loading but subsequent correct recognizing for another format. File format loading functions should avoid printing any additional informations but just returning appropriate (and different between each other) error condition, characterizing different informations. Additively, the linker should handle appropriately different format loading errors. While a general mechanism is desired, fix a simple and common case on amd64: file type is not recognized for link elf and confuses the linker. Printout an error if all the registered linker classes can't recognize and load the module. Reviewed by: jhb Sponsored by: Sandvine Incorporated
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 52b3f8f..c17dd15 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -638,8 +638,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
goto out;
}
if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) {
- link_elf_error(filename, "Unsupported file type");
- error = ENOEXEC;
+ error = ENOSYS;
goto out;
}
if (hdr->e_machine != ELF_TARG_MACH) {
@@ -694,8 +693,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
break;
case PT_INTERP:
- link_elf_error(filename, "Unsupported file type");
- error = ENOEXEC;
+ error = ENOSYS;
goto out;
}
OpenPOWER on IntegriCloud