summaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 1f8e6d0ebde..1a9bebe668f 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -7286,8 +7286,11 @@ elf_x86_64_merge_gnu_properties (struct bfd_link_info *info,
features = 0;
if (info->ibt)
features = GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (info->shstk)
+ features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
number = aprop->u.number;
- /* Add GNU_PROPERTY_X86_FEATURE_1_IBT. */
+ /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and
+ GNU_PROPERTY_X86_FEATURE_1_SHSTK. */
aprop->u.number = (number & bprop->u.number) | features;
updated = number != (unsigned int) aprop->u.number;
/* Remove the property if all feature bits are cleared. */
@@ -7299,9 +7302,12 @@ elf_x86_64_merge_gnu_properties (struct bfd_link_info *info,
features = 0;
if (info->ibt)
features = GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (info->shstk)
+ features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
if (features)
{
- /* Add GNU_PROPERTY_X86_FEATURE_1_IBT. */
+ /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and
+ GNU_PROPERTY_X86_FEATURE_1_SHSTK. */
if (aprop != NULL)
{
number = aprop->u.number;
@@ -7348,9 +7354,12 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
features = 0;
if (info->ibt)
features = GNU_PROPERTY_X86_FEATURE_1_IBT;
+ if (info->shstk)
+ features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
if (features)
{
- /* Turn on GNU_PROPERTY_X86_FEATURE_1_IBT. */
+ /* Turn on GNU_PROPERTY_X86_FEATURE_1_IBT and
+ GNU_PROPERTY_X86_FEATURE_1_SHSTK. */
bfd *ebfd = NULL;
elf_property *prop;
@@ -7368,7 +7377,8 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
prop = _bfd_elf_get_property (pbfd,
GNU_PROPERTY_X86_FEATURE_1_AND,
4);
- /* Add GNU_PROPERTY_X86_FEATURE_1_IBT. */
+ /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and
+ GNU_PROPERTY_X86_FEATURE_1_SHSTK. */
prop->u.number |= features;
prop->pr_kind = property_number;
break;