This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Add mold-style PLT support
ClosedPublic

Authored by maksfb on Oct 24 2022, 6:35 PM.

Details

Summary

mold linker creates symbols for PLT entries and that caught BOLT by
surprise. Add the support for marked PLT entries.

Fixes: #58498

Diff Detail

Event Timeline

maksfb created this revision.Oct 24 2022, 6:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 6:35 PM
maksfb requested review of this revision.Oct 24 2022, 6:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 6:35 PM
yota9 accepted this revision.Oct 24 2022, 10:03 PM

LGTM thanks!

bolt/test/X86/plt-mold.test
7

May I ask why it is "printf$plt and not printf@PLT? Is there a typo?

This revision is now accepted and ready to land.Oct 24 2022, 10:03 PM
maksfb added inline comments.Oct 24 2022, 10:22 PM
bolt/test/X86/plt-mold.test
7

That’s the symbol mold creates at the moment. It also has local visibility.

yota9 added inline comments.Oct 24 2022, 11:30 PM
bolt/test/X86/plt-mold.test
7

Oh, it is part of the symbol name, interesting. I was thinking about the addend we add with @PLT. Thanks

This revision was automatically updated to reflect the committed changes.