aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
commit65a311fcb2f44fce7eb05160d3198cefed5c27f9 (patch)
treed2eb15e6477b3d5e7e1f7c49c1e2eed3b85ec318 /sys/kern/link_elf.c
parent1a946b9fef9f4b4cd10611232e8844d4c2d33e69 (diff)
downloadsrc-65a311fcb2f44fce7eb05160d3198cefed5c27f9.tar.gz
src-65a311fcb2f44fce7eb05160d3198cefed5c27f9.zip
Give kldunload a -f(orce) argument.
Add a MOD_QUIESCE event for modules. This should return error (EBUSY) of the module is in use. MOD_UNLOAD should now only fail if it is impossible (as opposed to inconvenient) to unload the module. Valid reasons are memory references into the module which cannot be tracked down and eliminated. When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is not given, MOD_QUIESCE failing will also prevent the unload. For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as success. Document that modules should return EOPNOTSUPP for unknown events.
Notes
Notes: svn path=/head/; revision=132117
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 0f00d904a978..5679cbf2f3fa 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -492,7 +492,7 @@ link_elf_link_preload(linker_class_t cls,
error = parse_dynamic(ef);
if (error) {
- linker_file_unload(lf);
+ linker_file_unload(lf, LINKER_UNLOAD_FORCE);
return error;
}
link_elf_reloc_local(lf);
@@ -846,7 +846,7 @@ nosyms:
out:
if (error && lf)
- linker_file_unload(lf);
+ linker_file_unload(lf, LINKER_UNLOAD_FORCE);
if (shdr)
free(shdr, M_LINKER);
if (firstpage)