glibc/sysdeps
H.J. Lu e27f41ba2b Add <bits/indirect-return.h>
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.
2018-07-24 07:55:47 -07:00
..
aarch64 aarch64,falkor: Use vector registers for memcpy 2018-06-29 22:45:59 +05:30
alpha Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
arm Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
generic x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
gnu hurd: Fix shmid_ds's shm_segsz field type 2018-06-02 21:52:43 +02:00
hppa Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
htl hurd: Fix missing __pthread_get_cleanup_stack symbol 2018-06-16 10:52:04 +02:00
hurd hurd: Fix installed-headers tests 2018-07-20 03:28:08 +02:00
i386 i386: Use _CET_NOTRACK in memset-sse2-rep.S 2018-07-18 08:04:12 -07:00
ia64 Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
ieee754 ldbl-128ibm-compat: Add printf_size 2018-07-02 10:51:01 -03:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k m68k: Reorganize log1p and significand implementations 2018-06-22 21:34:28 -03:00
mach check-execstack: Permit sysdeps to xfail some libs 2018-07-20 03:28:14 +02:00
microblaze Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
mips Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
nios2 Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
nptl libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
posix Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251) 2018-06-26 13:22:53 -03:00
powerpc powerpc64: Always restore TOC on longjmp [BZ #21895] 2018-07-16 16:08:41 -03:00
pthread hurd: fix sigevent's sigev_notify_attributes field type 2018-04-19 21:43:44 +02:00
riscv elf: Unify symbol address run-time calculation [BZ #19818] 2018-04-04 23:09:37 +01:00
s390 Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
sh Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
sparc Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
unix x86: Update vfork to pop shadow stack 2018-07-24 05:21:07 -07:00
wordsize-32 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
wordsize-64 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
x86 Add <bits/indirect-return.h> 2018-07-24 07:55:47 -07:00
x86_64 x86-64: Add endbr64 to tst-quadmod[12].S 2018-07-24 05:12:14 -07:00