linker.h (85736) | linker.h (86469) |
---|---|
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/sys/linker.h 85736 2001-10-30 15:21:45Z green $ | 26 * $FreeBSD: head/sys/sys/linker.h 86469 2001-11-16 21:08:40Z iedowse $ |
27 */ 28 29#ifndef _SYS_LINKER_H_ 30#define _SYS_LINKER_H_ 31 32#ifdef _KERNEL 33 34#include <machine/elf.h> --- 34 unchanged lines hidden (view full) --- 69 int userrefs; /* kldload(2) count */ 70 int flags; 71#define LINKER_FILE_LINKED 0x1 /* file has been fully linked */ 72 TAILQ_ENTRY(linker_file) link; /* list of all loaded files */ 73 char* filename; /* file which was loaded */ 74 int id; /* unique id */ 75 caddr_t address; /* load address */ 76 size_t size; /* size of file */ | 27 */ 28 29#ifndef _SYS_LINKER_H_ 30#define _SYS_LINKER_H_ 31 32#ifdef _KERNEL 33 34#include <machine/elf.h> --- 34 unchanged lines hidden (view full) --- 69 int userrefs; /* kldload(2) count */ 70 int flags; 71#define LINKER_FILE_LINKED 0x1 /* file has been fully linked */ 72 TAILQ_ENTRY(linker_file) link; /* list of all loaded files */ 73 char* filename; /* file which was loaded */ 74 int id; /* unique id */ 75 caddr_t address; /* load address */ 76 size_t size; /* size of file */ |
77 int ndeps; /* number of dependancies */ 78 linker_file_t* deps; /* list of dependancies */ | 77 int ndeps; /* number of dependencies */ 78 linker_file_t* deps; /* list of dependencies */ |
79 STAILQ_HEAD(, common_symbol) common; /* list of common symbols */ 80 TAILQ_HEAD(, module) modules; /* modules in this file */ 81 TAILQ_ENTRY(linker_file) loaded; /* preload dependency support */ 82}; 83 84/* 85 * Object implementing a class of file (a.out, elf, etc.) 86 */ --- 41 unchanged lines hidden (view full) --- 128linker_file_t linker_make_file(const char* _filename, linker_class_t _cls); 129 130/* 131 * Unload a file, freeing up memory. 132 */ 133int linker_file_unload(linker_file_t _file); 134 135/* | 79 STAILQ_HEAD(, common_symbol) common; /* list of common symbols */ 80 TAILQ_HEAD(, module) modules; /* modules in this file */ 81 TAILQ_ENTRY(linker_file) loaded; /* preload dependency support */ 82}; 83 84/* 85 * Object implementing a class of file (a.out, elf, etc.) 86 */ --- 41 unchanged lines hidden (view full) --- 128linker_file_t linker_make_file(const char* _filename, linker_class_t _cls); 129 130/* 131 * Unload a file, freeing up memory. 132 */ 133int linker_file_unload(linker_file_t _file); 134 135/* |
136 * Add a dependancy to a file. | 136 * Add a dependency to a file. |
137 */ | 137 */ |
138int linker_file_add_dependancy(linker_file_t _file, linker_file_t _dep); | 138int linker_file_add_dependency(linker_file_t _file, linker_file_t _dep); |
139 140/* | 139 140/* |
141 * Lookup a symbol in a file. If deps is TRUE, look in dependancies | 141 * Lookup a symbol in a file. If deps is TRUE, look in dependencies |
142 * if not found in file. 143 */ 144caddr_t linker_file_lookup_symbol(linker_file_t _file, const char* _name, 145 int _deps); 146 147/* 148 * Lookup a linker set in a file. Return pointers to the first entry, 149 * last + 1, and count of entries. Use: for (p = start; p < stop; p++) {} 150 * void *start is really: "struct yoursetmember ***start;" 151 */ 152int linker_file_lookup_set(linker_file_t _file, const char *_name, 153 void *_start, void *_stop, int *_count); 154 155/* 156 * This routine is responsible for finding dependencies of userland 157 * initiated kldload(2)'s of files. 158 */ | 142 * if not found in file. 143 */ 144caddr_t linker_file_lookup_symbol(linker_file_t _file, const char* _name, 145 int _deps); 146 147/* 148 * Lookup a linker set in a file. Return pointers to the first entry, 149 * last + 1, and count of entries. Use: for (p = start; p < stop; p++) {} 150 * void *start is really: "struct yoursetmember ***start;" 151 */ 152int linker_file_lookup_set(linker_file_t _file, const char *_name, 153 void *_start, void *_stop, int *_count); 154 155/* 156 * This routine is responsible for finding dependencies of userland 157 * initiated kldload(2)'s of files. 158 */ |
159int linker_load_dependancies(linker_file_t _lf); | 159int linker_load_dependencies(linker_file_t _lf); |
160 161/* 162 * DDB Helpers, tuned specifically for ddb/db_kld.c 163 */ 164int linker_ddb_lookup(const char *_symstr, c_linker_sym_t *_sym); 165int linker_ddb_search_symbol(caddr_t _value, c_linker_sym_t *_sym, 166 long *_diffp); 167int linker_ddb_symbol_values(c_linker_sym_t _sym, linker_symval_t *_symval); --- 100 unchanged lines hidden --- | 160 161/* 162 * DDB Helpers, tuned specifically for ddb/db_kld.c 163 */ 164int linker_ddb_lookup(const char *_symstr, c_linker_sym_t *_sym); 165int linker_ddb_search_symbol(caddr_t _value, c_linker_sym_t *_sym, 166 long *_diffp); 167int linker_ddb_symbol_values(c_linker_sym_t _sym, linker_symval_t *_symval); --- 100 unchanged lines hidden --- |