diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-10 04:14:04 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-10 04:14:04 +0000 |
commit | 2de40dc0593bdf96a17ccf05b725d8b4260ec0e1 (patch) | |
tree | b6f874627bc9312c7060c11146e21ee5df3d1218 /lib/libc/hidden | |
parent | f15bb8f1a90ffad3aace60e831d29da29747ed5e (diff) |
libc.so can't be unloaded, so move the hidden atexit() and pthread_atfork()
stubs for the executable from crtbegin.o into libc, which lets them be
excluded from static links that don't use them.
For this, drop the normal crt{begin,end}S.o from libc.so: the .init and .fini
sections for libc aren't called at the right times anyway, so it's good that
they're unused. libc.so just needs __guard_local and the .note.openbsd.ident
section, so add them to stack_protector.c for now (this will be improved)
"good time" deraadt@
Diffstat (limited to 'lib/libc/hidden')
-rw-r--r-- | lib/libc/hidden/pthread.h | 25 | ||||
-rw-r--r-- | lib/libc/hidden/stdlib.h | 4 |
2 files changed, 27 insertions, 2 deletions
diff --git a/lib/libc/hidden/pthread.h b/lib/libc/hidden/pthread.h new file mode 100644 index 00000000000..c390753a1c2 --- /dev/null +++ b/lib/libc/hidden/pthread.h @@ -0,0 +1,25 @@ +/* $OpenBSD: pthread.h,v 1.1 2015/11/10 04:14:03 guenther Exp $ */ +/* + * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_PTHREAD_H_ +#define _LIBC_PTHREAD_H_ + +#include_next <pthread.h> + +PROTO_DEPRECATED(pthread_atfork); + +#endif /* !_LIBC_PTHREAD_H_ */ diff --git a/lib/libc/hidden/stdlib.h b/lib/libc/hidden/stdlib.h index 36e46072c50..0370fb8f5fe 100644 --- a/lib/libc/hidden/stdlib.h +++ b/lib/libc/hidden/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.5 2015/10/25 18:01:24 guenther Exp $ */ +/* $OpenBSD: stdlib.h,v 1.6 2015/11/10 04:14:03 guenther Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- @@ -54,7 +54,7 @@ PROTO_NORMAL(abs); PROTO_NORMAL(arc4random); PROTO_NORMAL(arc4random_buf); PROTO_NORMAL(arc4random_uniform); -/*PROTO_NORMAL(atexit); actually in csu */ +PROTO_NORMAL(atexit); PROTO_STD_DEPRECATED(atof); PROTO_NORMAL(atoi); PROTO_STD_DEPRECATED(atol); |