summaryrefslogtreecommitdiffstats
path: root/lib/libc/include
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2019-06-02 01:03:01 +0000
committerguenther <guenther@openbsd.org>2019-06-02 01:03:01 +0000
commit5c7d06e56e289f4145af6fe3394d5d581f2679bd (patch)
tree08170e2ff8f3d142db0645a9c85003a1ecf2e71e /lib/libc/include
parentRefactor the MAP_STACK feature, and introduce another similar variation: (diff)
downloadwireguard-openbsd-5c7d06e56e289f4145af6fe3394d5d581f2679bd.tar.xz
wireguard-openbsd-5c7d06e56e289f4145af6fe3394d5d581f2679bd.zip
Complete the ld.so boot cleanup: move most libc initialization from
_csu_finish() to _libc_preinit(), which is an .init_array function in shared libc (and mark it INITFIRST) or a .preinit_array function in static libc, grabbing the _dl_cb callback there from ld.so. Then in _csu_finish(), invoke the dl_clean_boot() callback to free ld.so's startup bits before main() gets control. Other cleanups this permits: - move various startup structures into .data.rel.ro - the dl* stubs in libc can be strong and call the callbacks provided via _dl_cb - no longer need to conditionalize dlctl() calls on presence of _DYNAMIC original concept and full diff ok kettenis@ ok deraadt@
Diffstat (limited to 'lib/libc/include')
-rw-r--r--lib/libc/include/namespace.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h
index 79692af0bca..330af4050ad 100644
--- a/lib/libc/include/namespace.h
+++ b/lib/libc/include/namespace.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: namespace.h,v 1.13 2019/05/13 20:00:32 guenther Exp $ */
+/* $OpenBSD: namespace.h,v 1.14 2019/06/02 01:03:01 guenther Exp $ */
#ifndef _LIBC_NAMESPACE_H_
#define _LIBC_NAMESPACE_H_
@@ -59,6 +59,8 @@
#define MAKE_CLONE(dst, src) __dso_hidden typeof(dst) HIDDEN(dst) \
__attribute__((alias (HIDDEN_STRING(src))))
+#define __relro __attribute__((section(".data.rel.ro")))
+
/*
* gcc and clang will generate calls to the functions below.