[all-commits] [llvm/llvm-project] 4e958b: [llvm-objdump] Avoid using mapping symbols as bran...

chbessonova via All-commits all-commits at lists.llvm.org
Tue Dec 6 02:19:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e958b4d7cd3629d7a21ceea0ea5c4aa1c19e4c0
      https://github.com/llvm/llvm-project/commit/4e958b4d7cd3629d7a21ceea0ea5c4aa1c19e4c0
  Author: Kristina Bessonova <kbessonova at accesssoftek.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M lld/test/ELF/aarch64-range-thunk-extension-plt32.s
    M llvm/test/CodeGen/AArch64/callbr-asm-obj-file.ll
    M llvm/test/MC/ARM/branch-disassemble.s
    M llvm/test/MC/Disassembler/ARM/mve-lol.txt
    M llvm/tools/llvm-objdump/llvm-objdump.cpp

  Log Message:
  -----------
  [llvm-objdump] Avoid using mapping symbols as branch target labels

The main motivation for this change is to avoid ambiguity because
mapping symbol names may not be unique across a binary and do not allow uniquely
identifying target address. So that mapping symbols used as branch target
labels make llvm-objdump output less readable.

Another point is that mapping symbols sometimes appear in
non-allocatable sections, like debug info sections which make objdump
output even more confusing.

For example, a small AArch64 executable may contain plenty of `$d[.*]`
symbols and none of them would be useful as a label for resolving
a branch or a memory operand target address:

```
  0000000000000254 l       .note.ABI-tag	0000000000000000 $d
  00000000000008d4 l       .eh_frame            0000000000000000 $d
  0000000000000868 l       .rodata              0000000000000000 $d
  0000000000011028 l       .data                0000000000000000 $d
  0000000000010db8 l       .fini_array          0000000000000000 $d
  0000000000010db0 l       .init_array          0000000000000000 $d
  00000000000008e8 l       .eh_frame            0000000000000000 $d
  0000000000011034 l       .bss                 0000000000000000 $d
```

Note that GNU objdump doesn't use mapping symbols as branch target
labels for all targets that support such symbols (ARM, AArch64, CSKY).

Differential Revision: https://reviews.llvm.org/D139131




More information about the All-commits mailing list