[all-commits] [llvm/llvm-project] 40d5c2: [clang][AArch64] Add a -mbranch-protection option ...

John Brawn via All-commits all-commits at lists.llvm.org
Thu Jan 11 04:53:37 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40d5c2bcd41a534e6bab98fedf1a930d9bd165e7
      https://github.com/llvm/llvm-project/commit/40d5c2bcd41a534e6bab98fedf1a930d9bd165e7
  Author: John Brawn <john.brawn at arm.com>
  Date:   2024-01-11 (Thu, 11 Jan 2024)

  Changed paths:
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Basic/TargetInfo.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/Targets/AArch64.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/CodeGen/aarch64-branch-protection-attr.c
    M clang/test/CodeGen/aarch64-targetattr.c
    M clang/test/Driver/aarch64-security-options.c
    M clang/test/Preprocessor/aarch64-target-features.c
    M llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/TargetParser/ARMTargetParserCommon.cpp
    A llvm/test/CodeGen/AArch64/note-gnu-property-gcs.ll

  Log Message:
  -----------
  [clang][AArch64] Add a -mbranch-protection option to enable GCS (#75486)

-mbranch-protection=gcs (enabled by -mbranch-protection=standard) causes
generated objects to be marked with the gcs feature. This is done via
the guarded-control-stack module flag, in a similar way to
branch-target-enforcement and sign-return-address.

Enabling GCS causes the GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit to be set
on generated objects. No code generation changes are required, as GCS
just requires that functions are called using BL and returned from using
RET (or other similar variant instructions), which is already the case.




More information about the All-commits mailing list