]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
aarch64: adapt BTI tests to use selectable GNU properties
authorMatthieu Longo <matthieu.longo@arm.com>
Sat, 30 Nov 2024 10:27:41 +0000 (10:27 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Mon, 2 Dec 2024 15:18:40 +0000 (15:18 +0000)
ld/testsuite/ld-aarch64/protections/bti-plt-1.d
ld/testsuite/ld-aarch64/protections/bti-plt-1.s
ld/testsuite/ld-aarch64/protections/bti-plt-2.d
ld/testsuite/ld-aarch64/protections/bti-plt-2.s
ld/testsuite/ld-aarch64/protections/bti-plt-3.d
ld/testsuite/ld-aarch64/protections/bti-plt-4.d
ld/testsuite/ld-aarch64/protections/bti-plt-5.d
ld/testsuite/ld-aarch64/protections/bti-warn.d
ld/testsuite/ld-aarch64/protections/property-bti-pac1.s
ld/testsuite/ld-aarch64/protections/property-bti-pac2.s

index 9fd7c6b2ce727b003b55dd870d9694e97c35ca5e..b7d5f51a55319f96ea97937ad8068aada8d66860 100644 (file)
@@ -1,7 +1,7 @@
 #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
 
index 8bb39c44f8de4d2f7a24172e730b36742cb9b926..413e24b2e6072fdf1e9ad8dc4fb835a8488e3f46 100644 (file)
@@ -4,37 +4,9 @@
 _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
index c34ab47bf541329ca977a7708d0572ca4c934b03..e404d532832d9d9c66197e6d7aca3907df9c1899 100644 (file)
@@ -2,7 +2,7 @@
 #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
 
index fff945c9f42e41d7d3b4fed36eb2e920d4a0f35f..db06621df2b998d3e60914e7051e95fe1d72a866 100644 (file)
@@ -1,21 +1,14 @@
        .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
index c82878e1eb5d57a7a4337e5bec174be60a82a9ab..80dbceccf64cf97dee428b7061a86f75466f8d2f 100644 (file)
@@ -1,7 +1,7 @@
 #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
 
index 04d3c7d963f1fbc58851d0d85ba2635765b17acf..24a213b6b8311772cad1b89087548b2f9b922377 100644 (file)
@@ -1,7 +1,7 @@
 #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
 
index ed0029b8de1e99ad92b7d1812f8b6e5e29160f8a..b26fe5b461d1a4cfe4969c7e68d0a8b9fd432c04 100644 (file)
@@ -1,6 +1,6 @@
 #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*
index d10cd104006b664b74889ae027a2a980f4c14b91..9ec6e12650c0c1f9998ed663fb3fd30f2d3a321c 100644 (file)
@@ -1,11 +1,11 @@
 #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
index 414c9277f1dabc5fdc08b8b71716c44ea8bc8343..17568c9e6b44b9976b0dd904dd6f073628307b6e 100644 (file)
@@ -3,35 +3,10 @@
        .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:
index cdec8d998724e67bcc778bba77eac7bf85c05626..071640cb24ea4bfc0a7bc27145402aa13f33a61c 100644 (file)
@@ -12,39 +12,9 @@ foo:
        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