Date: Fri, 19 May 2006 01:04:45 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97437 for review Message-ID: <200605190104.k4J14jLH035449@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=97437 Change 97437 by jb@jb_freebsd2 on 2006/05/19 01:04:31 Add a function to look through all linker files for a symbol name and return it's value. Affected files ... .. //depot/projects/dtrace/src/sys/kern/kern_linker.c#5 edit .. //depot/projects/dtrace/src/sys/sys/linker.h#5 edit Differences ... ==== //depot/projects/dtrace/src/sys/kern/kern_linker.c#5 (text+ko) ==== @@ -630,6 +630,28 @@ } caddr_t +linker_file_lookup_value(const char *name) +{ + linker_file_t lf; + c_linker_sym_t sym; + linker_symval_t symval; + + symval.value = 0; + + mtx_lock(&kld_mtx); + + TAILQ_FOREACH(lf, &linker_files, link) { + if (LINKER_LOOKUP_SYMBOL(lf, name, &sym) == 0 && + LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) + break; + } + + mtx_unlock(&kld_mtx); + + return (symval.value); +} + +caddr_t linker_file_lookup_symbol(linker_file_t file, const char *name, int deps) { c_linker_sym_t sym; ==== //depot/projects/dtrace/src/sys/sys/linker.h#5 (text+ko) ==== @@ -151,6 +151,11 @@ int _deps); /* + * Lookup a symbol in all files, returning it's value. + */ +caddr_t linker_file_lookup_value(const char* _name); + +/* * Lookup a linker set in a file. Return pointers to the first entry, * last + 1, and count of entries. Use: for (p = start; p < stop; p++) {} * void *start is really: "struct yoursetmember ***start;"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605190104.k4J14jLH035449>