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
F173196956: D59620.id186523.diff
Thu, Sep 24, 5:58 AM
F173189215: D59620.id186535.diff
Thu, Sep 24, 4:42 AM
F173187072: D59620.diff
Thu, Sep 24, 4:30 AM
F173163174: D59620.id.diff
Thu, Sep 24, 1:10 AM
F173155743: D59620.id186535.diff
Thu, Sep 24, 12:00 AM
Unknown Object (File)
Wed, Sep 23, 3:50 AM
Unknown Object (File)
Tue, Sep 22, 10:04 PM
Unknown Object (File)
Mon, Sep 21, 9:00 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?