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
Unknown Object (File)
Oct 4 2024, 10:49 PM
Unknown Object (File)
Oct 4 2024, 7:10 PM
Unknown Object (File)
Oct 4 2024, 4:13 PM
Unknown Object (File)
Oct 2 2024, 4:01 AM
Unknown Object (File)
Oct 2 2024, 12:27 AM
Unknown Object (File)
Sep 29 2024, 2:04 PM
Unknown Object (File)
Sep 28 2024, 5:43 PM
Unknown Object (File)
Sep 27 2024, 2:24 PM
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.