The gold linker veneers are written between functions without symbols,
so we to handle it specially in BOLT.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Paths
| Differential D128082
[BOLT][AArch64] Handle gold linker veneers ClosedPublic Authored by yota9 on Jun 17 2022, 11:47 AM.
Details Summary The gold linker veneers are written between functions without symbols, Vladislav Khmelevsky,
Diff Detail
Event Timeline
Comment Actions Uncomment __builtin_unreachable() branch handling. yota9 retitled this revision from [BOLT][AArch64][RFC] Handle gold linker veneers to [BOLT][AArch64] Handle gold linker veneers.Jun 18 2022, 11:43 AM
yota9 added inline comments.
yota9 added inline comments.
This revision is now accepted and ready to land.Jun 27 2022, 3:22 PM Closed by commit rG425dda76e9fa: [BOLT][AArch64] Handle gold linker veneers (authored by yota9). · Explain WhyJun 28 2022, 6:20 AM This revision was automatically updated to reflect the committed changes. rafauler added a reverting change: rGfc2d96c334a1: Revert "[BOLT][AArch64] Handle gold linker veneers".Jun 28 2022, 7:25 PM Comment Actions Hi @yota9, I reverted this commit because it is causing BOLT to crash in one of your internal binaries, let me work a bit more on it to understand what is happening before you land it again. Thanks! Comment Actions The cause of the crash caused by this diff is because this diff moves processing of interprocedural references outside the disassembly loop. In the disassembly loop, we don't call "process interprocedural references" on every function. For non simple functions, we bail out early. With this diff, we process all interprocedural references, even the ones coming from non-simple/ignored functions. We happen to have an internal binary with a non-simple function that has a very weird interprocedural reference that, when processed, causes BOLT to crash (it's an invalid address that can't be mapped to any function).
Comment Actions I think that works. Feel free to reopen or create a new review, whichever is easier. CI runs: -reorder-blocks=cache -use-gnu-stack -jump-tables=move Comment Actions @rafauler Already :) https://reviews.llvm.org/D129260
Revision Contents
Diff 440587 bolt/include/bolt/Core/BinaryContext.h
bolt/include/bolt/Core/BinaryFunction.h
bolt/include/bolt/Core/MCPlusBuilder.h
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Core/BinaryFunction.cpp
bolt/lib/Passes/BinaryPasses.cpp
bolt/lib/Passes/VeneerElimination.cpp
bolt/lib/Rewrite/BinaryPassManager.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
bolt/test/AArch64/veneer-gold.s
bolt/test/AArch64/veneer.s
|
The list seems to be more suitable, then previously used set. Since we have to handle references one by one the insertion is faster here. But more important the newely-handled trampolines will create new references, that must be added to the end of the list while iterating it.