On Thu, Sep 24, 2020 at 01:11:02PM +0930, Alan Modra wrote: > I've fixed the changelog, a comment, and added a nop after bl for the > old calls without @notoc. While there really isn't a need for the > nops in libffi.so since the callee is hidden visibility, there is a > miniscule chance that a static libffi.a user has a very large TOC and > somehow manages to have ffi_call_LINUX64 and ffi_prep_args64 using > different TOC pointers. In that case the linker would arrange the > call to go via a toc-adjusting stub and want to replace the nop with a > toc restore.
Adding those nops broke libffi, and I pushed the patch before bootstrap finished.. So this one committed as obvious to fix the breakage. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct location of .Lret. diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S index 3e30db36190..5663bb40223 100644 --- a/libffi/src/powerpc/linux64_closure.S +++ b/libffi/src/powerpc/linux64_closure.S @@ -159,15 +159,17 @@ ffi_closure_LINUX64: # if defined _CALL_LINUX || _CALL_ELF == 2 # ifdef __PCREL__ bl ffi_closure_helper_LINUX64@notoc +.Lret: # else bl ffi_closure_helper_LINUX64 +.Lret: nop # endif # else bl .ffi_closure_helper_LINUX64 +.Lret: nop # endif -.Lret: # now r3 contains the return type # so use it to look up in a table -- Alan Modra Australia Development Lab, IBM