[PATCH] D50136: [AArch64] - Return address signing dwarf support

Luke Cheeseman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 7 02:47:25 PDT 2018


LukeCheeseman updated this revision to Diff 164376.
LukeCheeseman added a comment.

- Add MIR support (lexing, parsing and printing) for CFI negate_ra_sign_state
- Added MIR tests
- Added patch to print the correct CFI name given the target architecture of the object file being dumper:
  - This solution isn't pretty, the issue is that the dumping doesn't have any notion of context. I attempted to create a DwarfDumper class with vendor specific subclasses but this ended up needing significant plumbing and rework to many, far reaching places, in the LLVM code base.
  - I've opted here to pass through only the information that is required to make the dumping decision, in this case the architecture. The DW_CFA_DUP macro now takes a predicate that can be defined for selecting the vendor specific extension
  - An alternative to this is to just accept that the output is incorrect, this doesn't look to have any issues beyond printing the wrong string. Notably it is not an issue for target specific parsing/printing, only when dumping a file via llvm-dwarfdump. Even if overlapping encodings behaved differently (e.g. differing numbers of operands) the dumping would not be any more incorrect that just printing the wrong name. Whilst not a motivating point, it should be highlighted that this is the way that GNU tools handle overlapping encodings, i.e. the encoding not defined as a DUP is used.
  - I've extend a test to check for the correct string be printed


https://reviews.llvm.org/D50136

Files:
  include/llvm/BinaryFormat/Dwarf.def
  include/llvm/BinaryFormat/Dwarf.h
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
  include/llvm/MC/MCDwarf.h
  include/llvm/MC/MCStreamer.h
  lib/BinaryFormat/Dwarf.cpp
  lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
  lib/CodeGen/CFIInstrInserter.cpp
  lib/CodeGen/MIRParser/MILexer.cpp
  lib/CodeGen/MIRParser/MILexer.h
  lib/CodeGen/MIRParser/MIParser.cpp
  lib/CodeGen/MachineOperand.cpp
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCDwarf.cpp
  lib/MC/MCStreamer.cpp
  lib/Target/AArch64/AArch64FrameLowering.cpp
  lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  test/CodeGen/AArch64/sign-return-address-cfi-negate-ra-state.ll
  test/CodeGen/AArch64/sign-return-address.ll
  test/CodeGen/MIR/AArch64/cfi.mir
  test/CodeGen/MIR/AArch64/return-address-signing.mir
  tools/llvm-dwarfdump/llvm-dwarfdump.cpp
  tools/llvm-readobj/DwarfCFIEHPrinter.h
  tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50136.164376.patch
Type: text/x-patch
Size: 42585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180907/462cddeb/attachment-0001.bin>


More information about the llvm-commits mailing list