--- /dev/null
+#name: No GCS option (equivalent to -z gcs=implicit) and empty GNU note property in input emits no GCS attribute [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared
+#readelf: -n
+
+# Expect no GNU section at all, so readelf output should be empty.
\ No newline at end of file
--- /dev/null
+#name: No GCS option (equivalent to -z gcs=implicit) and GCS GNU note property in input emits GCS attribute [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying '-z gcs' without value raise an error
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs
+#error: .*: error: unrecognized value '-z gcs'
--- /dev/null
+#name: Specifying invalid value for '-z gcs' raise an error
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared -z gcs=foo
+#error: .*: error: unrecognized value '-z gcs=foo'
--- /dev/null
+#name: Specifying only '-z gcs=always' with GCS marked inputs emits GCS feature without warnings for inputs with GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=always
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=always' emits GCS feature with warnings for missing GCS feature on inputs [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared -z gcs=always
+#warning: \A[^\n]*gcs2\.o: warning: GCS is required by -z gcs[^\n]*\n
+#warning: [^\n]*gcs\.o: warning: GCS is required by -z gcs[^\n]*
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=implicit' and GCS-marked inputs emits GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=implicit
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=implicit' and GCS-unmarked inputs emits no GCS feature without warnings [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared -z gcs=implicit
+#readelf: -n
--- /dev/null
+#name: Specifying only '-z gcs=implicit -z gcs-report=warning' and GCS-marked inputs emits GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=implicit -z gcs-report=warning
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=implicit -z gcs-report=warning' and GCS-unmarked inputs emits no GCS feature without warnings [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared -z gcs=implicit -z gcs-report=warning
+#readelf: -n
--- /dev/null
+#name: Specifying only '-z gcs=never' and GCS-marked inputs emits no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=never
+#readelf: -n
--- /dev/null
+#name: Specifying only '-z gcs=never' and GCS-unmarked inputs emits no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs
+#ld: -shared -z gcs=never
+#readelf: -n
--- /dev/null
+#name: Specifying only '-z gcs=always -z gcs-report=error' with mixed inputs emits errors [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=always -z gcs-report=error
+#error: \A[^\n]*nogcs\.o: error: GCS is required by -z gcs[^\n]*$
--- /dev/null
+#name: Specifying only '-z gcs=always -z gcs-report=warning' with mixed inputs emits GCS feature and warnings [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=always -z gcs-report=warning
+#warning: \A[^\n]*nogcs\.o: warning: GCS is required by -z gcs[^\n]*$
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=always -z gcs-report=none' with mixed inputs emits GCS feature and no error/warning [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=always -z gcs-report=none
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=always -z gcs-report' with mixed inputs emits GCS feature and warnings [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=always -z gcs-report
+#warning: \A[^\n]*nogcs\.o: warning: GCS is required by -z gcs[^\n]*$
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: AArch64 feature: GCS
--- /dev/null
+#name: Specifying only '-z gcs=implicit -z gcs-report=error' with mixed inputs emits no error/warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=implicit -z gcs-report=error
+#readelf: -n
\ No newline at end of file
--- /dev/null
+#name: Specifying only '-z gcs=implicit -z gcs-report=warning' with mixed inputs emits no warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=implicit -z gcs-report=warning
+#readelf: -n
\ No newline at end of file
--- /dev/null
+#name: Specifying only '-z gcs=implicit -z gcs-report=none' with mixed inputs emits no warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=implicit -z gcs-report=none
+#readelf: -n
\ No newline at end of file
--- /dev/null
+#name: Specifying only '-z gcs=never -z gcs-report=error' with mixed inputs emits no error/warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=never -z gcs-report=error
+#readelf: -n
\ No newline at end of file
--- /dev/null
+#name: Specifying only '-z gcs=never -z gcs-report=warning' with mixed inputs emits no error/warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=never -z gcs-report=warning
+#readelf: -n
\ No newline at end of file
--- /dev/null
+#name: Specifying only '-z gcs=never -z gcs-report=none' with mixed inputs emits no error/warning, and no GCS feature [shared]
+#source: gcs.s
+#source: gcs2.s
+#source: nogcs.s
+#alltargets: [check_shared_lib_support] *linux*
+#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
+#ld: -shared -z gcs=never -z gcs-report=none
+#readelf: -n
\ No newline at end of file
--- /dev/null
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ mov x1, #2
+ bl foo
+
+.ifdef __splitted_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+ .text
+ .global foo
+ .type foo, %function
+foo:
+ sub sp, sp, #16
+ mov w0, 9
+ str w0, [sp, 12]
+ ldr w0, [sp, 12]
+ add w0, w0, 4
+ str w0, [sp, 12]
+ nop
+ add sp, sp, 16
+ ret
+ .size foo, .-foo
+
+.ifdef __property_gcs__
+ .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 0x4 /* GCS. */
+4:
+ .p2align 3
+5:
+.endif
--- /dev/null
+ .text
+ .global foo3
+ .type foo3, %function
+foo3:
+ sub sp, sp, #16
+ mov w0, 9
+ str w0, [sp, 12]
+ ldr w0, [sp, 12]
+ add w0, w0, 4
+ str w0, [sp, 12]
+ nop
+ add sp, sp, 16
+ ret
+ .size foo3, .-foo3