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

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 01:28:57 PST 2017


arichardson added inline comments.


================
Comment at: ELF/Target.h:147
 
+static inline void relocationRangeError(uint8_t *Loc, RelType Type,
+                                        const Twine &V, int64_t Min,
----------------
ruiu wrote:
> In general a function name should be a verb, so how about reportRangeError?
Good suggestion, done.


================
Comment at: ELF/Target.h:151-152
+  error(getErrorLocation(Loc) + "relocation " + lld::toString(Type) +
+        " out of range: requested value " + V + " is not in [" + Twine(Min) +
+        "," + Twine(Max) + "]");
+}
----------------
ruiu wrote:
> I think the range is half-open, so you should use [) instead of [].
> 
> Please add a space character after the comma.
Actually `maxInt()` returns the highest possible value so the range is inclusive.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40962





More information about the llvm-commits mailing list