summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-10-19 19:16:03 +0000
committermarcel <marcel@FreeBSD.org>2002-10-19 19:16:03 +0000
commitd35d608c0774a40070b89879d9410bdf473177d7 (patch)
treea5d88a56e3884938d35135eb41dd619975aba723 /sys/kern/link_elf.c
parentc5e66cd2c6877a700af9fbf50ea239377f827424 (diff)
downloadFreeBSD-src-d35d608c0774a40070b89879d9410bdf473177d7.zip
FreeBSD-src-d35d608c0774a40070b89879d9410bdf473177d7.tar.gz
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
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index bbbaa2c..75c95cd 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;
OpenPOWER on IntegriCloud