kern_linker.c (157144) | kern_linker.c (158972) |
---|---|
1/*- 2 * Copyright (c) 1997-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997-2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 157144 2006-03-26 12:20:54Z jkoshy $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 158972 2006-05-27 09:21:41Z delphij $"); |
29 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> --- 1602 unchanged lines hidden (view full) --- 1639} 1640 1641/* 1642 * Search for module in all directories listed in the linker_path. 1643 */ 1644static char * 1645linker_search_kld(const char *name) 1646{ | 29 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> --- 1602 unchanged lines hidden (view full) --- 1639} 1640 1641/* 1642 * Search for module in all directories listed in the linker_path. 1643 */ 1644static char * 1645linker_search_kld(const char *name) 1646{ |
1647 char *cp, *ep, *result, **cpp; 1648 int extlen, len; | 1647 char *cp, *ep, *result; 1648 int len; |
1649 1650 /* qualified at all? */ 1651 if (index(name, '/')) 1652 return (linker_strdup(name)); 1653 | 1649 1650 /* qualified at all? */ 1651 if (index(name, '/')) 1652 return (linker_strdup(name)); 1653 |
1654 extlen = 0; 1655 for (cpp = linker_ext_list; *cpp; cpp++) { 1656 len = strlen(*cpp); 1657 if (len > extlen) 1658 extlen = len; 1659 } 1660 extlen++; /* trailing '\0' */ 1661 | |
1662 /* traverse the linker path */ 1663 len = strlen(name); 1664 for (ep = linker_path; *ep; ep++) { 1665 cp = ep; 1666 /* find the end of this component */ 1667 for (; *ep != 0 && *ep != ';'; ep++); 1668 result = linker_lookup_file(cp, ep - cp, name, len, NULL); 1669 if (result != NULL) --- 267 unchanged lines hidden --- | 1654 /* traverse the linker path */ 1655 len = strlen(name); 1656 for (ep = linker_path; *ep; ep++) { 1657 cp = ep; 1658 /* find the end of this component */ 1659 for (; *ep != 0 && *ep != ';'; ep++); 1660 result = linker_lookup_file(cp, ep - cp, name, len, NULL); 1661 if (result != NULL) --- 267 unchanged lines hidden --- |