1998-09-06 23:45:24 +00:00
|
|
|
#ifndef _SETJMP_H
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <setjmp/setjmp.h>
|
1998-08-09 17:39:48 +00:00
|
|
|
|
2012-02-26 04:18:39 +00:00
|
|
|
#ifndef _ISOMAC
|
1998-08-09 17:39:48 +00:00
|
|
|
/* Now define the internal interfaces. */
|
|
|
|
|
|
|
|
/* Internal machine-dependent function to restore context sans signal mask. */
|
1999-11-23 17:31:31 +00:00
|
|
|
extern void __longjmp (__jmp_buf __env, int __val)
|
2015-10-15 21:22:10 +00:00
|
|
|
__attribute__ ((__noreturn__)) attribute_hidden;
|
1998-08-09 17:39:48 +00:00
|
|
|
|
2017-08-20 13:30:29 +00:00
|
|
|
extern void ____longjmp_chk (__jmp_buf __env, int __val)
|
|
|
|
__attribute__ ((__noreturn__)) attribute_hidden;
|
|
|
|
|
1998-08-09 17:39:48 +00:00
|
|
|
/* Internal function to possibly save the current mask of blocked signals
|
|
|
|
in ENV, and always set the flag saying whether or not it was saved.
|
|
|
|
This is used by the machine-dependent definition of `__sigsetjmp'.
|
|
|
|
Always returns zero, for convenience. */
|
1999-11-23 17:31:31 +00:00
|
|
|
extern int __sigjmp_save (jmp_buf __env, int __savemask);
|
2000-12-05 17:34:28 +00:00
|
|
|
|
|
|
|
extern void _longjmp_unwind (jmp_buf env, int val);
|
|
|
|
|
2002-08-21 08:08:03 +00:00
|
|
|
extern void __libc_siglongjmp (sigjmp_buf env, int val)
|
2012-02-26 04:18:39 +00:00
|
|
|
__attribute__ ((noreturn));
|
2002-08-21 08:08:03 +00:00
|
|
|
extern void __libc_longjmp (sigjmp_buf env, int val)
|
|
|
|
__attribute__ ((noreturn));
|
2000-12-27 20:25:30 +00:00
|
|
|
|
2002-12-31 09:36:52 +00:00
|
|
|
libc_hidden_proto (_setjmp)
|
2003-08-31 18:10:47 +00:00
|
|
|
libc_hidden_proto (__sigsetjmp)
|
2015-10-15 21:22:10 +00:00
|
|
|
|
Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN
On the Hurd, the rtld needs to see its own dumb versions of a few functions
(defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once
loaded. rtld should thus not have hidden attribute for these. To achieve this,
the Hurd port used to just define NO_HIDDEN, which disables it completely. For
now, this changes that to disabling it for all rtld functions, for simplicity.
See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5
The ld.so numbers remain at
8 .rel.plt 000000c8 00000c24 00000c24 00000c24 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .plt 000001a0 00000cf0 00000cf0 00000cf0 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .plt.got 00000010 00000e90 00000e90 00000e90 2**3
CONTENTS, ALLOC, LOAD, READONLY, CODE
18 .got.plt 00000070 0002d000 0002d000 0002c000 2**2
CONTENTS, ALLOC, LOAD, DATA
which is about 3 times as much as on Linux.
The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls)
* include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto,
rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak,
rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak,
rtld_hidden_data_ver): Define to empty.
* include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail,
__assert_perror_fail): Likewise.
* include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
(__rewinddir): Likewise.
* include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
(__profile_frequency): Likewise.
* include/setjmp.h (__sigsetjmp): Likewise.
* include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction,
__libc_sigaction): Likewise.
* include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do
not set hidden attribute.
* include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup,
__strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset,
rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise.
* include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat,
__fxstat64, __lxstat, __lxstat64, __xstat, __xstat64,
__fxstatat64): Likewise.
* include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
(__uname): Likewise.
* include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN]
(_itoa_upper_digits, _itoa_lower_digits): Likewise.
* sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set.
(NO_RTLD_HIDDEN): Set.
* sysdeps/mach/hurd/configure: Refresh.
* config.h.in: Refresh.
2017-10-02 23:26:58 +00:00
|
|
|
# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
|
2015-10-15 21:22:10 +00:00
|
|
|
extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden;
|
|
|
|
# endif
|
2017-11-09 13:09:49 +00:00
|
|
|
|
|
|
|
/* Check jmp_buf sizes, alignments and offsets. */
|
|
|
|
# include <stddef.h>
|
|
|
|
# include <jmp_buf-macros.h>
|
|
|
|
|
|
|
|
# define STR_HELPER(x) #x
|
|
|
|
# define STR(x) STR_HELPER(x)
|
|
|
|
|
|
|
|
# define TEST_SIZE(type, size) \
|
|
|
|
_Static_assert (sizeof (type) == size, \
|
|
|
|
"size of " #type " != " \
|
|
|
|
STR (size))
|
|
|
|
# define TEST_ALIGN(type, align) \
|
|
|
|
_Static_assert (__alignof__ (type) == align , \
|
|
|
|
"align of " #type " != " \
|
|
|
|
STR (align))
|
|
|
|
# define TEST_OFFSET(type, member, offset) \
|
|
|
|
_Static_assert (offsetof (type, member) == offset, \
|
|
|
|
"offset of " #member " field of " #type " != " \
|
|
|
|
STR (offset))
|
|
|
|
|
|
|
|
/* Check if jmp_buf have the expected sizes. */
|
|
|
|
TEST_SIZE (jmp_buf, JMP_BUF_SIZE);
|
|
|
|
TEST_SIZE (sigjmp_buf, SIGJMP_BUF_SIZE);
|
|
|
|
|
|
|
|
/* Check if jmp_buf have the expected alignments. */
|
|
|
|
TEST_ALIGN (jmp_buf, JMP_BUF_ALIGN);
|
|
|
|
TEST_ALIGN (sigjmp_buf, SIGJMP_BUF_ALIGN);
|
|
|
|
|
|
|
|
/* Check if internal fields in jmp_buf have the expected offsets. */
|
|
|
|
TEST_OFFSET (struct __jmp_buf_tag, __mask_was_saved,
|
|
|
|
MASK_WAS_SAVED_OFFSET);
|
|
|
|
TEST_OFFSET (struct __jmp_buf_tag, __saved_mask,
|
|
|
|
SAVED_MASK_OFFSET);
|
2012-02-26 04:18:39 +00:00
|
|
|
#endif
|
2002-12-31 09:36:52 +00:00
|
|
|
|
1998-09-06 23:45:24 +00:00
|
|
|
#endif
|