Page MenuHomeFreeBSD

Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations.
ClosedPublic

Authored by markj on Sep 22 2019, 7:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 24, 6:58 AM
Unknown Object (File)
Thu, Nov 28, 12:56 PM
Unknown Object (File)
Nov 17 2024, 6:49 PM
Unknown Object (File)
Nov 17 2024, 1:43 PM
Unknown Object (File)
Nov 11 2024, 2:02 AM
Unknown Object (File)
Nov 10 2024, 2:18 PM
Unknown Object (File)
Oct 22 2024, 1:54 PM
Unknown Object (File)
Sep 20 2024, 11:54 PM
Subscribers

Details

Summary

This is necessary for accesses to DPCPU and VNET data variables in
PIC KLDs. This should have no functional impact for non-PIC KLDs since
such code shouldn't contain R_X86_64_RELATIVE relocations.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26631
Build 25007: arc lint + arc unit

Event Timeline

How hard would be assert that lf is a dso, as opposed to an object file ?

In D21755#474725, @kib wrote:

How hard would be assert that lf is a dso, as opposed to an object file ?

It would be a bit of work: there is no field in the base linker_file which tells you the type of the file. It is of course trivial to add one though, so perhaps I should just do that and add the assert to elf_relocaddr().

Add an assertion to elf_relocaddr(). This is a bit hacky but
hacky in the same way as linker_add_class().

This revision is now accepted and ready to land.Sep 22 2019, 9:07 PM