aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMatthieu Longo <matthieu.longo@arm.com>2024-11-14 16:51:46 +0000
committerMatthieu Longo <matthieu.longo@arm.com>2024-12-02 15:18:40 +0000
commit518976f1350e41bce6abe0c5c397aa854601420d (patch)
treeb38fd244c3a86a31548e197a18076ef03ff92ad5 /bfd
parentd364a2ddb4bfe3680f03dd24b724a867e35ee372 (diff)
downloadbinutils-518976f1350e41bce6abe0c5c397aa854601420d.zip
binutils-518976f1350e41bce6abe0c5c397aa854601420d.tar.gz
binutils-518976f1350e41bce6abe0c5c397aa854601420d.tar.bz2
aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 2)
Simplify this for-loop with too many "break" instructions inside.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfxx-aarch64.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index df62ec1..bc823f7 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;
}
}