[PATCH] D59095: [llvm-readelf]Don't lose negative-ness of negative addends for no symbol relocations

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 07:37:12 PST 2019


jhenderson created this revision.
jhenderson added reviewers: grimar, Higuoxing, mattd, MaskRay.
Herald added a subscriber: rupprecht.
Herald added a project: LLVM.

llvm-readelf prints relocation addends as "<symbol value>[+-]<absolute addend>" where [+-] is determined from whether addend is less than zero or not. However, it does not print the +/- if there is no symbol, which meant that negative addends became their positive value with no indication that this had happened. This patch stops the absolute conversion when addends are negative and there is no associated symbol.

Before:
`0000000000000008  0000000000000000 R_X86_64_NONE                     1`
With patch:
`0000000000000008  0000000000000000 R_X86_64_NONE                     ffffffffffffffff`


Repository:
  rL LLVM

https://reviews.llvm.org/D59095

Files:
  test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test
  tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59095.189717.patch
Type: text/x-patch
Size: 4009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190307/8139aefa/attachment.bin>


More information about the llvm-commits mailing list