Page MenuHomeFreeBSD

Move PLTs to the beginning of amd64 kmods.
ClosedPublic

Authored by markj on Sep 15 2020, 6:47 PM.
Tags
None
Referenced Files
F82567482: D26444.id77064.diff
Tue, Apr 30, 9:44 AM
F82567478: D26444.id.diff
Tue, Apr 30, 9:44 AM
F82567472: D26444.id77097.diff
Tue, Apr 30, 9:44 AM
F82555678: D26444.diff
Tue, Apr 30, 6:20 AM
Unknown Object (File)
Sat, Apr 20, 3:06 AM
Unknown Object (File)
Mar 7 2024, 9:42 AM
Unknown Object (File)
Feb 22 2024, 12:09 AM
Unknown Object (File)
Dec 20 2023, 5:22 AM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Sep 15 2020, 6:47 PM
markj created this revision.
markj added reviewers: kib, jhb.

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

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.

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.Sep 15 2020, 7:38 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.