[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 02:37:11 PST 2019


jhenderson added a comment.

Thanks for the patch. I'm surprised this hasn't broken any LLD tests. Did you run those too?

GNU objdump also pads with leading zeroes. As the general aim of the tools is to be more compatible, and whilst you're working on this bit, it would make sense to do the same.



================
Comment at: llvm/tools/llvm-objdump/ELFDump.cpp:110
+      const char *AddendFmt = "0x%" PRIx64;
+      char const *Sign = Addend < 0 ? "-" : "+";
 
----------------
`const char` rather than `char const` is LLVM style, I believe. (Does clang-format fix this?)


================
Comment at: llvm/tools/llvm-objdump/ELFDump.cpp:113
+      if (Addend < 0)
+        Addend = -Addend;
+
----------------
Won't this fail for minimum int64_t?


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