diff options
author | guenther <> | 2019-06-02 01:03:01 +0000 |
---|---|---|
committer | guenther <> | 2019-06-02 01:03:01 +0000 |
commit | 067458d3e4d7e3ca6e967ce3ae9e59c217b2d319 (patch) | |
tree | 7d7261eb7ce107c1c6d6a5b9fe7ff3e3204af517 /src/lib/libc/include/namespace.h | |
parent | c6d26d2db7ee608499714dc433ddb9978db53cef (diff) | |
download | openbsd-067458d3e4d7e3ca6e967ce3ae9e59c217b2d319.tar.gz openbsd-067458d3e4d7e3ca6e967ce3ae9e59c217b2d319.tar.bz2 openbsd-067458d3e4d7e3ca6e967ce3ae9e59c217b2d319.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 'src/lib/libc/include/namespace.h')
-rw-r--r-- | src/lib/libc/include/namespace.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libc/include/namespace.h b/src/lib/libc/include/namespace.h index 79692af0bc..330af4050a 100644 --- a/src/lib/libc/include/namespace.h +++ b/src/lib/libc/include/namespace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: namespace.h,v 1.13 2019/05/13 20:00:32 guenther Exp $ */ | 1 | /* $OpenBSD: namespace.h,v 1.14 2019/06/02 01:03:01 guenther Exp $ */ |
2 | 2 | ||
3 | #ifndef _LIBC_NAMESPACE_H_ | 3 | #ifndef _LIBC_NAMESPACE_H_ |
4 | #define _LIBC_NAMESPACE_H_ | 4 | #define _LIBC_NAMESPACE_H_ |
@@ -59,6 +59,8 @@ | |||
59 | #define MAKE_CLONE(dst, src) __dso_hidden typeof(dst) HIDDEN(dst) \ | 59 | #define MAKE_CLONE(dst, src) __dso_hidden typeof(dst) HIDDEN(dst) \ |
60 | __attribute__((alias (HIDDEN_STRING(src)))) | 60 | __attribute__((alias (HIDDEN_STRING(src)))) |
61 | 61 | ||
62 | #define __relro __attribute__((section(".data.rel.ro"))) | ||
63 | |||
62 | 64 | ||
63 | /* | 65 | /* |
64 | * gcc and clang will generate calls to the functions below. | 66 | * gcc and clang will generate calls to the functions below. |