This is an archive of the discontinued LLVM Phabricator instance.

[JITLink] Honor shouldAddDefaultPasses in x86-64 ELF
AbandonedPublic

Authored by rafauler on Aug 25 2023, 4:26 PM.

Details

Reviewers
lhames
jobnoorman
Group Reviewers
Restricted Project
Summary

The x86-64 ELF backend still tries to add a single default
pass even if shouldAddDefaultPasses is set to false. This pass doesn't
help much as it depends on x86_64::GOTTableManager being initialized
by buildTables_ELF_x86_64, which never happens when
shouldAddDefaultPasses is false, but the pass still ends up
registering a _GLOBAL_OFFSET_TABLE_ definition that is not very
helpful. When a client asks default passes to not run, I think it
makes sense to treat _GLOBAL_OFFSET_TABLE_ as an external that needs
to be resolved by the client, which is the goal of this patch. This is
used for BOLT, a client that resolves all symbols by itself.

Diff Detail

Unit TestsFailed

Event Timeline

rafauler created this revision.Aug 25 2023, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 4:26 PM
rafauler requested review of this revision.Aug 25 2023, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 4:26 PM
rafauler edited the summary of this revision. (Show Details)Aug 25 2023, 4:28 PM

Hi @rafaelauler,

Sounds like a good idea to me, but we shouldn't need to add a new argument for it. I've modified the JITLinker base class to expose this info with a method in commit 265d6bda95b (with a follow-up in 35c9072c908 to fix a bug in the initial commit).

Please let me know if that works for you?

Will you be at the Dev Meeting? I'd love to chat some more about how bolt's using JITLink.

  • Lang.

Thanks a bunch @lhames , that works!

rafauler abandoned this revision.Aug 28 2023, 12:28 PM