This is https://bugs.llvm.org/show_bug.cgi?id=44257.
In LLVM style we always print 0 as addend when dumping
SHT_REL relocations. It is confusing, this patch stops
printing it as the first comment on the bug page suggests.
Paths
| Differential D93033
[llvm-readobj] - For SHT_REL relocations, don't display an addend. ClosedPublic Authored by grimar on Dec 10 2020, 6:59 AM.
Details Summary This is https://bugs.llvm.org/show_bug.cgi?id=44257. In LLVM style we always print 0 as addend when dumping
Diff Detail Event TimelineComment Actions Thanks, this is a lot less confusing that printing 0. Ideally, we'd read the REL addend from the offset, but that's obviously a lot more effort. My only concern about removing the 0x0 from the CHECK lines is that these tests will still pass if we do add support for reading REL addends. I see that many of the tests now contain {{$}}, maybe add this for all of them? Comment Actions
I've updated those that are related to llvm-readobj (i.e. tests from test/tools/llvm-readobj). I haven't updated others because they are not testing llvm-readobj output or relocation addend values (they were always 0x0 previously, Comment Actions Seems reasonable to me. I guess in some of the existing tests, they should be checking the addend in the relocated data, but if they don't already, we aren't making the situation worse. LGTM, with nits.
This revision is now accepted and ready to land.Dec 11 2020, 6:31 AM Comment Actions Looks great! I agree that {{$}} outside of test/tools/llvm-readobj may be too excessive. Comment Actions
I only skimmed the testsuite changes and didn't notice that this was deliberate based on the folder. Adding {{$}} it in test/tools/llvm-readobj only makes sense to me. This revision was landed with ongoing or failed builds.Dec 14 2020, 1:03 AM Closed by commit rG98a4289810ba: [llvm-readobj] - For SHT_REL relocations, don't display an addend. (authored by grimar). · Explain Why This revision was automatically updated to reflect the committed changes. grimar marked 2 inline comments as done.
Revision Contents
Diff 310878 lld/test/ELF/arm-abs32-dyn.s
lld/test/ELF/arm-copy.s
lld/test/ELF/arm-gnu-ifunc-plt.s
lld/test/ELF/arm-got-relative.s
lld/test/ELF/arm-plt-reloc.s
lld/test/ELF/arm-target1.s
lld/test/ELF/arm-thumb-plt-reloc.s
lld/test/ELF/arm-tls-ldm32.s
lld/test/ELF/dynamic-got.s
lld/test/ELF/gnu-ifunc-plt-i386.s
lld/test/ELF/i386-got-value.s
lld/test/ELF/i386-plt.s
lld/test/ELF/i386-relative.s
lld/test/ELF/i386-tls-dynamic.s
lld/test/ELF/i386-tls-gdiele.s
lld/test/ELF/i386-tls-ie-local.s
lld/test/ELF/i386-tls-ie-shared.s
lld/test/ELF/i386-tls-le.s
lld/test/ELF/i386-tls-opt-iele-nopic.s
lld/test/ELF/i386-zrel-zrela.s
lld/test/ELF/mips-26.s
lld/test/ELF/mips-eh_frame-pic.s
lld/test/ELF/mips-lo16-not-relative.s
lld/test/ELF/mips-mgot.s
lld/test/ELF/mips-plt-copy.s
lld/test/ELF/mips-tls-64.s
lld/test/ELF/mips64-eh-abs-reloc.s
lld/test/ELF/pack-dyn-relocs-arm2.s
lld/test/ELF/pack-dyn-relocs-relr-loop.s
lld/test/ELF/pack-dyn-relocs.s
lld/test/ELF/rel-addend-with-rela-input.s
lld/test/ELF/relocatable-section-symbol.s
lld/test/ELF/relocation-copy-i686.s
lld/test/ELF/relocation-none-arm.s
lld/test/ELF/relocation-none-i386.s
lld/test/ELF/x86-64-zrel-zrela.s
llvm/test/CodeGen/AMDGPU/amdgpu-reloc-const.ll
llvm/test/CodeGen/AMDGPU/lds-relocs.ll
llvm/test/CodeGen/AMDGPU/no-initializer-constant-addrspace.ll
llvm/test/CodeGen/AMDGPU/r600-constant-array-fixup.ll
llvm/test/CodeGen/AMDGPU/scratch-simple.ll
llvm/test/MC/AMDGPU/elf-lds.s
llvm/test/MC/AMDGPU/reloc.s
llvm/test/MC/ARM/arm-elf-relocations.s
llvm/test/MC/ARM/arm-elf-symver.s
llvm/test/MC/ARM/arm-thumb-tail-call.ll
llvm/test/MC/ARM/directive-tlsdescseq.s
llvm/test/MC/ARM/eh-compact-pr0.s
llvm/test/MC/ARM/eh-compact-pr1.s
llvm/test/MC/ARM/eh-directive-cantunwind.s
llvm/test/MC/ARM/eh-directive-handlerdata.s
llvm/test/MC/ARM/eh-directive-personality.s
llvm/test/MC/ARM/eh-directive-personalityindex.s
llvm/test/MC/ARM/eh-directive-section-multiple-func.s
llvm/test/MC/ARM/eh-directive-section.s
llvm/test/MC/ARM/eh-directive-text-section-multiple-func.s
llvm/test/MC/ARM/eh-directive-text-section.s
llvm/test/MC/ARM/elf-reloc-condcall.s
llvm/test/MC/ARM/elf-thumbfunc-reloc.s
llvm/test/MC/ARM/elf-thumbfunc-reloc2.s
llvm/test/MC/ARM/mixed-arm-thumb-bl-fixup.ll
llvm/test/MC/ARM/reloc-directive.s
llvm/test/MC/ARM/target-expressions.s
llvm/test/MC/ARM/thumb-far-jump.s
llvm/test/MC/ARM/thumb-movwt-reloc.s
llvm/test/MC/ARM/thumb1-branch-reloc.s
llvm/test/MC/ARM/thumb2-beq-fixup.s
llvm/test/MC/ELF/discriminator.s
llvm/test/MC/ELF/gen-dwarf.s
llvm/test/MC/ELF/relocation-386.s
llvm/test/MC/Mips/micromips-func-addr.s
llvm/test/MC/Mips/micromips32r6/relocations.s
llvm/test/MC/Mips/mips-data-directives.s
llvm/test/MC/Mips/mips-pdr.s
llvm/test/MC/Mips/mips32r6/relocations.s
llvm/test/MC/Mips/reloc-directive-label-offset.s
llvm/test/MC/Mips/reloc-directive.s
llvm/test/MC/X86/reloc-directive-elf-32.s
llvm/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml
llvm/test/Object/X86/yaml2obj-elf-x86-rel.yaml
llvm/test/Object/dyn-rel-relocation.test
llvm/test/Object/yaml2obj-elf-rel-noref.yaml
llvm/test/Object/yaml2obj-elf-rel.yaml
llvm/test/tools/llvm-objcopy/ELF/basic-relocations.test
llvm/test/tools/llvm-objcopy/ELF/localize-hidden.test
llvm/test/tools/llvm-objcopy/ELF/no-symbol-relocation.test
llvm/test/tools/llvm-objcopy/ELF/relocations-no-symtab.test
llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test
llvm/test/tools/llvm-readobj/ELF/dynamic-reloc.test
llvm/test/tools/llvm-readobj/ELF/reloc-addends.test
llvm/test/tools/llvm-readobj/ELF/relocation-errors.test
llvm/test/tools/llvm-readobj/ELF/relocations.test
llvm/test/tools/llvm-readobj/ELF/relr-relocs.test
llvm/test/tools/yaml2obj/ELF/relocation-implicit-symbol-index.yaml
llvm/tools/llvm-readobj/ELFDumper.cpp
|
Nit: no new line at EOF.