]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
aarch64: simplify condition in elfNN_aarch64_merge_gnu_properties
authorMatthieu Longo <matthieu.longo@arm.com>
Thu, 28 Nov 2024 15:36:51 +0000 (15:36 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Mon, 2 Dec 2024 15:18:40 +0000 (15:18 +0000)
The current condition used to check if a GNU feature property is set
on an input object before the merge is a bit confusing.

  (aprop && !<something about aprop>) || !aprop

It seems easier to understand if it is changed as follows:

  (!aprop || !<something about aprop>)

bfd/elfnn-aarch64.c

index 0350325fd83f569ed1733e5eb626f983d279815b..ba583494b1187eb5b779d5d2631c55889073c9c9 100644 (file)
@@ -10651,11 +10651,9 @@ elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
       if ((prop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
          && (bti_report != MARKING_NONE))
        {
-         if ((aprop && !(aprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
-             || !aprop)
+         if (!aprop || !(aprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
            _bfd_aarch64_elf_check_bti_report (bti_report, abfd);
-         if ((bprop && !(bprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
-             || !bprop)
+         if (!bprop || !(bprop->u.number & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
            _bfd_aarch64_elf_check_bti_report (bti_report, bbfd);
        }
     }