[PATCH] D69997: [llvm-objdump] Print relocation addends in hexadecimal

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 04:01:24 PST 2019


jhenderson added a comment.

In D69997#1738513 <https://reviews.llvm.org/D69997#1738513>, @davidb wrote:

> So I'd like to update the diff where only zero pad in the case of `-r`.


Sounds reasonable to me.



================
Comment at: llvm/tools/llvm-objdump/ELFDump.cpp:113
+      if (Addend < 0)
+        Addend = -Addend;
+
----------------
davidb wrote:
> jhenderson wrote:
> > Won't this fail for minimum int64_t?
> Yes. Is there a better abs implementation or function in LLVM that works around this case?
I'm not aware of one, unfortunately, but do you need it?

My reading of the code is that format(AddendFmt, Addend) combined with the PRIx64 (which uses a signed integer type) you used above should be sufficient.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69997/new/

https://reviews.llvm.org/D69997





More information about the llvm-commits mailing list