Page MenuHomeFreeBSD

link_elf_obj: Process global ifunc relocs after other global relocs
ClosedPublic

Authored by markj on Nov 25 2021, 6:53 PM.

Details

Summary

This is needed to ensure that resolvers that reference global symbols
return correct results.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
R10 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.Nov 25 2021, 6:53 PM

This is definitely an improvement because before, global ifunc symbols were not resolved at all.

But ultimately, it does not matter if the symbol is global or not, ifuncs generally should be processed after other types of relocations, global or local.

This revision is now accepted and ready to land.Nov 25 2021, 7:32 PM
In D33120#748480, @kib wrote:

This is definitely an improvement because before, global ifunc symbols were not resolved at all.

But ultimately, it does not matter if the symbol is global or not, ifuncs generally should be processed after other types of relocations, global or local.

In fact, this is now what happens in practice. We relocate local !ifunc symbol references first, then global (now separate passes for ifuncs), then local ifuncs. I'm not sure why it's split out that way. Perhaps we could at least combine the ifunc passes, but I would defer it to a separate patch.