[all-commits] [llvm/llvm-project] 66bcbd: [AArch64InstPrinter] Change printADRPLabel to prin...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Dec 16 09:21:15 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66bcbdbc9c584becff35f6795cd2836a7a0141b2
      https://github.com/llvm/llvm-project/commit/66bcbdbc9c584becff35f6795cd2836a7a0141b2
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M lld/test/COFF/arm64-delayimport.yaml
    M lld/test/COFF/arm64-import2.test
    M lld/test/COFF/arm64-relocs-imports.test
    M lld/test/COFF/arm64-thunks.s
    M lld/test/ELF/aarch64-condb-reloc.s
    M lld/test/ELF/aarch64-copy.s
    M lld/test/ELF/aarch64-cortex-a53-843419-address.s
    M lld/test/ELF/aarch64-cortex-a53-843419-large.s
    M lld/test/ELF/aarch64-cortex-a53-843419-recognize.s
    M lld/test/ELF/aarch64-cortex-a53-843419-thunk.s
    M lld/test/ELF/aarch64-feature-bti.s
    M lld/test/ELF/aarch64-feature-btipac.s
    M lld/test/ELF/aarch64-feature-pac.s
    M lld/test/ELF/aarch64-fpic-got.s
    M lld/test/ELF/aarch64-gnu-ifunc-address.s
    M lld/test/ELF/aarch64-gnu-ifunc-nonpreemptable.s
    M lld/test/ELF/aarch64-gnu-ifunc-plt.s
    M lld/test/ELF/aarch64-gnu-ifunc.s
    M lld/test/ELF/aarch64-gnu-ifunc2.s
    M lld/test/ELF/aarch64-hi21-nc.s
    M lld/test/ELF/aarch64-ifunc-bti.s
    M lld/test/ELF/aarch64-plt.s
    M lld/test/ELF/aarch64-relocs.s
    M lld/test/ELF/aarch64-thunk-pi.s
    M lld/test/ELF/aarch64-tls-gdie.s
    M lld/test/ELF/aarch64-tls-ie.s
    M lld/test/ELF/aarch64-tlsdesc.s
    M lld/test/ELF/aarch64-tstbr14-reloc.s
    M lld/test/ELF/aarch64-undefined-weak.s
    M llvm/lib/Target/AArch64/AArch64InstrFormats.td
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h
    M llvm/test/MC/AArch64/adr.s
    M llvm/test/MC/AArch64/coff-relocations.s
    M llvm/test/tools/llvm-objdump/ELF/AArch64/elf-aarch64-mapping-symbols.test
    A llvm/test/tools/llvm-objdump/ELF/AArch64/pcrel-address.yaml

  Log Message:
  -----------
  [AArch64InstPrinter] Change printADRPLabel to print the target address in hexadecimal form

Similar to D77853. Change ADRP to print the target address in hex, instead of the raw immediate.
The behavior is similar to GNU objdump but we also include `0x`.

Note: GNU objdump is not consistent whether or not to emit `0x` for different architectures. We try emitting 0x consistently for all targets.

```
GNU objdump:       adrp x16, 10000000
Old llvm-objdump:  adrp x16, #0
New llvm-objdump:  adrp x16, 0x10000000
```

`adrp Xd, 0x...` assembles to a relocation referencing `*ABS*+0x10000` which is not intended. We need to use a linker or use yaml2obj.
The main test is `test/tools/llvm-objdump/ELF/AArch64/pcrel-address.yaml`

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




More information about the All-commits mailing list