summaryrefslogtreecommitdiff
path: root/sys/arch/arc/include/link.h
diff options
context:
space:
mode:
authorimp <imp@cvs.openbsd.org>1996-12-11 05:55:36 +0000
committerimp <imp@cvs.openbsd.org>1996-12-11 05:55:36 +0000
commit983a837174b07619468870be85a1217429e53758 (patch)
tree2fa0abe825d50aa6abe5c6987dbca61ca879106d /sys/arch/arc/include/link.h
parent36aa6c0208b0b1541aacec0ff0bc7c173b782a70 (diff)
Sync headers to ld.so for gdb/arc support
Diffstat (limited to 'sys/arch/arc/include/link.h')
-rw-r--r--sys/arch/arc/include/link.h61
1 files changed, 59 insertions, 2 deletions
diff --git a/sys/arch/arc/include/link.h b/sys/arch/arc/include/link.h
index a6c1397134e..39e137ff191 100644
--- a/sys/arch/arc/include/link.h
+++ b/sys/arch/arc/include/link.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: link.h,v 1.1 1996/09/17 18:26:25 pefo Exp $ */
+/* $OpenBSD: link.h,v 1.2 1996/12/11 05:55:35 imp 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 */