Re: [PATCH v3] libgcc: rs6000: fix TOC restore when unwinding on FreeBSD powerpc64 ELFv2 [PR target/125803]

Avinash Jayakar <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
Hi,

In the bug it was mentioned that this issue is present on 14,15 and
16. Does this need backports?

Regards,
Avinash Jayakar

On Wed, 2026-07-29 at 12:50 +0200, Gerald Pfeifer wrote:
> On Fri, 24 Jul 2026, Michael Meissner wrote:
> > > libgcc/ChangeLog:
> > > 
> > > 	PR target/125803
> > > 	* config/rs6000/freebsd-unwind.h (TOC_SAVE_SLOT): New
> > > macro,
> > > 	defined according to _CALL_ELF.
> > > 	(frob_update_context): Use TOC_SAVE_SLOT instead of the
> > > 	hard-coded ELFv1 offset 40 when checking for and
> > > locating the
> > > 	saved TOC, so that r2 is restored correctly under
> > > ELFv2.  Guard
> > > 	the ELFv1-only PLT stub and function pointer call
> > > sequences
> > > 	with _CALL_ELF != 2, mirroring linux-unwind.h.
> > I approve this to be applied to the master branch and back ported
> > to
> > GCC 16 if it is needed.  I assume you will fix any freebsd errors
> > that
> > come up to this patch if it is needed.
> 
> Thank you for the review, Michael.
> 
> Piotr, I pushed this to trunk for you.
> 
> Gerald
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.