Files
Stian Halseth a066c5d7d2 Mark swapcontext returns_twice by default [BZ #23130]
swapcontext does not restore every callee-saved register on all targets.
On sparc the %l and %i registers are not in the saved context at all:
they live in the register window save area of the calling frame, which
another pass through that frame can overwrite.  stdlib/tst-setcontext2
fails on sparc64 for this reason at -O2 with PIC, where gcc keeps
&global in %i5 across swapcontext and reuses %i5 as the GOT base on
another path through the same frame.

Mark swapcontext returns_twice in the generic bits/indirect-return.h, so
every target that does not override it is covered.  x86 and aarch64 keep
their own headers and are unchanged.

string/tst-xbzero-opt.c calls swapcontext from an always_inline
function, which a returns_twice callee forbids; key its guard on the
availability of indirect_return rather than on __CET__.  It is the only
such site in the tree.

Tested on sparc64: full make check is clean, with no test that passed
before failing after.

Signed-off-by: Stian Halseth <stian@itx.no>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2026-09-16 08:57:56 -03:00
..
1999-07-27 05:53:25 +00:00
1997-11-26 04:23:08 +00:00
1997-11-26 04:23:08 +00:00
1997-10-15 05:34:02 +00:00
1997-10-15 05:34:02 +00:00
1997-11-26 04:23:08 +00:00