Page MenuHomeFreeBSD

ldscript.powerpc*: Keep .data.rel.ro out of PT_DYNAMIC
AcceptedPublic

Authored by mchoo on Sat, Sep 12, 1:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 17, 4:53 PM
Unknown Object (File)
Thu, Sep 17, 1:01 PM
Unknown Object (File)
Wed, Sep 16, 5:09 PM
Unknown Object (File)
Wed, Sep 16, 4:32 AM
Unknown Object (File)
Wed, Sep 16, 1:47 AM
Unknown Object (File)
Wed, Sep 16, 1:42 AM
Unknown Object (File)
Wed, Sep 16, 1:35 AM
Unknown Object (File)
Tue, Sep 15, 7:21 PM
Subscribers

Details

Reviewers
jhibbits
adrian
jrtc27
jhb
Group Reviewers
PowerPC
Summary

When .got2 is empty, the orphan .data.rel.ro output section follows
.dynamic and inherits both its :kernel and :dynamic program-header
assignments. This makes PT_DYNAMIC cover .data.rel.ro as well as the
actual dynamic table. On powerpc64le, its resulting size may not even
be a multiple of Elf64_Dyn.

Describe .data.rel.ro explicitly and assign it only to :kernel,
terminating :dynamic inheritance on powerpc, powerpc64, and powerpc64le.

MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation, Reliable Computer Systems Lab

Test Plan

readelf -l shows that .data.rel.ro does not appear in 01 (Dynamic) segment after this patch.
ppc64{be,le} boots. Not tested on ppc32.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 76807
Build 73690: arc lint + arc unit

Event Timeline

mchoo requested review of this revision.Sat, Sep 12, 1:55 PM

Would you mind adding a comment explaining this above the section name so we don't forget why ?

also just to be clear - did you boot test this on something? :-P :-)

also just to be clear - did you boot test this on something? :-P :-)

Tested on ppc64{be,le} on IBM LC Power 9. I didn't test on ppc32 although I'm pretty sure it will pass.

I'm ok with it, let's wait for @jhibbits to chime in too.

This revision is now accepted and ready to land.Sun, Sep 13, 6:18 PM

ping @jhb for mentor approval

edit: Do I need another mentor approval for MFC?