> On 12 Sep 2024, at 16:43, Eric Gallager <eg...@gwmail.gwu.edu> wrote:
> 
> 
> 
> On Wed, Sep 11, 2024 at 11:51 AM Srinath Parvathaneni
> <srinath.parvathan...@arm.com> wrote:
>> 
>> This patch adds support for aarch64 gcs build attributes.
> 
> Hi, just wondering if you could clarify what "GCS" stands for in this
> context? When I see it, my first thought is "GNU Coding Standards",
> but I don't think that's right...

It’s the Guarded Control Stack feature of the Arm architecture:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022
Thanks,
Kyrill


> 
>> This support includes generating two new assembler directives
>> .aeabi_subsection and .aeabi_attribute. These directives are
>> generated as per the syntax mentioned in spec
>> "Build Attributes for the Arm® 64-bit Architecture (AArch64)"
>> available at [1].
>> 
>> To check whether the assembler being used to build the toolchain
>> supports these directives, a new gcc configure check is added in
>> gcc/configure.ac.
>> 
>> If the assembler support these directives, .aeabi_subsection and
>> .aeabi_attribute directives are emitted in the generated assembly,
>> when -mbranch-protection=gcs is passed.
>> 
>> If the assembler does not support these directives,
>> .note.gnu.property section will emit the relevant gcs information
>> in the generated assembly, when -mbranch-protection=gcs is passed.
>> 
>> This patch needs to be applied on top of GCC gcs patch series [2].
>> 
>> Bootstrapped on aarch64-none-linux-gnu and regression tested on
>> aarch64-none-elf, no issues.
>> 
>> Ok for master?
>> 
>> Regards,
>> Srinath.
>> 
>> [1]: https://github.com/ARM-software/abi-aa/pull/230
>> [2]: 
>> https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/vendors/ARM/heads/gcs
>> 
>> gcc/ChangeLog:
>> 
>> 2024-09-11  Srinath Parvathaneni  <srinath.parvathan...@arm.com>
>> 
>>        * config.in: Regenerated
>>        * config/aarch64/aarch64.cc (aarch64_emit_aeabi_attribute): New
>>        function declaration.
>>        (aarch64_emit_aeabi_subsection): Likewise.
>>        (aarch64_start_file): Emit gcs build attributes.
>>        (aarch64_file_end_indicate_exec_stack): Update gcs bit in
>>        note.gnu.property section.
>>        * configure: Regenerated.
>>        * configure.ac: Add gcc configure check.
>> 
>> gcc/testsuite/ChangeLog:
>> 
>> 2024-09-11  Srinath Parvathaneni  <srinath.parvathan...@arm.com>
>> 
>>        * gcc.target/aarch64/build-attribute-gcs.c: New test.
>> ---
>> gcc/config.in                                 |   6 +++
>> gcc/config/aarch64/a.out                      | Bin 0 -> 656 bytes
>> gcc/config/aarch64/aarch64.cc                 |  43 ++++++++++++++++++
>> gcc/configure                                 |  35 ++++++++++++++
>> gcc/configure.ac                              |   7 +++
>> .../gcc.target/aarch64/build-attribute-gcs.c  |  24 ++++++++++
>> 6 files changed, 115 insertions(+)
>> create mode 100644 gcc/config/aarch64/a.out
>> create mode 100644 gcc/testsuite/gcc.target/aarch64/build-attribute-gcs.c
>> 

Reply via email to