[PATCH] D128082: [BOLT][AArch64][RFC] Handle gold linker veneers

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 11:59:02 PDT 2022


yota9 added inline comments.


================
Comment at: bolt/include/bolt/Core/BinaryContext.h:639
+  /// and are referenced from BinaryFunction.
+  std::list<std::pair<BinaryFunction *, uint64_t>> InterproceduralReferences;
+
----------------
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. 


================
Comment at: bolt/lib/Core/BinaryContext.cpp:1128
+
+  bool Ret = false;
+  StringRef SectionContents = Section->getContents();
----------------
We might just create a BF here and call disassemble, but since we don't know veneer size it seems to be that a bit of code copy-paste is more proper solution here, what do you think?


================
Comment at: bolt/lib/Core/BinaryFunction.cpp:1284
           } else {
-            if (TargetAddress == getAddress() + getSize() &&
-                TargetAddress < getAddress() + getMaxSize()) {
-              // Result of __builtin_unreachable().
-              LLVM_DEBUG(dbgs() << "BOLT-DEBUG: jump past end detected at 0x"
-                                << Twine::utohexstr(AbsoluteInstrAddr)
-                                << " in function " << *this
-                                << " : replacing with nop.\n");
-              BC.MIB->createNoop(Instruction);
-              if (IsCondBranch) {
-                // Register branch offset for profile validation.
-                IgnoredBranches.emplace_back(Offset, Offset + Size);
-              }
-              goto add_instruction;
-            }
+            // if (TargetAddress == getAddress() + getSize() &&
+            //     TargetAddress < getAddress() + getMaxSize()) {
----------------
@maksfb I hope we could solve this problem, do you have ideas how to handle it properly? :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128082/new/

https://reviews.llvm.org/D128082



More information about the llvm-commits mailing list