This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Fix issue related to missing symbol name
Needs ReviewPublic

Authored by nhuhuan on Aug 3 2022, 9:43 PM.

Details

Summary

Add symbol names that previously not recorded in BinaryFunction.
Test cases are updated accordingly.

Test Plan:

ninja check-bolt

Diff Detail

Event Timeline

nhuhuan created this revision.Aug 3 2022, 9:43 PM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: ayermolo. · View Herald Transcript
nhuhuan requested review of this revision.Aug 3 2022, 9:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 9:43 PM
nhuhuan updated this revision to Diff 449877.Aug 3 2022, 10:13 PM

Clang-formatted

Amir added inline comments.Aug 4 2022, 11:48 AM
bolt/include/bolt/Core/BinaryFunction.h
958

We need to avoid this breaking change.
Do we end up with way more alternative names than before for all symbols? Or does it only affect hand-written assembly tests, where main also gets the extra .text symbol? If it's the latter, we may avoid STT_SECTION symbols.

bolt/lib/Rewrite/RewriteInstance.cpp
1050–1052

Can you explain the effect of this condition? Did we skip certain ISyms without this check?

nhuhuan added inline comments.Aug 4 2022, 2:20 PM
bolt/lib/Rewrite/RewriteInstance.cpp
1050–1052

Yes we skipped some symbol names.
If symbol address points to an existing BF, update BF.Symbols
We have that update after, but since it was previously continue, that update is not executed.