Home | History | Annotate | Line # | Download | only in include
link_elf.h revision 1.8.2.1
      1  1.8.2.1  uebayasi /*	$NetBSD: link_elf.h,v 1.8.2.1 2010/10/22 07:11:52 uebayasi Exp $	*/
      2      1.5   thorpej 
      3      1.5   thorpej #ifndef _LINK_ELF_H_
      4      1.5   thorpej #define	_LINK_ELF_H_
      5      1.1       cgd 
      6      1.1       cgd #include <sys/types.h>
      7  1.8.2.1  uebayasi #include <sys/exec_elf.h>
      8      1.1       cgd 
      9      1.8     pooka typedef struct link_map {
     10      1.4  christos 	caddr_t		 l_addr;	/* Base Address of library */
     11      1.2    mhitch #ifdef __mips__
     12      1.4  christos 	caddr_t		 l_offs;	/* Load Offset of library */
     13      1.2    mhitch #endif
     14      1.4  christos 	const char	*l_name;	/* Absolute Path to Library */
     15      1.4  christos 	void		*l_ld;		/* Pointer to .dynamic in memory */
     16      1.4  christos 	struct link_map	*l_next;	/* linked list of of mapped libs */
     17      1.4  christos 	struct link_map *l_prev;
     18      1.8     pooka } Link_map;
     19      1.1       cgd 
     20  1.8.2.1  uebayasi /*
     21  1.8.2.1  uebayasi  * This only exists for GDB.
     22  1.8.2.1  uebayasi  */
     23      1.1       cgd struct r_debug {
     24      1.4  christos 	int r_version;			/* not used */
     25      1.4  christos 	struct link_map *r_map;		/* list of loaded images */
     26      1.7       uwe 	void (*r_brk)(void);		/* pointer to break point */
     27      1.1       cgd 	enum {
     28      1.4  christos 		RT_CONSISTENT,		/* things are stable */
     29      1.4  christos 		RT_ADD,			/* adding a shared library */
     30      1.4  christos 		RT_DELETE		/* removing a shared library */
     31      1.4  christos 	} r_state;
     32      1.1       cgd };
     33      1.4  christos 
     34  1.8.2.1  uebayasi struct dl_phdr_info
     35  1.8.2.1  uebayasi {
     36  1.8.2.1  uebayasi 	Elf_Addr dlpi_addr;			/* module relocation base */
     37  1.8.2.1  uebayasi 	const char *dlpi_name;			/* module name */
     38  1.8.2.1  uebayasi 	const Elf_Phdr *dlpi_phdr;		/* pointer to module's phdr */
     39  1.8.2.1  uebayasi 	Elf_Half dlpi_phnum;			/* number of entries in phdr */
     40  1.8.2.1  uebayasi 	unsigned long long int dlpi_adds;	/* total # of loads */
     41  1.8.2.1  uebayasi 	unsigned long long int dlpi_subs;	/* total # of unloads */
     42  1.8.2.1  uebayasi 	size_t dlpi_tls_modid;
     43  1.8.2.1  uebayasi 	void *dlpi_tls_data;
     44  1.8.2.1  uebayasi };
     45  1.8.2.1  uebayasi 
     46  1.8.2.1  uebayasi __BEGIN_DECLS
     47  1.8.2.1  uebayasi 
     48  1.8.2.1  uebayasi int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *),
     49  1.8.2.1  uebayasi     void *);
     50  1.8.2.1  uebayasi 
     51  1.8.2.1  uebayasi __END_DECLS
     52  1.8.2.1  uebayasi 
     53      1.5   thorpej #endif	/* _LINK_ELF_H_ */
     54