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
F132488904: D21755.id62433.diff
Fri, Oct 17, 8:34 AM
F132488884: D21755.id.diff
Fri, Oct 17, 8:33 AM
F132488855: D21755.id62444.diff
Fri, Oct 17, 8:33 AM
F132437290: D21755.id62433.diff
Thu, Oct 16, 10:49 PM
F132437285: D21755.id62466.diff
Thu, Oct 16, 10:49 PM
F132397313: D21755.diff
Thu, Oct 16, 2:05 PM
Unknown Object (File)
Tue, Oct 14, 6:18 PM
Unknown Object (File)
Wed, Oct 8, 6:36 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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