aboutsummaryrefslogtreecommitdiff
path: root/include/link.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/link.h')
-rw-r--r--include/link.h130
1 files changed, 21 insertions, 109 deletions
diff --git a/include/link.h b/include/link.h
index 0c35264096..3079ae8739 100644
--- a/include/link.h
+++ b/include/link.h
@@ -1,6 +1,6 @@
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
- Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,67 +18,32 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _LINK_H
-#define _LINK_H 1
+#ifndef _PRIVATE_LINK_H
+#define _PRIVATE_LINK_H 1
-#include <elf.h>
-#include <dlfcn.h>
-#include <stddef.h>
-#include <sys/types.h>
+#ifdef _LINK_H
+# error this should be impossible
+#endif
+
+/* Get most of the contents from the public header, but we define a
+ different `struct link_map' type for private use. The la_objopen
+ prototype uses the type, so we have to declare it separately. */
+#define link_map link_map_public
+#define la_objopen la_objopen_wrongproto
+#include <elf/link.h>
+#undef link_map
+#undef la_objopen
+
+struct link_map;
+extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
+ uintptr_t *__cookie);
-/* We use this macro to refer to ELF types independent of the native wordsize.
- `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
-#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
-#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
-#define _ElfW_1(e,w,t) e##w##t
-#include <bits/elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
-#include <bits/link.h>
+#include <stddef.h>
#include <bits/linkmap.h>
#include <dl-lookupcfg.h>
#include <tls.h> /* Defines USE_TLS. */
-/* Rendezvous structure used by the run-time dynamic linker to communicate
- details of shared object loading to the debugger. If the executable's
- dynamic section has a DT_DEBUG element, the run-time linker sets that
- element's value to the address where this structure can be found. */
-
-struct r_debug
- {
- int r_version; /* Version number for this protocol. */
-
- struct link_map *r_map; /* Head of the chain of loaded objects. */
-
- /* This is the address of a function internal to the run-time linker,
- that will always be called when the linker begins to map in a
- library or unmap it, and again when the mapping change is complete.
- The debugger can set a breakpoint at this address if it wants to
- notice shared object mapping changes. */
- ElfW(Addr) r_brk;
- enum
- {
- /* This state value describes the mapping change taking place when
- the `r_brk' address is called. */
- RT_CONSISTENT, /* Mapping change is complete. */
- RT_ADD, /* Beginning to add a new object. */
- RT_DELETE /* Beginning to remove an object mapping. */
- } r_state;
-
- ElfW(Addr) r_ldbase; /* Base address the linker is loaded at. */
- };
-
-/* This is the instance of that structure used by the dynamic linker. */
-extern struct r_debug _r_debug;
-
-/* 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; ++dyn)
- if (dyn->d_tag == DT_DEBUG)
- r_debug = (struct r_debug *) dyn->d_un.d_ptr;
- */
-extern ElfW(Dyn) _DYNAMIC[];
-
/* Some internal data structures of the dynamic linker used in the
linker map. We only provide forward declarations. */
@@ -316,45 +281,6 @@ struct link_map
} l_audit[0];
};
-/* Version numbers for la_version handshake interface. */
-#define LAV_CURRENT 1
-
-/* Activity types signaled through la_activity. */
-enum
- {
- LA_ACT_CONSISTENT,
- LA_ACT_ADD,
- LA_ACT_DELETE
- };
-
-/* Values representing origin of name for dynamic loading. */
-enum
- {
- LA_SER_ORIG = 0x01, /* Original name. */
- LA_SER_LIBPATH = 0x02, /* Directory from LD_LIBRARY_PATH. */
- LA_SER_RUNPATH = 0x04, /* Directory from RPATH/RUNPATH. */
- LA_SER_CONFIG = 0x08, /* Found through ldconfig. */
- LA_SER_DEFAULT = 0x40, /* Default directory. */
- LA_SER_SECURE = 0x80 /* Unused. */
- };
-
-/* Values for la_objopen return value. */
-enum
- {
- LA_FLG_BINDTO = 0x01, /* Audit symbols bound to this object. */
- LA_FLG_BINDFROM = 0x02 /* Audit symbols bound from this object. */
- };
-
-/* Values for la_symbind flags parameter. */
-enum
- {
- LA_SYMB_NOPLTENTER = 0x01, /* la_pltenter will not be called. */
- LA_SYMB_NOPLTEXIT = 0x02, /* la_pltexit will not be called. */
- LA_SYMB_STRUCTCALL = 0x04, /* Return value is a structure. */
- LA_SYMB_DLSYM = 0x08, /* Binding due to dlsym call. */
- LA_SYMB_ALTVALUE = 0x10 /* Value has been changed by a previous
- la_symbind call. */
- };
#if __ELF_NATIVE_CLASS == 32
# define symbind symbind32
@@ -364,22 +290,8 @@ enum
# error "__ELF_NATIVE_CLASS must be defined"
#endif
-struct dl_phdr_info
- {
- ElfW(Addr) dlpi_addr;
- const char *dlpi_name;
- const ElfW(Phdr) *dlpi_phdr;
- ElfW(Half) dlpi_phnum;
-
- unsigned long long int dlpi_adds;
- unsigned long long int dlpi_subs;
- };
-
-extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
- size_t size, void *data),
- void *data);
extern int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data),
void *data);
-#endif /* link.h */
+#endif /* include/link.h */