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

Function linker_search_module

freebsd/kern/kern_linker.c:1967–1987  ·  view source on GitHub ↗

* Lookup KLD which contains requested module in the all directories. */

Source from the content-addressed store, hash-verified

1965 * Lookup KLD which contains requested module in the all directories.
1966 */
1967static char *
1968linker_search_module(const char *modname, int modnamelen,
1969 const struct mod_depend *verinfo)
1970{
1971 char *cp, *ep, *result;
1972
1973 /*
1974 * traverse the linker path
1975 */
1976 for (cp = linker_path; *cp; cp = ep + 1) {
1977 /* find the end of this component */
1978 for (ep = cp; (*ep != 0) && (*ep != ';'); ep++);
1979 result = linker_hints_lookup(cp, ep - cp, modname,
1980 modnamelen, verinfo);
1981 if (result != NULL)
1982 return (result);
1983 if (*ep == 0)
1984 break;
1985 }
1986 return (NULL);
1987}
1988
1989/*
1990 * Search for module in all directories listed in the linker_path.

Callers 1

linker_load_moduleFunction · 0.85

Calls 1

linker_hints_lookupFunction · 0.85

Tested by

no test coverage detected