From 1aeb23cdfad85fbb0905ff47a30c712552253c46 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 19 Oct 2002 19:16:03 +0000 Subject: Add two hooks to signal module load and module unload to MD code. The primary reason for this is to allow MD code to process machine specific attributes, segments or sections in the ELF file and update machine specific state accordingly. An immediate use of this is in the ia64 port where unwind information is updated to allow debugging and tracing in/across modules. Note that this commit does not add the functionality to the ia64 port. See revision 1.9 of ia64/ia64/elf_machdep.c. Validated on: alpha, i386, ia64 --- sys/kern/link_elf.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/kern/link_elf.c') diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index bbbaa2ca3275..75c95cda179c 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -222,6 +222,12 @@ link_elf_link_common_finish(linker_file_t lf) elf_file_t ef = (elf_file_t)lf; char *newfilename; #endif + int error; + + /* Notify MD code that a module is being loaded. */ + error = elf_cpu_load_file(lf); + if (error) + return (error); #ifdef DDB GDB_STATE(RT_ADD); @@ -838,6 +844,9 @@ link_elf_unload_file(linker_file_t file) } #endif + /* Notify MD code that a module is being unloaded. */ + elf_cpu_unload_file(file); + if (ef->preloaded) { link_elf_unload_preload(file); return; -- cgit v1.2.3