Flags of the module derived exclusively from the compiler flag `-mbranch-protection`. The note is generated based on the module flags accordingly. After this change in case of compile unit without function won't have the .note.gnu.property if the compiler flag is not present [1]. [1] https://bugs.llvm.org/show_bug.cgi?id=46480 Reviewed By: chill Differential Revision: https://reviews.llvm.org/D80791
26 lines
672 B
LLVM
26 lines
672 B
LLVM
; RUN: llc -mtriple=aarch64-linux %s -o - | \
|
|
; RUN: FileCheck %s --check-prefix=ASM
|
|
|
|
define dso_local i32 @f() #0 {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
|
|
define dso_local i32 @g() #1 {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
|
|
attributes #0 = { "branch-target-enforcement"="true" "sign-return-address"="non-leaf" }
|
|
|
|
attributes #1 = { "branch-target-enforcement"="true" }
|
|
|
|
!llvm.module.flags = !{!0, !1, !2, !3}
|
|
|
|
!0 = !{i32 1, !"branch-target-enforcement", i32 0}
|
|
!1 = !{i32 1, !"sign-return-address", i32 0}
|
|
!2 = !{i32 1, !"sign-return-address-all", i32 0}
|
|
!3 = !{i32 1, !"sign-return-address-with-bkey", i32 0}
|
|
|
|
; Note is not emited if module has no properties
|
|
; ASM-NOT: .note.gnu.property |