https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97166
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Alan Modra <amo...@gcc.gnu.org>: https://gcc.gnu.org/g:71c83e108de7b54f604eeebefbc9e97672310ca7 commit r10-8795-g71c83e108de7b54f604eeebefbc9e97672310ca7 Author: Alan Modra <amo...@gmail.com> Date: Fri Sep 18 23:21:05 2020 +0930 [RS6000] Power10 libffi fixes Power10 pc-relative code doesn't use or preserve r2 as a TOC pointer. That means calling between pc-relative and TOC using code can't be done without intervening linker stubs, and a call from TOC code to pc-relative code must have a nop after the bl in order to restore r2. Now the PowerPC libffi assembly code doesn't use r2 except for the implicit use when making calls back to C, ffi_closure_helper_LINUX64 and ffi_prep_args64. So changing the assembly to interoperate with pc-relative code without stubs is easily done. PR target/97166 * src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global entry when __PCREL__. Call using @notoc. Add nops. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. (ffi_go_closure_linux64): Likewise. (cherry picked from commit 08cd8d5929eac84b27788d8483fd75ab7ad13129) (cherry picked from commit fff56af6421a1a3e357bcaad99f2ea084d72a7a8)