diff options
author | attilio <attilio@FreeBSD.org> | 2009-02-10 15:50:19 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2009-02-10 15:50:19 +0000 |
commit | 5c1db5bb2b6aa984560d4fe53345ff76d054f244 (patch) | |
tree | cbc7f972e68875419580625b01212e8ca9a248e6 /sys/kern/kern_linker.c | |
parent | a2362df98bbeb27fc9edbc9eaa9fc2166b1b763d (diff) | |
download | FreeBSD-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/kern_linker.c')
-rw-r--r-- | sys/kern/kern_linker.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 7805b01..9350713 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -425,6 +425,14 @@ linker_load_file(const char *filename, linker_file_t *result) * the module was not found. */ if (foundfile) { + + /* + * If the file type has not been recognized by the last try + * printout a message before to fail. + */ + if (error == ENOSYS) + printf("linker_load_file: Unsupported file type\n"); + /* * Format not recognized or otherwise unloadable. * When loading a module that is statically built into |