1 /* $OpenBSD: modload.h,v 1.4 2002/06/09 08:13:07 todd Exp $ */ 2 /* $NetBSD: modload.h,v 1.2 2001/11/08 15:33:15 christos Exp $ */ 3 4 /* 5 * Copyright (c) 1993 Terrence R. Lambert. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by Terrence R. Lambert. 19 * 4. The name Terrence R. Lambert may not be used to endorse or promote 20 * products derived from this software without specific prior written 21 * permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY 24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 */ 35 36 #ifndef __modload_h__ 37 #define __modload_h__ 38 39 int elf_mod_sizes(int, size_t *, int *, struct lmc_resrv *, 40 struct stat *); 41 void *elf_mod_load(int); 42 void elf_linkcmd(char *, size_t, const char *, const char *, 43 const char *, const void *, const char *); 44 void elf_mod_symload(int); 45 46 int a_out_mod_sizes(int, size_t *, int *, struct lmc_resrv *, 47 struct stat *); 48 void *a_out_mod_load(int); 49 void a_out_linkcmd(char *, size_t, const char *, const char *, 50 const char *, const void *, const char *); 51 void a_out_mod_symload(int); 52 53 #ifndef USE_AOUT 54 #define mod_sizes elf_mod_sizes 55 #define mod_load elf_mod_load 56 #define mod_symload elf_mod_symload 57 #define linkcmd elf_linkcmd 58 #else 59 #define mod_sizes a_out_mod_sizes 60 #define mod_load a_out_mod_load 61 #define mod_symload a_out_mod_symload 62 #define linkcmd a_out_linkcmd 63 #endif 64 65 void loadbuf(void *, size_t); 66 void loadspace(size_t); 67 void loadsym(void *, size_t); 68 69 extern int debug; 70 extern int verbose; 71 72 #endif /* __modload_h__ */ 73