[PATCH v11 25/25] gnu directives: bfd: generic tests for merge of gnu attributes v2

Jan Beulich jbeulich@suse.com
Fri Jan 9 09:42:42 GMT 2026


On 31.12.2025 00:05, Matthieu Longo wrote:
> --- /dev/null
> +++ b/ld/testsuite/ld-attributes/oav2-1-mismatch-subsec-props-with-all-optional-1.d
> @@ -0,0 +1,7 @@
> +# name: Object Attributes v2: mismatch subsection properties with oav2-1-all-optional-1
> +# target: [supports_oa_v2]
> +# source: oav2-1-all-optional-1.s
> +# source: oav2-1-mismatch-subsec-props-with-all-optional-1.s
> +# ld: -shared
> +#error: \A[^\n]*oav2-1-all-optional-1\.o, [^:]*oav2-1-mismatch-subsec-props-with-all-optional-1\.o: error: parameters of subsection 'gnu_testing_ba_1_MERGE_AND' are mismatching\. \(optional, ULEB128\) VS \(required, ULEB128\)
> +#error: \n[^\n]*oav2-1-all-optional-1\.o, [^:]*oav2-1-mismatch-subsec-props-with-all-optional-1\.o: error: parameters of subsection 'gnu_testing_ba_2_MERGE_AND' are mismatching\. \(optional, ULEB128\) VS \(optional, NTBS\)\Z

Such absurdly long lines (despite you already having taken care of the path
parts of the file names) are indications of a problem beyond testcase
expectations. struct bfd_link_callbacks has an "info" member, so much like
you've now done in gas, I think these want splitting into a shorter error
plus a shorter info message. There's also a wording issue imo (albeit recall
I'm not a native speaker): I don't think "parameters of subsection" is a
good way of putting things (while functions can have parameters, I don't
think subsections do). The word "attribute" might be ambiguous in this
context, but maybe "properties" would be a reasonable fit?

Overall e.g.:

<object1>: error: mismatched properties of subsection '<subsection>'
<object2>: info: conflicting subsection lives here
info: \(<values1>\) vs \(<values2>\)

or

<object1>: error: mismatched properties of subsection '<subsection>': \(<values1>\)
<object2>: info: conflicting subsection lives here: \(<values2>\)

And then, as before, use .* for parts of the output not relevant for the
particular test (e.g. "\(optional, .*\) vs \(required, .*\)").

Beyond this comments given on the earlier two patches apply here as well.

Jan


More information about the Binutils mailing list