From: Matthieu Longo Date: Thu, 14 Nov 2024 16:51:46 +0000 (+0000) Subject: aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 2) X-Git-Tag: gdb-16-branchpoint~234 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=518976f1350e41bce6abe0c5c397aa854601420d;p=thirdparty%2Fbinutils-gdb.git aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 2) Simplify this for-loop with too many "break" instructions inside. --- diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index df62ec12e85..bc823f79c60 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -775,21 +775,22 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info) outprop accordingly. */ if (pbfd != NULL) { - elf_property_list *p; - /* The property list is sorted in order of type. */ - for (p = elf_properties (pbfd); p; p = p->next) + for (elf_property_list *p = elf_properties (pbfd); + (p != NULL) + && (GNU_PROPERTY_AARCH64_FEATURE_1_AND <= p->property.pr_type); + p = p->next) { - /* Check for all GNU_PROPERTY_AARCH64_FEATURE_1_AND. */ - if (GNU_PROPERTY_AARCH64_FEATURE_1_AND == p->property.pr_type) + /* This merge of features should happen only once as all the identical + properties are supposed to have been merged at this stage by + _bfd_elf_link_setup_gnu_properties(). */ + if (p->property.pr_type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) { outprop = (p->property.u.number - & (GNU_PROPERTY_AARCH64_FEATURE_1_PAC - | GNU_PROPERTY_AARCH64_FEATURE_1_BTI)); + & (GNU_PROPERTY_AARCH64_FEATURE_1_BTI + | GNU_PROPERTY_AARCH64_FEATURE_1_PAC)); break; } - else if (GNU_PROPERTY_AARCH64_FEATURE_1_AND < p->property.pr_type) - break; } }