[all-commits] [llvm/llvm-project] ae18b9: [PAC] Implement function pointer type discriminati...

Akira Hatanaka via All-commits all-commits at lists.llvm.org
Thu Jul 11 09:09:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae18b9410297963a379e03b94eae7433ff69a62b
      https://github.com/llvm/llvm-project/commit/ae18b9410297963a379e03b94eae7433ff69a62b
  Author: Akira Hatanaka <ahatanak at gmail.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/Basic/Features.def
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/CodeGen/CodeGenABITypes.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/CodeGen/CGExprConstant.cpp
    M clang/lib/CodeGen/CGPointerAuth.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/CodeGen/ConstantEmitter.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/CodeGen/ptrauth-function-type-discriminator.c
    M clang/test/Preprocessor/ptrauth_feature.c

  Log Message:
  -----------
  [PAC] Implement function pointer type discrimination (#96992)

Give users an option (-fptrauth-function-pointer-type-discrimination) to
sign a function pointer using a non-zero discriminator based on the
function type.

The discriminator is computed by first translating the function type to
a string and then computing the hash value of the string. Two function
types that are compatible in C must be translated to the same string
with the exception of function types that use typedefs of anonymous
structs in their return type or parameter types.

This patch doesn't have the code to resign function pointers, which is
needed when a function pointer is converted to a different function
type. That will be implemented in another patch.

Co-authored-by: John McCall <rjmccall at apple.com>

---------

Co-authored-by: John McCall <rjmccall at apple.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list