Page MenuHomeFreeBSD

powerpc64: Use medium code model in asm files for TOC references
ClosedPublic

Authored by jhibbits on Mar 26 2019, 3:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 17, 5:51 AM
Unknown Object (File)
Mon, Jun 17, 5:51 AM
Unknown Object (File)
Mon, Jun 17, 5:51 AM
Unknown Object (File)
Mon, Jun 17, 3:38 AM
Unknown Object (File)
Mon, Jun 17, 3:05 AM
Unknown Object (File)
Fri, Jun 14, 9:08 AM
Unknown Object (File)
Apr 16 2024, 9:49 PM
Unknown Object (File)
Apr 16 2024, 9:49 PM
Subscribers

Details

Summary

With a sufficiently large TOC, it's possible to index out of range, as
the immediate load instructions only permit 16-bit indices, allowing up
to 64kB range (signed) from the base pointer. Allow +/- 2GB range, with
the medium code model TOC accesses in asm.

Patch originally by Brandon Bergren. The issue appears to impact ELFv2
more than ELFv1.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23300
Build 22331: arc lint + arc unit

Event Timeline

LGTM.
I see this is basically a subset of D19352, with the exception of booke/locore.S, right?
BTW, I need to come back to D19352 and refactor it.

This revision is now accepted and ready to land.Mar 26 2019, 2:00 PM

Correct. It didn't logically belong with D19352, and probably other chunks of D19352 can be broken out, too, into more consumable pieces. The booke part I added for completness/consistency sake.

Looks good here. It has the bugs fixed that I had in the original. +1

This revision was automatically updated to reflect the committed changes.