Page MenuHomeFreeBSD

Move PLTs to the beginning of amd64 kmods.
ClosedPublic

Authored by markj on Tue, Sep 15, 6:47 PM.

Details

Summary

As with .text, the idea is to ensure that executable sections are
segregated from the rest. For some reason, firmware modules end up with
a 16-byte PLT. This wasn't the case before LLVM 11 I believe.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj requested review of this revision.Tue, Sep 15, 6:47 PM
markj created this revision.
markj edited the summary of this revision. (Show Details)Tue, Sep 15, 6:51 PM
markj added reviewers: kib, jhb.
kib added a comment.Tue, Sep 15, 7:04 PM

Can you show output from readelf -a for that files ? It is very strange to see plt in the result of incremental linking.

markj added a comment.Tue, Sep 15, 7:16 PM
In D26444#588245, @kib wrote:

Can you show output from readelf -a for that files ? It is very strange to see plt in the result of incremental linking.

Sure: https://reviews.freebsd.org/P424

This was linked with the patch applied.

kib accepted this revision.Tue, Sep 15, 7:38 PM

Hm, I see the same .plt section on stable/12 with clang 10.0.1 as well.

There are two PLT32 relocs, but creating plt for them is not the duty of ld -r. Anyway.

This revision is now accepted and ready to land.Tue, Sep 15, 7:38 PM
markj added a comment.Tue, Sep 15, 7:59 PM
In D26444#588281, @kib wrote:

Hm, I see the same .plt section on stable/12 with clang 10.0.1 as well.

Huh, I don't remember seeing this. Maybe I last checked when llvm was at version 9.

There are two PLT32 relocs, but creating plt for them is not the duty of ld -r. Anyway.

Indeed. In regular modules there are many PLT32 relocs but no .plt, and I don't see any differences in cc/ld flags.

This revision was automatically updated to reflect the committed changes.