summaryrefslogtreecommitdiffstats
path: root/sys/kern/linker_if.m
diff options
context:
space:
mode:
authorsson <sson@FreeBSD.org>2009-05-26 21:39:09 +0000
committersson <sson@FreeBSD.org>2009-05-26 21:39:09 +0000
commit527dd575556c8d79007e7a35cd752f1b46343fd2 (patch)
tree626fb22e642e1f12607624578d9f484a88a1e405 /sys/kern/linker_if.m
parente8484adb4444a310104af340656308e3b8d60088 (diff)
downloadFreeBSD-src-527dd575556c8d79007e7a35cd752f1b46343fd2.zip
FreeBSD-src-527dd575556c8d79007e7a35cd752f1b46343fd2.tar.gz
Add the ksyms(4) pseudo driver. The ksyms driver allows a process to
get a quick snapshot of the kernel's symbol table including the symbols from any loaded modules (the symbols are all merged into one symbol table). Unlike like other implementations, this ksyms driver maps memory in the process memory space to store the snapshot at the time /dev/ksyms is opened. It also checks to see if the process has already a snapshot open and won't allow it to open /dev/ksyms it again until it closes first. This prevents kernel and process memory from being exhausted. Note that /dev/ksyms is used by the lockstat(1) command. Reviewed by: gallatin kib (freebsd-arch) Approved by: gnn (mentor)
Diffstat (limited to 'sys/kern/linker_if.m')
-rw-r--r--sys/kern/linker_if.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/kern/linker_if.m b/sys/kern/linker_if.m
index aadcf04..379bc0e 100644
--- a/sys/kern/linker_if.m
+++ b/sys/kern/linker_if.m
@@ -105,6 +105,24 @@ METHOD int ctf_get {
};
#
+# Get the symbol table, returning it in **symtab. Return the
+# number of symbols, otherwise zero.
+#
+METHOD long symtab_get {
+ linker_file_t file;
+ Elf_Sym **symtab;
+};
+
+#
+# Get the string table, returning it in *strtab. Return the
+# size (in bytes) of the string table, otherwise zero.
+#
+METHOD long strtab_get {
+ linker_file_t file;
+ caddr_t *strtab;
+};
+
+#
# Load a file, returning the new linker_file_t in *result. If
# the class does not recognise the file type, zero should be
# returned, without modifying *result. If the file is
OpenPOWER on IntegriCloud