Page MenuHomeFreeBSD

rtld/powerpc: Fix _rtld_bind_start for powerpcspe
ClosedPublic

Authored by jhibbits on Nov 23 2019, 5:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 11 2024, 5:55 AM
Unknown Object (File)
Dec 11 2023, 9:41 PM
Unknown Object (File)
Nov 28 2023, 5:09 AM
Unknown Object (File)
Nov 26 2023, 12:39 AM
Unknown Object (File)
Nov 25 2023, 8:28 PM
Unknown Object (File)
Nov 25 2023, 4:57 AM
Unknown Object (File)
Nov 22 2023, 6:20 PM
Unknown Object (File)
Nov 22 2023, 6:20 PM
Subscribers

Details

Summary

We need to save off the full 64-bit register, not just the low 32 bits,
of all registers getting saved off in _rtld_bind_start. Additionally,
we need to save off the other SPE registers (SPEFSCR and accumulator),
so that their program state is not affected by the PLT resolver.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

libexec/rtld-elf/powerpc/rtld_start.S
114 ↗(On Diff #64766)

Comment is outdated now.

Maybe something like

/* stack space for r0, r3-r31 and nonvolatile SPRs + callee save area */

126 ↗(On Diff #64766)

same here. Probably don't need to duplicate the comment either since it's now obvious what it's doing.

libexec/rtld-elf/powerpc/rtld_start.S
110 ↗(On Diff #64766)

We're now allocating 20 bytes less stack than the original code in the !SPE case. Your math looks more correct to me though, so the original -160 must have been wrong.

jhibbits added inline comments.
libexec/rtld-elf/powerpc/rtld_start.S
110 ↗(On Diff #64766)

Yes, it was overkill, but not detrimental.

I just confirmed it still works on powerpc, nothing broke.

Attempts to theorize on reduction of scope of this have failed, apparently we do in fact need to be backing this much up when calling the resolver.

I think this is about as nice as we're gonna get it.

This revision is now accepted and ready to land.Nov 24 2019, 4:19 AM
This revision was automatically updated to reflect the committed changes.