Annotation of src/include/link_elf.h, Revision 1.3
1.3 ! deraadt 1: /* $OpenBSD: link_elf.h,v 1.2 2002/08/06 07:40:31 pvalchev Exp $ */
1.1 art 2:
3: /*
1.2 pvalchev 4: * Copyright (c) 1996 Per Fogelstrom
5: *
6: * Redistribution and use in source and binary forms, with or without
7: * modification, are permitted provided that the following conditions
8: * are met:
9: * 1. Redistributions of source code must retain the above copyright
10: * notice, this list of conditions and the following disclaimer.
11: * 2. Redistributions in binary form must reproduce the above copyright
12: * notice, this list of conditions and the following disclaimer in the
13: * documentation and/or other materials provided with the distribution.
14: * 3. All advertising materials mentioning features or use of this software
15: * must display the following acknowledgement:
16: * This product includes software developed under OpenBSD by
17: * Per Fogelstrom.
18: * 4. The name of the author may not be used to endorse or promote products
19: * derived from this software without specific prior written permission.
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22: * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: * SUCH DAMAGE.
32: *
1.1 art 33: */
34:
1.2 pvalchev 35: #ifndef _LINK_ELF_H
36:
1.1 art 37: #include <elf_abi.h>
38:
39: #ifndef DT_PROCNUM
40: #define DT_PROCNUM 0
41: #endif
42:
1.2 pvalchev 43: /* Structure describing a loaded shared object. The `l_next' and `l_prev'
44: members form a chain of all the shared objects loaded at startup.
45:
46: These data structures exist in space used by the run-time dynamic linker;
47: modifying them may have disastrous results. */
48:
49: struct link_map
50: {
51: /* These first few members are part of the protocol with the debugger.
52: This is the same format used in SVR4. */
53:
54: Elf_Addr l_addr; /* Base address shared object is loaded at. */
55: Elf_Addr l_offs; /* Offset */
56: char *l_name; /* Absolute file name object was found in. */
57: Elf_Dyn *l_ld; /* Dynamic section of the shared object. */
58: struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
59:
60: /* All following members are internal to the dynamic linker.
61: They may change without notice. */
62:
63: const char *l_libname; /* Name requested (before search). */
64:
65: /* Indexed pointers to dynamic section. */
66: Elf_Dyn *l_info[DT_NUM + DT_PROCNUM];
67:
68: const Elf_Phdr *l_phdr; /* Pointer to program header table in core. */
69: Elf_Word l_phnum; /* Number of program header entries. */
70: Elf_Addr l_entry; /* Entry point location. */
71:
72: /* Symbol hash table. */
73: Elf_Word l_nbuckets;
74: const Elf_Word *l_buckets, *l_chain;
75:
76: unsigned int l_opencount; /* Reference count for dlopen/dlclose. */
77: enum /* Where this object came from. */
78: {
79: lt_executable, /* The main executable program. */
80: lt_interpreter, /* The interpreter: the dynamic linker. */
81: lt_library, /* Library needed by main executable. */
1.3 ! deraadt 82: lt_loaded /* Extra run-time loaded shared object. */
1.2 pvalchev 83: } l_type:2;
84: unsigned int l_deps_loaded:1; /* Nonzero if DT_NEEDED items loaded. */
85: unsigned int l_relocated:1; /* Nonzero if object's relocations done. */
86: unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */
87: unsigned int l_init_running:1; /* Nonzero while DT_INIT function runs. */
88: };
1.1 art 89:
1.2 pvalchev 90: #endif /* !_LINK_ELF_H */