[PATCH] D148320: Improve ELFObjectWriter difference across sections diagnostic

René Rebe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 03:31:51 PDT 2023


rener created this revision.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
rener requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

While building Firefox with Rustc and LLVM 16 I came across some nw section difference mismatch issues. Without any context it was impossible to find out what the issue was, so let's add some context, like symbol and section for the developer to better understand what is going on.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148320

Files:
  llvm-16.0.1.src/lib/MC/ELFObjectWriter.cpp


Index: llvm-16.0.1.src/lib/MC/ELFObjectWriter.cpp
===================================================================
--- llvm-16.0.1.src/lib/MC/ELFObjectWriter.cpp
+++ llvm-16.0.1.src/lib/MC/ELFObjectWriter.cpp
@@ -1449,7 +1449,8 @@
     const MCSection &SecB = SymB.getSection();
     if (&SecB != &FixupSection) {
       Ctx.reportError(Fixup.getLoc(),
-                      "Cannot represent a difference across sections");
+		      Twine("symbol '") + SymB.getName() +
+                      "' can not represent a difference across sections: " + SecB.getName());
       return;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148320.513518.patch
Type: text/x-patch
Size: 594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230414/f04760cb/attachment.bin>


More information about the llvm-commits mailing list