summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/kern/kern_linker.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/kern/kern_linker.c')
-rw-r--r--freebsd/sys/kern/kern_linker.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/freebsd/sys/kern/kern_linker.c b/freebsd/sys/kern/kern_linker.c
index 07fbd418..4571cbed 100644
--- a/freebsd/sys/kern/kern_linker.c
+++ b/freebsd/sys/kern/kern_linker.c
@@ -640,6 +640,10 @@ linker_make_file(const char *pathname, linker_class_t lc)
lf->ndeps = 0;
lf->deps = NULL;
lf->loadcnt = ++loadcnt;
+#ifdef __arm__
+ lf->exidx_addr = 0;
+ lf->exidx_size = 0;
+#endif
STAILQ_INIT(&lf->common);
TAILQ_INIT(&lf->modules);
TAILQ_INSERT_TAIL(&linker_files, lf, link);
@@ -2077,14 +2081,18 @@ linker_load_module(const char *kldname, const char *modname,
*/
KASSERT(verinfo == NULL, ("linker_load_module: verinfo"
" is not NULL"));
+ /* check if root file system is not mounted */
+ if (rootvnode == NULL || curproc->p_fd->fd_rdir == NULL)
+ return (ENXIO);
pathname = linker_search_kld(kldname);
} else {
if (modlist_lookup2(modname, verinfo) != NULL)
return (EEXIST);
+ /* check if root file system is not mounted */
+ if (rootvnode == NULL || curproc->p_fd->fd_rdir == NULL)
+ return (ENXIO);
if (kldname != NULL)
pathname = strdup(kldname, M_LINKER);
- else if (rootvnode == NULL)
- pathname = NULL;
else
/*
* Need to find a KLD with required module