https://sourceware.org/bugzilla/show_bug.cgi?id=26164
Alan Modra <amodra at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|NEW |RESOLVED --- Comment #1 from Alan Modra <amodra at gmail dot com> --- That would be correct linker behaviour, at least if you allow that the linker doesn't have special knowledge about __GI_exit never returning. __makecontext is assembly declared to use and preserve r2 (localentry:8), whereas with -mcpu=power10 posix/_exit.c is compiled to a function that is declared to not use *and not preserve* r2 (localentry:1). Faced with a call from a function that apparently needs to preserve r2 to a function that apparently does not, the linker tries to insert a stub that saves r2 with r2 being restored on return from the call. In this case there is no nop to replace with an insn to restore r2 (and "b" rather than "bl" is used) so the linker knows r2 can't be restored. Note that the linker decides whether the call should preserve r2 by the relocation on the call insn rather than the st_other localentry bits of __makecontext. So it seems to me that glibc ought to be using "b __GI_exit@notoc" to call _exit from makecontext when building for power10. -- You are receiving this mail because: You are on the CC list for the bug.