Deleted Added
full compact
kern_linker.c (62860) kern_linker.c (64143)
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/kern/kern_linker.c 62860 2000-07-09 23:58:56Z bp $
26 * $FreeBSD: head/sys/kern/kern_linker.c 64143 2000-08-02 21:08:53Z peter $
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

--- 915 unchanged lines hidden (view full) ---

950{
951 return lf->address + (uintptr_t)offset;
952}
953
954static void
955linker_preload(void* arg)
956{
957 caddr_t modptr;
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

--- 915 unchanged lines hidden (view full) ---

950{
951 return lf->address + (uintptr_t)offset;
952}
953
954static void
955linker_preload(void* arg)
956{
957 caddr_t modptr;
958 char *modname;
958 char *modname, *nmodname;
959 char *modtype;
960 linker_file_t lf;
961 linker_class_t lc;
962 int error, mcount;
963 struct linker_set *sysinits;
964 linker_file_list_t loaded_files;
965 linker_file_list_t depended_files;
966 struct linker_set *deps;
959 char *modtype;
960 linker_file_t lf;
961 linker_class_t lc;
962 int error, mcount;
963 struct linker_set *sysinits;
964 linker_file_list_t loaded_files;
965 linker_file_list_t depended_files;
966 struct linker_set *deps;
967 struct mod_metadata *mp;
968 int i;
967 struct mod_metadata *mp, *nmp;
968 int i, j;
969 int resolves;
970 modlist_t mod;
971
972 TAILQ_INIT(&loaded_files);
973 TAILQ_INIT(&depended_files);
974 TAILQ_INIT(&found_modules);
975 error = 0;
976

--- 61 unchanged lines hidden (view full) ---

1038 */
1039 resolves = 1; /* unless we know otherwise */
1040 if (deps) {
1041 for (i = 0; i < deps->ls_length; i++) {
1042 mp = linker_reloc_ptr(lf, deps->ls_items[i]);
1043 if (mp->md_type != MDT_DEPEND)
1044 continue;
1045 modname = linker_reloc_ptr(lf, mp->md_cval);
969 int resolves;
970 modlist_t mod;
971
972 TAILQ_INIT(&loaded_files);
973 TAILQ_INIT(&depended_files);
974 TAILQ_INIT(&found_modules);
975 error = 0;
976

--- 61 unchanged lines hidden (view full) ---

1038 */
1039 resolves = 1; /* unless we know otherwise */
1040 if (deps) {
1041 for (i = 0; i < deps->ls_length; i++) {
1042 mp = linker_reloc_ptr(lf, deps->ls_items[i]);
1043 if (mp->md_type != MDT_DEPEND)
1044 continue;
1045 modname = linker_reloc_ptr(lf, mp->md_cval);
1046 for (j = 0; j < deps->ls_length; j++) {
1047 nmp = linker_reloc_ptr(lf, deps->ls_items[j]);
1048 if (nmp->md_type != MDT_VERSION)
1049 continue;
1050 nmodname = linker_reloc_ptr(lf, nmp->md_cval);
1051 if (strcmp(modname, nmodname) == 0)
1052 break;
1053 }
1054 if (j < deps->ls_length) /* it's a self reference */
1055 continue;
1046 if (modlist_lookup(modname) == NULL) {
1047 /* ok, the module isn't here yet, we are not finished */
1048 resolves = 0;
1049 }
1050 }
1051 }
1052 /*
1053 * OK, if we found our modules, we can link. So, "provide" the

--- 327 unchanged lines hidden ---
1056 if (modlist_lookup(modname) == NULL) {
1057 /* ok, the module isn't here yet, we are not finished */
1058 resolves = 0;
1059 }
1060 }
1061 }
1062 /*
1063 * OK, if we found our modules, we can link. So, "provide" the

--- 327 unchanged lines hidden ---