MCPcopy Create free account
hub / github.com/F-Stack/f-stack / linker_debug_search_symbol

Function linker_debug_search_symbol

freebsd/kern/kern_linker.c:918–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916#endif
917
918static int
919linker_debug_search_symbol(caddr_t value, c_linker_sym_t *sym, long *diffp)
920{
921 linker_file_t lf;
922 c_linker_sym_t best, es;
923 u_long diff, bestdiff, off;
924
925 best = 0;
926 off = (uintptr_t)value;
927 bestdiff = off;
928 TAILQ_FOREACH(lf, &linker_files, link) {
929 if (LINKER_SEARCH_SYMBOL(lf, value, &es, &diff) != 0)
930 continue;
931 if (es != 0 && diff < bestdiff) {
932 best = es;
933 bestdiff = diff;
934 }
935 if (bestdiff == 0)
936 break;
937 }
938 if (best) {
939 *sym = best;
940 *diffp = bestdiff;
941 return (0);
942 } else {
943 *sym = 0;
944 *diffp = off;
945 return (ENOENT);
946 }
947}
948
949static int
950linker_debug_symbol_values(c_linker_sym_t sym, linker_symval_t *symval)

Callers 2

linker_ddb_search_symbolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected