diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 1997-07-31 15:42:29 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 1997-07-31 15:42:29 +0000 |
commit | 081c5da0565db67f2a0c351eefe4fb20050ce8da (patch) | |
tree | 7c6a12463371f0b9c04c72be1b05f2d01add17f4 /sys | |
parent | f0a5d659327a0b7946ebbded2b54c18373682030 (diff) |
link.h from arc
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/wgrisc/include/link.h | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/sys/arch/wgrisc/include/link.h b/sys/arch/wgrisc/include/link.h index 411e4e93e56..4f8d8bac081 100644 --- a/sys/arch/wgrisc/include/link.h +++ b/sys/arch/wgrisc/include/link.h @@ -1,4 +1,4 @@ -/* $OpenBSD: link.h,v 1.1 1997/02/06 16:02:44 pefo Exp $ */ +/* $OpenBSD: link.h,v 1.2 1997/07/31 15:42:28 pefo Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -35,7 +35,7 @@ #ifndef _LINK_H #define _LINK_H 1 -#include <elf.h> +#include <elf_abi.h> #include <machine/elf_abi.h> /* @@ -65,4 +65,61 @@ struct r_debug { Elf32_Addr r_ldbase; /* Base address the linker is loaded at. */ }; +/* This symbol refers to the "dynamic structure" in the `.dynamic' section + of whatever module refers to `_DYNAMIC'. So, to find its own + `struct r_debug', a program could do: + for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL) + if (dyn->d_tag == DT_MIPS_RLD_MAP) r_debug = (struct r_debug) dyn->d_un.d_ptr; + */ + +extern Elf32_Dyn _DYNAMIC[]; + + +/* Structure describing a loaded shared object. The `l_next' and `l_prev' + members form a chain of all the shared objects loaded at startup. + + These data structures exist in space used by the run-time dynamic linker; + modifying them may have disastrous results. */ + +struct link_map + { + /* These first few members are part of the protocol with the debugger. + This is the same format used in SVR4. */ + + Elf32_Addr l_addr; /* Base address shared object is loaded at. */ + Elf32_Addr l_offs; /* Offset */ + char *l_name; /* Absolute file name object was found in. */ + Elf32_Dyn *l_ld; /* Dynamic section of the shared object. */ + struct link_map *l_next, *l_prev; /* Chain of loaded objects. */ + + /* All following members are internal to the dynamic linker. + They may change without notice. */ + + const char *l_libname; /* Name requested (before search). */ + + /* Indexed pointers to dynamic section. */ + Elf32_Dyn *l_info[DT_NUM + DT_PROCNUM]; + + const Elf32_Phdr *l_phdr; /* Pointer to program header table in core. */ + Elf32_Word l_phnum; /* Number of program header entries. */ + Elf32_Addr l_entry; /* Entry point location. */ + + /* Symbol hash table. */ + Elf32_Word l_nbuckets; + const Elf32_Word *l_buckets, *l_chain; + + unsigned int l_opencount; /* Reference count for dlopen/dlclose. */ + enum /* Where this object came from. */ + { + lt_executable, /* The main executable program. */ + lt_interpreter, /* The interpreter: the dynamic linker. */ + lt_library, /* Library needed by main executable. */ + lt_loaded, /* Extra run-time loaded shared object. */ + } l_type:2; + unsigned int l_deps_loaded:1; /* Nonzero if DT_NEEDED items loaded. */ + unsigned int l_relocated:1; /* Nonzero if object's relocations done. */ + unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */ + unsigned int l_init_running:1; /* Nonzero while DT_INIT function runs. */ + }; + #endif /* _LINK_H */ |