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
F171860442: D59620.diff
Mon, Sep 14, 3:51 AM
F171840203: D59620.diff
Sun, Sep 13, 11:30 PM
F171835104: D59620.id186535.diff
Sun, Sep 13, 10:24 PM
Unknown Object (File)
Sat, Sep 12, 11:06 PM
Unknown Object (File)
Sat, Sep 12, 4:17 PM
Unknown Object (File)
Sat, Sep 12, 4:05 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?