From 3c44f5bec91dd4e8b7e1c011ec0a5f77c93c2f28 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 18 Nov 2008 22:10:53 +0000 Subject: [PATCH] Documentation for the llvm.stackprotector intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59557 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 87 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 17 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 221cc492ebb..553568007f2 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -214,23 +214,28 @@
  • 'llvm.init.trampoline' Intrinsic
  • -
  • Atomic intrinsics -
      -
    1. llvm.memory_barrier
    2. -
    3. llvm.atomic.cmp.swap
    4. -
    5. llvm.atomic.swap
    6. -
    7. llvm.atomic.load.add
    8. -
    9. llvm.atomic.load.sub
    10. -
    11. llvm.atomic.load.and
    12. -
    13. llvm.atomic.load.nand
    14. -
    15. llvm.atomic.load.or
    16. -
    17. llvm.atomic.load.xor
    18. -
    19. llvm.atomic.load.max
    20. -
    21. llvm.atomic.load.min
    22. -
    23. llvm.atomic.load.umax
    24. -
    25. llvm.atomic.load.umin
    26. -
    -
  • +
  • Stack Protector Intrinsic +
      +
    1. 'llvm.stackprotector' Intrinsic
    2. +
    +
  • +
  • Atomic intrinsics +
      +
    1. llvm.memory_barrier
    2. +
    3. llvm.atomic.cmp.swap
    4. +
    5. llvm.atomic.swap
    6. +
    7. llvm.atomic.load.add
    8. +
    9. llvm.atomic.load.sub
    10. +
    11. llvm.atomic.load.and
    12. +
    13. llvm.atomic.load.nand
    14. +
    15. llvm.atomic.load.or
    16. +
    17. llvm.atomic.load.xor
    18. +
    19. llvm.atomic.load.max
    20. +
    21. llvm.atomic.load.min
    22. +
    23. llvm.atomic.load.umax
    24. +
    25. llvm.atomic.load.umin
    26. +
    +
  • General intrinsics
    1. @@ -5802,6 +5807,54 @@ declare i8* @llvm.init.trampoline(i8* <tramp>, i8* <func>, i8* <n

      + +
      + +
      +

      + This intrinsic is used when stack protectors are required. LLVM generates a + call to load the randomized stack protector guard's value. The intrinsic is + used so that LLVM can ensure that the stack guard is placed onto the stack in + the appropriate place—before local variables are allocated on the stack. +

      +
      + + + +
      +
      Syntax:
      +
      +declare void @llvm.stackprotector( i8* <guard>, i8** <slot> )
      +
      +
      +
      Overview:
      +

      + The llvm.stackprotector intrinsic takes the guard and stores + it onto the stack at slot. The stack slot is adjusted to ensure that + it's before local variables are allocated on the stack. +

      +
      Arguments:
      +

      + The llvm.stackprotector intrinsic requires two pointer arguments. The + first argument is the value loaded from the stack guard + @__stack_chk_guard. The second variable is an alloca that + has enough space to hold the value of the guard. +

      +
      Semantics:
      +

      + This intrinsic causes the prologue/epilogue inserter to force the position of + the AllocaInst stack slot to be before local variables on the + stack. This is to ensure that if a local variable on the stack is overwritten, + it will destroy the value of the guard. When the function exits, the guard on + the stack is checked against the original guard. If they're different, then + the program aborts by calling the __stack_chk_fail() function. +

      +
      +