#name: Check -z force-bti emits BTI PLT (shared)
#source: bti-plt-1.s
#target: [check_shared_lib_support]
-#as: -mabi=lp64
+#as: -mabi=lp64 -defsym __property_bti__=1
#ld: -shared -z force-bti -T bti-plt.ld
#objdump: -dr -j .plt
_start:
bl foo
bl bar
-.ifndef __guard_property_bti__
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x1 /* BTI. */
-4:
- .p2align 3
-5:
-.endif
-.ifdef __property_pac__
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x2 /* PAC. */
-4:
- .p2align 3
-5:
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
.endif
#source: bti-plt-1.s
#source: bti-plt-2.s
#target: [check_shared_lib_support]
-#as: -mabi=lp64
+#as: -mabi=lp64 -defsym __property_bti__=1
#ld: -shared -z force-bti -T bti-plt.ld
#readelf: -n
.text
- .globl _start
- .type _start,@function
+ .globl func2
+ .type func2,@function
func2:
bl foo2
bl bar2
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x1 /* BTI. */
-4:
- .p2align 3
-5:
+ ret
+ .size func2, .-func2
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
#name: Check -z force-bti emits BTI PLT (exec)
#source: bti-plt-1.s
#target: [check_shared_lib_support]
-#as: -mabi=lp64
+#as: -mabi=lp64 -defsym __property_bti__=1
#ld: -z force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
#objdump: -dr -j .plt
#name: Check -z force-bti emits BTI feature (exec)
#source: bti-plt-1.s
#target: [check_shared_lib_support]
-#as: -mabi=lp64
+#as: -mabi=lp64 -defsym __property_bti__=1
#ld: -z force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
#readelf: -n
#name: BTI PLT with only GNU PROP
#source: property-bti-pac1.s
-#as: -mabi=lp64 -defsym __property_bti__=1
+#as: -mabi=lp64
#ld: -e _start -L./tmpdir -lbti-plt-so
#objdump: -dr -j .plt
#target: *linux*
#name: Warn when both have GNU prop but neither BTI
-#source: property-bti-pac2.s
-#source: bti-plt-1.s
+#source: property-bti-pac1.s
+#source: bti-plt-2.s
#target: [check_shared_lib_support]
-#as: -mabi=lp64 --defsym __guard_property_bti__=1 --defsym __property_pac__=1
+#as: -mabi=lp64 --defsym __mask_property_bti__=1 --defsym __property_pac__=1
#ld: -shared -z force-bti
-#warning: .*property-bti-pac2.*: warning: BTI turned on by -z force-bti.*
-#warning: .*bti-plt-1.*: warning: BTI turned on by -z force-bti.*
+#warning: .*property-bti-pac1.*: warning: BTI turned on by -z force-bti.*
+#warning: .*bti-plt-2.*: warning: BTI turned on by -z force-bti.*
#readelf: -n
# Should warn about the missing input BTI NOTE but should
.type _start,@function
_start:
mov x1, #2
-.ifndef __mult__
bl foo
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-maskable-split.inc"
+.else
+.include "gnu-note-properties-maskable-merged.inc"
.endif
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x2 /* PAC. */
-4:
- .p2align 3
-5:
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x1 /* BTI. */
-4:
- .p2align 3
-5:
add sp, sp, 16
ret
.size foo, .-foo
- .global bar
- .type bar, %function
-.ifdef __property_bti__
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x1 /* BTI. */
-4:
- .p2align 3
-5:
-.endif
-.ifdef __property_pac__
- .section ".note.gnu.property", "a"
- .p2align 3
- .long 1f - 0f /* name length */
- .long 5f - 2f /* data length */
- .long 5 /* note type */
-0: .asciz "GNU" /* vendor name */
-1:
- .p2align 3
-2: .long 0xc0000000 /* pr_type. */
- .long 4f - 3f /* pr_datasz. */
-3:
- .long 0x2 /* PAC. */
-4:
- .p2align 3
-5:
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
.endif