[PATCH] D152748: [BOLT] Check dynamic relocations in analyzeJumpTable

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 13:30:28 PDT 2023


Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

perf2bolt-multiple-edge.test has jump table entries with associated dynamic
relocations. Check their presence in `analyzeJumpTable`. Not sure how to
reproduce with assembly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152748

Files:
  bolt/lib/Core/BinaryContext.cpp


Index: bolt/lib/Core/BinaryContext.cpp
===================================================================
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -541,7 +541,8 @@
             dbgs() << "FAIL: JTT_PIC table, no relocation for this address\n");
         break;
       }
-      if (Type == JumpTable::JTT_NORMAL && !getRelocationAt(EntryAddress)) {
+      if (Type == JumpTable::JTT_NORMAL && !getRelocationAt(EntryAddress) &&
+          !getDynamicRelocationAt(EntryAddress)) {
         LLVM_DEBUG(
             dbgs()
             << "FAIL: JTT_NORMAL table, no relocation for this address\n");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152748.530654.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230612/82adf9e4/attachment.bin>


More information about the llvm-commits mailing list