The latest linker version started to report calls from functions that are expected to preserve r2 to functions that do not preserve r2, causing build failures in glibc, e.g.: sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S:163:(.text+0xfc): call to `__GI_exit' lacks nop, can't restore toc; (toc save/adjust stub) More details are available in Binutils bug #26164.
A patch to fix this has been proposed at: https://patchwork.sourceware.org/project/glibc/patch/20200625230224.301671-1-tuliom@linux.ibm.com/
Fixed in 2.32 with: commit 7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c Author: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> Date: Fri Jul 10 19:41:06 2020 -0300 powerpc64: Fix calls when r2 is not used [BZ #26173] Teach the linker that __mcount_internal, __sigjmp_save_symbol, __syscall_error and __GI_exit do not use r2, so that it does not need to recover r2 after the call. Test at configure time if the assembler supports @notoc and define USE_PPC64_NOTOC.