[PATCH v8 12/19] Merge of Object Attributes v2 during linkage (generic logic)
Alice Carlotti
alice.carlotti@arm.com
Mon Sep 1 16:48:07 GMT 2025
On Fri, Aug 29, 2025 at 05:37:56PM +0100, Matthieu Longo wrote:
> On 2025-08-22 10:50, Jan Beulich wrote:
> > On 15.07.2025 13:39, Matthieu Longo wrote:
...
> > > +/* Check for mismatch between the parameters of subsections S1 and S2.
> > > + Note: F1 can be null when comparing FROZEN and the first object file used to
> > > + store the merge result. If an error is reported, it means that one of the
> > > + definition of S1 or S2 is corrupted. Most likely S2 because it is a user
> > > + input, or S1 if it is a programmation error of FROZEN. In the second case,
> > > + please raise a bug to binutils bug tracker. */
> > > +static bool
> > > +oav2_subsection_mismatching_params (struct bfd_link_info *info,
> > > + bfd *f1, bfd *f2,
> > > + obj_attr_subsection_v2 *s1,
> > > + obj_attr_subsection_v2 *s2)
> > > +{
> > > + if (! gnu_testing_namespace (s1->name))
> > > + {
> > > + /* Check whether the subsection is known, and if so, match against the
> > > + expected properties.
> > > + Note: this piece of code must be guarded against gnu-testing
> > > + subsections, as the backend method looks up at the known subsections.
> > > + Since the "fictive" entry for gnu-testing known subsection has random
> > > + values for its encoding and optionality, it won't be able to detect
> > > + mismatching parameters correctly. */
> > > + bool match_known = true;
> > > + if (get_elf_backend_data (f2)->obj_attr_subsection_v2_match_known != NULL)
> > > + match_known = get_elf_backend_data (f2)
> > > + ->obj_attr_subsection_v2_match_known (info, f2, s2);
> > > + if (! match_known)
> > > + return true;
> > > + }
> > > +
> > > + bool mismatch = (s1->encoding != s2->encoding
> > > + || s1->optional != s2->optional);
> > > +
> > > + if (mismatch)
> > > + {
> > > + if (f1 != NULL)
> > > + info->callbacks->einfo (_("%X%pB, %pB: error: parameters of subsection"
> > > + " '%s' are mismatching. (%s, %s) VS (%s, %s)\n"), f1, f2, s1->name,
> >
> > I'm not a native speaker, but I think it wants to be "mismatched" here, much
> > like you have ...
> >
>
> I am not a native speaker as well, but the choices are the following from my
> perspective:
> - a present participle as adjective: "mismatching". A present participle is
> less tied to the notion of time so used to discribe something more
> permanent.
> - a past participle as adjective: "mismatched". This is true now, but might
> not be true in the future. (or potentially a passive form, but it seems
> weird in this context because of the nature of the mismatching). The
> mismatch is not going to change between this run and a next one with the
> same input.
> - a verb to replace "are mistmatching" by the preterit "mismatched" to mean
> that the thing mismatched during a matching process, the action is done.
>
> "mismatching" seems the most appropriate to me, but not sure whether it is
> the most idiomatical way of saying it.
A native speaker's perspective - my initial instinct was that "mismatched" was
correct, but on further consideration I think "mismatching" is also ok. And
now I've overthought it for a few minutes, I wonder whether Matthieu's
passive/active observation is relevant - "mismatching" might push the emphasis
towards the two values not matching each other, while "mismatched" might push
the emphasis towards the programmer having failed to match the together.
(Perhaps the initial instinct is most relevant, since most people reading an
error message aren't going to spend several minutes overthinking and
researching the grammar.)
While I'm here - is the full stop after "mismatching" correct? I feel it would
be better to use a colon or dash, or to bracket the rest of the message
(although nested brackets actually might not look good). The same comment
applies for "corrupted." below.
Alice
>
> > > + oav2_comprehension_to_string (s1->optional),
> > > + oav2_encoding_to_string (s1->encoding),
> > > + oav2_comprehension_to_string (s2->optional),
> > > + oav2_encoding_to_string (s2->encoding));
> > > + else
> > > + info->callbacks->einfo (_("%X%pB: error: parameters of subsection"
> > > + " '%s' are corrupted. (%s, %s) VS (%s, %s)\n"), f2, s1->name,
> >
> > ... "corrupted" here.
> >
>
> From my perspective, this is the passive form: to be + verb past participle
> + [by: something or someone].
>
> Again, I will let a native speaker enlighten us on the most idiomatic way.
More information about the Binutils
mailing list