From: Andrea Corallo <andrea.corallo@arm.com>
To: Binutils <binutils@sourceware.org>
Cc: "richard.earnshaw@arm.com" <richard.earnshaw@arm.com>
Subject: PATCH [3/4] arm: Add Tag_BTI_use build attribute
Date: Tue, 20 Jul 2021 17:38:52 +0200 [thread overview]
Message-ID: <gkr5yx5ov03.fsf@arm.com> (raw)
Message-ID: <20210720153852.1DLOVmXbm5KqMUC1jR1vdxhQv9IdBiL5nbe4qwQpKLc@z> (raw)
[-- Attachment #1: Type: text/plain, Size: 650 bytes --]
Hi all,
third patch of the series adding 'Tag_BTI_use' build attribute
support.
Here follows its semantic:
0 This code is compiled without branch target enforcement
1 This code is compiled with branch target enforcement
See:
- Armv8.1-M Pointer Authentication and Branch Target Identification Extension [1]
- Armv8-M Architecture Reference Manual [2]
Regtested clean on current master.
Best Regards
Andrea
[1] <https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension>
[2] <https://developer.arm.com/documentation/ddi0553/latest>
[-- Attachment #2: 0003-PATCH-3-4-arm-Add-Tag_BTI_use-build-attribute.patch --]
[-- Type: text/plain, Size: 3524 bytes --]
From 853ada30059936dd1b1541edc939b895c351de49 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Mon, 5 Jul 2021 17:14:47 +0200
Subject: [PATCH 3/4] PATCH [3/4] arm: Add Tag_BTI_use build attribute
bfd/
2021-07-06 Andrea Corallo <andrea.corallo@arm.com>
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add
'Tag_BTI_use' case.
binutils/
2021-07-06 Andrea Corallo <andrea.corallo@arm.com>
* readelf.c (arm_attr_tag_PAC_extension): Declare.
(arm_attr_public_tags): Add 'PAC_extension' lookup.
elfcpp/
2021-07-06 Andrea Corallo <andrea.corallo@arm.com>
* arm.h: Define 'Tag_BTI_use' enum.
gas/
2021-07-06 Andrea Corallo <andrea.corallo@arm.com>
* config/tc-arm.c (arm_convert_symbolic_attribute): Add
'Tag_BTI_use' to the attribute_table.
include/
2021-07-06 Andrea Corallo <andrea.corallo@arm.com>
* elf/arm.h (elf_arm_reloc_type): Add 'Tag_BTI_use'.
---
bfd/elf32-arm.c | 1 +
binutils/readelf.c | 5 +++++
elfcpp/arm.h | 1 +
gas/config/tc-arm.c | 1 +
include/elf/arm.h | 1 +
5 files changed, 9 insertions(+)
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 73061047e29..98f92401942 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -14614,6 +14614,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info)
case Tag_MVE_arch:
case Tag_PAC_extension:
case Tag_BTI_extension:
+ case Tag_BTI_use:
/* Use the largest value specified. */
if (in_attr[i].i > out_attr[i].i)
out_attr[i].i = in_attr[i].i;
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9091a44eac4..993f3160ab6 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -16149,6 +16149,10 @@ static const char * arm_attr_tag_BTI_extension[] =
"BTI instructions permitted in the NOP space",
"BTI instructions permitted in the NOP and in the non-NOP space"};
+static const char * arm_attr_tag_BTI_use[] =
+ {"Compiled without branch target enforcement",
+ "Compiled with branch target enforcement"};
+
#define LOOKUP(id, name) \
{id, #name, 0x80 | ARRAY_SIZE(arm_attr_tag_##name), arm_attr_tag_##name}
static arm_attr_public_tag arm_attr_public_tags[] =
@@ -16191,6 +16195,7 @@ static arm_attr_public_tag arm_attr_public_tags[] =
LOOKUP(48, MVE_arch),
LOOKUP(50, PAC_extension),
LOOKUP(52, BTI_extension),
+ LOOKUP(74, BTI_use),
{64, "nodefaults", 0, NULL},
{65, "also_compatible_with", 0, NULL},
LOOKUP(66, T2EE_use),
diff --git a/elfcpp/arm.h b/elfcpp/arm.h
index 42144ce13be..12ba3fa7a1e 100644
--- a/elfcpp/arm.h
+++ b/elfcpp/arm.h
@@ -308,6 +308,7 @@ enum
Tag_MVE_arch = 48,
Tag_PAC_extension = 50,
Tag_BTI_extension = 52,
+ Tag_BTI_use = 74,
Tag_nodefaults = 64,
Tag_also_compatible_with = 65,
Tag_T2EE_use = 66,
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 0ad1219ba9c..6248adccf2d 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -33561,6 +33561,7 @@ arm_convert_symbolic_attribute (const char *name)
T (Tag_MVE_arch),
T (Tag_PAC_extension),
T (Tag_BTI_extension),
+ T (Tag_BTI_use),
/* We deliberately do not include Tag_MPextension_use_legacy. */
#undef T
};
diff --git a/include/elf/arm.h b/include/elf/arm.h
index eb2ae9f4301..0f6e734e6d0 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -329,6 +329,7 @@ enum
Tag_MVE_arch = 48,
Tag_PAC_extension = 50,
Tag_BTI_extension = 52,
+ Tag_BTI_use = 74,
Tag_nodefaults = 64,
Tag_also_compatible_with,
Tag_T2EE_use,
--
2.20.1
next reply other threads:[~2021-07-26 12:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 15:38 Andrea Corallo [this message]
2021-07-20 15:38 ` PATCH [5/10] arm: Extend again arm_feature_set struct to provide more bits Andrea Corallo
2021-07-20 15:38 ` PATCH [7/10] arm: add 'bxaut' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [8/10] arm: add 'autg' " Andrea Corallo
2021-07-20 15:38 ` PATCH [10/10] arm: Alias 'ra_auth_code' to r12 for pacbti Andrea Corallo
2021-07-20 15:38 ` PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag Andrea Corallo
2021-07-20 15:38 ` PATCH [9/10] arm: add 'pacg' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [3/4] arm: Add Tag_BTI_use build attribute Andrea Corallo
2021-07-20 15:38 ` PATCH [2/4] arm: Add Tag_BTI_extension " Andrea Corallo
2021-07-20 15:38 ` PATCH [4/4] arm: Add Tag_PACRET_use " Andrea Corallo
2021-07-20 15:38 ` PATCH V2 [2/10] arm: add 'pacbti' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [4/10] arm: add 'pac' " Andrea Corallo
2021-07-20 15:38 ` PATCH [3/10] arm: add 'aut' " Andrea Corallo
2021-07-21 14:31 ` PATCH [1/10] arm: add 'bti' " Nick Clifton
2021-07-21 15:12 ` Andrea Corallo
2021-07-26 12:32 ` Andrea Corallo
2021-08-10 15:31 ` PATCH [2/4] arm: Add Tag_BTI_extension build attribute Nick Clifton
2021-08-17 12:59 ` Andrea Corallo
2021-08-10 15:32 ` PATCH [3/4] arm: Add Tag_BTI_use " Nick Clifton
2021-08-10 15:33 ` PATCH [4/4] arm: Add Tag_PACRET_use " Nick Clifton
2021-08-10 15:33 ` PATCH V2 [2/10] arm: add 'pacbti' instruction for Armv8.1-M pacbti extension Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gkr5yx5ov03.fsf@arm.com \
--to=andrea.corallo@arm.com \
--cc=binutils@sourceware.org \
--cc=richard.earnshaw@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).