[PATCH] D40962: [ELF] When a relocation is out of range print the value and the range

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 09:04:45 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Target.h:150
+  error(getErrorLocation(Loc) + "relocation " + lld::toString(Type) +
+        " out of range: requested value " + V + " is not in [" + Twine(Min) +
+        ", " + Twine(Max) + "]");
----------------
arichardson wrote:
> grimar wrote:
> > nit: I would shorten this:
> > relocation R_386_PC16 out of range: 65536 is not in [-65536, 65535]
> > It is the matter of taste though.
> Sounds good, I'll change if it to that if Rui also agrees.
Sounds good.


================
Comment at: ELF/Target.h:171
+    // message instead of an extremely large unsigned number
+    reportRangeError(Loc, Type, (int64_t)V < 0 ? Twine((int64_t)V) : Twine(V),
+                     llvm::minIntN(N), llvm::maxUIntN(N));
----------------
Why don't you just pass Twine((int64_t)V)?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40962





More information about the llvm-commits mailing list