[PATCH] D45911: [COFF] report file containing unsupported relocation

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 16:56:33 PDT 2018


inglorion created this revision.
inglorion added a reviewer: ruiu.

When reporting an unsupported relocation type, let's also report the
file we encountered it in to aid diagnosis.


https://reviews.llvm.org/D45911

Files:
  lld/COFF/Chunks.cpp


Index: lld/COFF/Chunks.cpp
===================================================================
--- lld/COFF/Chunks.cpp
+++ lld/COFF/Chunks.cpp
@@ -98,7 +98,8 @@
   case IMAGE_REL_AMD64_SECTION:  applySecIdx(Off, OS); break;
   case IMAGE_REL_AMD64_SECREL:   applySecRel(this, Off, OS, S); break;
   default:
-    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type) + " in " +
+          toString(File));
   }
 }
 
@@ -112,7 +113,8 @@
   case IMAGE_REL_I386_SECTION:  applySecIdx(Off, OS); break;
   case IMAGE_REL_I386_SECREL:   applySecRel(this, Off, OS, S); break;
   default:
-    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type) + " in " +
+          toString(File));
   }
 }
 
@@ -174,7 +176,8 @@
   case IMAGE_REL_ARM_SECTION:   applySecIdx(Off, OS); break;
   case IMAGE_REL_ARM_SECREL:    applySecRel(this, Off, OS, S); break;
   default:
-    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type) + " in " +
+          toString(File));
   }
 }
 
@@ -262,7 +265,8 @@
   case IMAGE_REL_ARM64_SECREL_HIGH12A: applySecRelHigh12A(this, Off, OS, S); break;
   case IMAGE_REL_ARM64_SECREL_LOW12L:  applySecRelLdr(this, Off, OS, S); break;
   default:
-    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type) + " in " +
+          toString(File));
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45911.143413.patch
Type: text/x-patch
Size: 1592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180420/e12a2fd9/attachment.bin>


More information about the llvm-commits mailing list