summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/libc_private.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-02-17 10:49:29 +0000
committerkib <kib@FreeBSD.org>2012-02-17 10:49:29 +0000
commit64ade36cab6e0ed6360892f218e783983556dde1 (patch)
tree4ac15d54cf734a144a3a7707224503456d970cbc /lib/libc/include/libc_private.h
parent7580cb460821c765fe29dae1c2c0b108821cc895 (diff)
downloadFreeBSD-src-64ade36cab6e0ed6360892f218e783983556dde1.zip
FreeBSD-src-64ade36cab6e0ed6360892f218e783983556dde1.tar.gz
Fetch the aux vector for the static libc, and use the entries to
initialize the cache of the system information as it was done for the dynamic libc. This removes several sysctls from the static binary startup. Use the aux vector to fill the single struct dl_phdr_info describing the static binary itself, to implement dl_iterate_phdr(3) for the static binaries. [1] Based on the submission by: John Marino <draco marino st> [1] Tested by: flo (sparc64) MFC after: 2 weeks
Diffstat (limited to 'lib/libc/include/libc_private.h')
-rw-r--r--lib/libc/include/libc_private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index c7284cc..d4b24a7 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -44,6 +44,15 @@
extern int __isthreaded;
/*
+ * Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector
+ * provided by kernel. Either set for us by rtld, or found at runtime
+ * on stack for static binaries.
+ *
+ * Type is void to avoid polluting whole libc with ELF types.
+ */
+extern void *__elf_aux_vector;
+
+/*
* libc should use libc_dlopen internally, which respects a global
* flag where loading of new shared objects can be restricted.
*/
@@ -229,6 +238,7 @@ int _execvpe(const char *, char * const *, char * const *);
int _elf_aux_info(int aux, void *buf, int buflen);
struct dl_phdr_info;
int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
+void __init_elf_aux_vector(void);
void _pthread_cancel_enter(int);
void _pthread_cancel_leave(int);
OpenPOWER on IntegriCloud