Page MenuHomePhabricator

[RuntimeDyld] Added support for relocation of indirect functions
Needs ReviewPublic

Authored by MoritzS on Jul 6 2021, 1:27 AM.

Details

Reviewers
lhames
Summary

In ELF, symbols of type STT_GNU_IFUNC need to be resolved by calling the
function at the symbol's address. This is implemented by adding special
stubs for all symbols of that type.

Diff Detail

Event Timeline

MoritzS created this revision.Jul 6 2021, 1:27 AM
MoritzS requested review of this revision.Jul 6 2021, 1:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 1:27 AM

This is really cool.

Does the Indirect flag really need to go onto JITSymbolFlags? My mental model of ifuncs (very limited -- I haven't used them myself) is "self-updating PLT" -- its ifunc-ness is opaque to callers right?

Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 5:38 PM
Herald added a subscriber: StephenFan. · View Herald Transcript

Does the Indirect flag really need to go onto JITSymbolFlags? My mental model of ifuncs (very limited -- I haven't used them myself) is "self-updating PLT" -- its ifunc-ness is opaque to callers right?

Yes, you are right, ifuncs are completely opaque to callers, so we probably shouldn't add that flag. I will change that.

MoritzS updated this revision to Diff 444936.Jul 15 2022, 3:55 AM

Removed Indirect from JITSymbolFlags

MoritzS updated this revision to Diff 445468.Jul 18 2022, 5:53 AM

Fixed typos in comments

MoritzS updated this revision to Diff 452152.Fri, Aug 12, 5:33 AM

Rebased onto main

MoritzS updated this revision to Diff 452188.Fri, Aug 12, 8:10 AM

Rebased again because of failing tests on main