diff options
author | imp <imp@cvs.openbsd.org> | 1996-12-11 05:55:36 +0000 |
---|---|---|
committer | imp <imp@cvs.openbsd.org> | 1996-12-11 05:55:36 +0000 |
commit | 983a837174b07619468870be85a1217429e53758 (patch) | |
tree | 2fa0abe825d50aa6abe5c6987dbca61ca879106d | |
parent | 36aa6c0208b0b1541aacec0ff0bc7c173b782a70 (diff) |
Sync headers to ld.so for gdb/arc support
-rw-r--r-- | sys/arch/arc/include/elf_abi.h | 3 | ||||
-rw-r--r-- | sys/arch/arc/include/link.h | 61 | ||||
-rw-r--r-- | sys/sys/exec_elf.h | 3 |
3 files changed, 63 insertions, 4 deletions
diff --git a/sys/arch/arc/include/elf_abi.h b/sys/arch/arc/include/elf_abi.h index c2c6bee32c0..4290c15563a 100644 --- a/sys/arch/arc/include/elf_abi.h +++ b/sys/arch/arc/include/elf_abi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elf_abi.h,v 1.1 1996/09/17 18:26:24 pefo Exp $ */ +/* $OpenBSD: elf_abi.h,v 1.2 1996/12/11 05:55:34 imp Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -55,3 +55,4 @@ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ +#define DT_PROCNUM (DT_MIPS_HIPAGENO - DT_LOPROC + 1) 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 */ diff --git a/sys/sys/exec_elf.h b/sys/sys/exec_elf.h index 1f45dce4185..845d2ab79a4 100644 --- a/sys/sys/exec_elf.h +++ b/sys/sys/exec_elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.h,v 1.9 1996/11/06 18:41:52 etheisen Exp $ */ +/* $OpenBSD: exec_elf.h,v 1.10 1996/12/11 05:55:33 imp Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. * @@ -338,6 +338,7 @@ extern Elf32_Dyn _DYNAMIC[]; #define DT_DEBUG 21 /* bugger */ #define DT_TEXTREL 22 /* Allow rel. mod. to unwritable seg */ #define DT_JMPREL 23 /* add. of PLT's relocation entries */ +#define DT_NUM 24 /* Number used. */ #define DT_LOPROC 0x70000000 /* reserved range for processor */ #define DT_HIPROC 0x7fffffff /* specific dynamic array tags */ |