[PATCH] D69097: [AArch64][MachineOutliner] Return address signing for outlined functions

David Tellenbach via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 15:02:05 PDT 2019


tellenbach added a comment.

@ostannard wow, good catch! Thanks for reverting this.

  $ clang --target=aarch64--none-eabi -c test2.c -o - -mllvm -stop-before=machine-outliner
  name:            bar
  body:             |
    bb.0.entry:
      $sp = frame-setup SUBXri $sp, 16, 0
      frame-setup CFI_INSTRUCTION def_cfa_offset <mcsymbol .Ltmp1>16
      $x8 = ADRP target-flags(aarch64-page) @v
      renamable $x8 = ADDXri $x8, target-flags(aarch64-pageoff, aarch64-nc) @v, 0
      $x9 = ADDXri $sp, 12, 0
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui renamable $x9, renamable $x8, 0 :: (volatile store 8 into @v)
      STRXui killed renamable $x9, killed renamable $x8, 0 :: (volatile store 8 into @v)
      $sp = frame-destroy ADDXri $sp, 16, 0
      RET undef $lr

Since CFI instructions don't get outlined things get messed up here. If possible I'd like to avoid to disable outlining for all functions that alter `sp`.  So I'll probably try to find matching `sp` changing instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69097





More information about the llvm-commits mailing list