[PATCH] D87985: fix bug when adrp_imm < 0

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 09:32:25 PDT 2020


MaskRay added subscribers: enderby, pete, lhames.
MaskRay added a comment.

Thanks for identifying the bug. `SymbolierSymbolLookup` is used as a parameter of `llvm::Target::createMCSymbolizer`. The information is very low level and duplicates the normal operand decoding logic by `lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp DecodeAdrInstruction`. The latter is used ubiquitously while the former (`SymbolierSymbolLookup`) is used in very few places and less tested. There are only 3 tests failing if I change the argument of `createMCSymbolizer` to nullptr:

  Failed Tests (3):                                                              
    LLVM :: CodeGen/ARM/local-call.ll                                            
    LLVM :: MC/ARM/aligned-blx.s                                                                                                            
    LLVM :: tools/llvm-objdump/MachO/ARM/symbolized-disassembly.test

The purpose of `SymbolierSymbolLookup` is to symbolize a branch address. However, for that purpose, we have another (more recent) symbolization in llvm-objdump.cpp: D77853 <https://reviews.llvm.org/D77853>.

I suggest we delete `SymbolierSymbolLookup` and add ARM symbolization like what I have done to x86/PPC/AArch64 (I don't know enough about ARM and don't have time to investigate it)
@enderby was the original author of MachODump.cpp but he has been inactive for a while. CC @lhames and @pete who may know who can pick up the work for ARM and fix the symbolization issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87985/new/

https://reviews.llvm.org/D87985



More information about the llvm-commits mailing list