e27f41ba2b
Add <bits/indirect-return.h> and include it in <ucontext.h>. __INDIRECT_RETURN defined in <bits/indirect-return.h> indicates if swapcontext requires special compiler treatment. The default __INDIRECT_RETURN is empty. On x86, when shadow stack is enabled, __INDIRECT_RETURN is defined with indirect_return attribute, which has been added to GCC 9, to indicate that swapcontext returns via indirect branch. Otherwise __INDIRECT_RETURN is defined with returns_twice attribute. When shadow stack is enabled, remove always_inline attribute from prepare_test_buffer in string/tst-xbzero-opt.c to avoid: tst-xbzero-opt.c: In function ‘prepare_test_buffer’: tst-xbzero-opt.c:105:1: error: function ‘prepare_test_buffer’ can never be inlined because it uses setjmp prepare_test_buffer (unsigned char *buf) when indirect_return attribute isn't available. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * bits/indirect-return.h: New file. * misc/sys/cdefs.h (__glibc_has_attribute): New. * sysdeps/x86/bits/indirect-return.h: Likewise. * stdlib/Makefile (headers): Add bits/indirect-return.h. * stdlib/ucontext.h: Include <bits/indirect-return.h>. (swapcontext): Add __INDIRECT_RETURN. * string/tst-xbzero-opt.c (ALWAYS_INLINE): New. (prepare_test_buffer): Use it. |
||
---|---|---|
.. | ||
types | ||
byteswap.h | ||
confname.h | ||
dirent.h | ||
dlfcn.h | ||
elfclass.h | ||
endian.h | ||
environments.h | ||
errno.h | ||
fcntl.h | ||
fenv.h | ||
fenvinline.h | ||
floatn-common.h | ||
floatn.h | ||
flt-eval-method.h | ||
fp-fast.h | ||
fp-logb.h | ||
hwcap.h | ||
in.h | ||
indirect-return.h | ||
ioctl-types.h | ||
ioctls.h | ||
ipc.h | ||
ipctypes.h | ||
iscanonical.h | ||
libc-header-start.h | ||
libm-simd-decl-stubs.h | ||
link.h | ||
local_lim.h | ||
long-double.h | ||
math-vector.h | ||
mathdef.h | ||
mathinline.h | ||
mman.h | ||
mqueue.h | ||
msq.h | ||
netdb.h | ||
param.h | ||
poll.h | ||
posix_opt.h | ||
pthreadtypes.h | ||
resource.h | ||
sched.h | ||
select.h | ||
sem.h | ||
setjmp.h | ||
shm.h | ||
sigaction.h | ||
sigcontext.h | ||
sigevent-consts.h | ||
siginfo-consts.h | ||
signum-generic.h | ||
signum.h | ||
sigstack.h | ||
sigthread.h | ||
sockaddr.h | ||
socket.h | ||
ss_flags.h | ||
stat.h | ||
statfs.h | ||
statvfs.h | ||
stdint-intn.h | ||
stdint-uintn.h | ||
stdlib-bsearch.h | ||
stropts.h | ||
sys_errlist.h | ||
syslog-path.h | ||
sysmacros.h | ||
termios.h | ||
time.h | ||
typesizes.h | ||
uintn-identity.h | ||
uio_lim.h | ||
uio-ext.h | ||
utmp.h | ||
utsname.h | ||
waitflags.h | ||
waitstatus.h | ||
wchar.h | ||
wordsize.h | ||
xtitypes.h |