From: Matthieu Longo Date: Fri, 23 Jan 2026 15:38:57 +0000 (+0000) Subject: obj_attr_v2_record: simplify logic when an attribute already exists X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=449035c35f2169e0c690d83f28306275ab7f7463;p=thirdparty%2Fbinutils-gdb.git obj_attr_v2_record: simplify logic when an attribute already exists Suggested-By: Jan Beulich Approved-By: Jan Beulich --- diff --git a/gas/config/obj-elf-attr.c b/gas/config/obj-elf-attr.c index 7ed781d367c..a731c1f1300 100644 --- a/gas/config/obj-elf-attr.c +++ b/gas/config/obj-elf-attr.c @@ -1062,8 +1062,7 @@ obj_attr_v2_record (obj_attr_tag_t key, arg_t *arg_val) /* Go over the list of already recorded attributes and check for redefinitions (which are forbidden). */ - bool skip_recording = false; - obj_attr_v2_t *recorded_attr = bfd_obj_attr_v2_find_by_tag + const obj_attr_v2_t *recorded_attr = bfd_obj_attr_v2_find_by_tag (elf_obj_attr_subsections (stdoutput).last, obj_attr->tag, false); if (recorded_attr != NULL) { @@ -1073,11 +1072,7 @@ obj_attr_v2_record (obj_attr_tag_t key, arg_t *arg_val) && strcmp (recorded_attr->val.string, obj_attr->val.string) != 0)) as_bad (_("attribute '%" PRIu64 "' cannot be redefined"), recorded_attr->tag); - skip_recording = true; - } - if (skip_recording) - { if (arg_val->vtype == VALUE_STRING) free ((void *) obj_attr->val.string); free (obj_attr);