diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2019-05-10 13:29:22 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2019-05-10 13:29:22 +0000 |
commit | 7a997fa007d2414371c7b9fa2f4e83a0c3d406c2 (patch) | |
tree | ff8056bf55e605b407ec688972a67a4ab35dcd2b /include | |
parent | f16e61e66b2b5ec79eca82af98886596c97a38bb (diff) |
ld.so boot cleanup support:
- put functions and data which are only used before calling the executable's
start function into their own page-aligned segments for unmapping
(only done on amd64, arm64, armv7, powerpc, and sparc64 so far)
- pass .init_array and .preinit_array functions an addition argument which
is a callback to get a structure which includes a function that frees
the boot text and data
- sometimes delay doing RELRO processing: for a shared-object marked
DF_1_INITFIRST do it after the object's .init_array, for the executable
do it after the .preinit_array
- improve test-ld.so to link against libpthread and trigger its initialization
late
libc changes to use this will come later
ok kettenis@
Diffstat (limited to 'include')
-rw-r--r-- | include/tib.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/tib.h b/include/tib.h index 1c610222df6..8d9216f19dc 100644 --- a/include/tib.h +++ b/include/tib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tib.h,v 1.6 2017/11/28 18:57:02 kettenis Exp $ */ +/* $OpenBSD: tib.h,v 1.7 2019/05/10 13:29:21 guenther Exp $ */ /* * Copyright (c) 2011,2014 Philip Guenther <guenther@openbsd.org> * @@ -225,6 +225,28 @@ struct tib { __BEGIN_DECLS +struct dl_info; +struct dl_phdr_info; +struct dl_cb_0 { + void *(*dl_allocate_tib)(size_t); + void (*dl_free_tib)(void *, size_t); + void (*dl_clean_boot)(void); + void *(*dlopen)(const char *, int); + int (*dlclose)(void *); + void *(*dlsym)(void *, const char *); + int (*dladdr)(const void *, struct dl_info *); + int (*dlctl)(void *, int, void *); + char *(*dlerror)(void); + int (*dl_iterate_phdr)(int (*)(struct dl_phdr_info *, + size_t, void *), void *); +}; + +#define DL_CB_CUR 0 +typedef struct dl_cb_0 dl_cb; + +/* type of function passed to init functions that returns a dl_cb */ +typedef const void *dl_cb_cb(int _version); + void *_dl_allocate_tib(size_t _extra) __dso_public; void _dl_free_tib(void *_tib, size_t _extra) __dso_public; |