Deleted Added
full compact
link_elf_obj.c (46694) link_elf_obj.c (50275)
1/*-
2 * Copyright (c) 1998 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) 1998 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 * $Id: link_elf.c,v 1.16 1999/01/29 09:04:27 bde Exp $
26 * $Id: link_elf.c,v 1.17 1999/05/08 13:03:49 peter Exp $
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/systm.h>
32#include <sys/malloc.h>
33#include <sys/proc.h>
34#include <sys/namei.h>

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

152 modname = (char *)preload_search_info(modptr, MODINFO_NAME);
153 if (modname == NULL)
154 modname = "kernel";
155 linker_kernel_file = linker_make_file(modname, ef, &link_elf_file_ops);
156 if (linker_kernel_file == NULL)
157 panic("link_elf_init: Can't create linker structures for kernel");
158 parse_dynamic(linker_kernel_file);
159 linker_kernel_file->address = (caddr_t) KERNBASE;
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/systm.h>
32#include <sys/malloc.h>
33#include <sys/proc.h>
34#include <sys/namei.h>

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

152 modname = (char *)preload_search_info(modptr, MODINFO_NAME);
153 if (modname == NULL)
154 modname = "kernel";
155 linker_kernel_file = linker_make_file(modname, ef, &link_elf_file_ops);
156 if (linker_kernel_file == NULL)
157 panic("link_elf_init: Can't create linker structures for kernel");
158 parse_dynamic(linker_kernel_file);
159 linker_kernel_file->address = (caddr_t) KERNBASE;
160 linker_kernel_file->size = -(long)linker_kernel_file->address;
160 linker_kernel_file->size = -(intptr_t)linker_kernel_file->address;
161
162 if (modptr) {
163 ef->modptr = modptr;
164 baseptr = preload_search_info(modptr, MODINFO_ADDR);
165 if (baseptr)
166 linker_kernel_file->address = *(caddr_t *)baseptr;
167 sizeptr = preload_search_info(modptr, MODINFO_SIZE);
168 if (sizeptr)

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

945 return ENOENT;
946}
947
948static int
949link_elf_search_symbol(linker_file_t lf, caddr_t value,
950 c_linker_sym_t* sym, long* diffp)
951{
952 elf_file_t ef = lf->priv;
161
162 if (modptr) {
163 ef->modptr = modptr;
164 baseptr = preload_search_info(modptr, MODINFO_ADDR);
165 if (baseptr)
166 linker_kernel_file->address = *(caddr_t *)baseptr;
167 sizeptr = preload_search_info(modptr, MODINFO_SIZE);
168 if (sizeptr)

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

945 return ENOENT;
946}
947
948static int
949link_elf_search_symbol(linker_file_t lf, caddr_t value,
950 c_linker_sym_t* sym, long* diffp)
951{
952 elf_file_t ef = lf->priv;
953 u_long off = (u_long) value;
953 u_long off = (uintptr_t) value;
954 u_long diff = off;
955 const Elf_Sym* es;
956 const Elf_Sym* best = 0;
957 int i;
958
959 for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
960 if (es->st_name == 0)
961 continue;

--- 19 unchanged lines hidden ---
954 u_long diff = off;
955 const Elf_Sym* es;
956 const Elf_Sym* best = 0;
957 int i;
958
959 for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
960 if (es->st_name == 0)
961 continue;

--- 19 unchanged lines hidden ---