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

Luke Cheeseman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 04:14:32 PDT 2018


LukeCheeseman created this revision.
LukeCheeseman added reviewers: kcc, pcc, eugenis, vlad.tsyrklevich.
Herald added subscribers: llvm-commits, JDevlieghere, fedor.sergeev, kristof.beyls, aprantl, jyknight.
Herald added a reviewer: javed.absar.

Functions that have signed return addresses need additional dwarf support:

- After signing the LR, and before authenticating it, the LR register is in a state the is unusable by a debugger or unwinder
- To account for this a new directive, .cfi_negate_ra_state, is added
- This directive says the signed state of the LR register has now changed, i.e. unsigned -> signed or signed -> unsigned
- This directive has the same CFA code as the SPARC directive GNU_window_save (0x2d), adding a macro to account for multiply defined codes
- This patch matches the gcc implementation of this support: https://patchwork.ozlabs.org/patch/800271/


Repository:
  rL LLVM

https://reviews.llvm.org/D50136

Files:
  include/llvm/BinaryFormat/Dwarf.def
  include/llvm/BinaryFormat/Dwarf.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/MC/MCAsmStreamer.cpp
  lib/MC/MCDwarf.cpp
  lib/MC/MCParser/AsmParser.cpp
  lib/MC/MCStreamer.cpp
  lib/Target/AArch64/AArch64FrameLowering.cpp
  test/CodeGen/AArch64/sign-return-address-cfi-negate-ra-state.ll
  test/CodeGen/AArch64/sign-return-address.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50136.158493.patch
Type: text/x-patch
Size: 13339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180801/7e533892/attachment.bin>


More information about the llvm-commits mailing list