[PATCH v11 25/25] gnu directives: bfd: generic tests for merge of gnu attributes v2
Matthieu Longo
matthieu.longo@arm.com
Wed Jan 14 16:07:58 GMT 2026
On 09/01/2026 09:42, Jan Beulich wrote:
> 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
Here is the new revision following your approach:
#error: \A[^\n]*oav2-1-mismatch-subsec-props-with-all-optional-1\.o: error: mismatching properties of subsection 'gnu_testing_ba_1_MERGE_AND'
#error: \n[^\n]*oav2-1-all-optional-1\.o: info: conflicting subsection lives here
#error: \ninfo: \(required, .*\) VS \(optional, .*\)
#error: \n[^\n]*oav2-1-mismatch-subsec-props-with-all-optional-1\.o: error: mismatching properties of subsection 'gnu_testing_ba_2_MERGE_AND'
#error: \n[^\n]*oav2-1-all-optional-1\.o: info: conflicting subsection lives here
#error: \ninfo: \(.*, NTBS\) VS \(.*, ULEB128\)\Z
And for mismatching attributes:
#error: \A[^\n]*oav2-2-required-subsec-B\.o: error: mismatching value for required object attribute 'GNUTestTag_1' in subsection 'gnu_testing_ba_1_MERGE_AND': 0x1
#error: \n[^\n]*oav2-2-required-subsec-A-1\.o: info: conflicting value lives here: 0\Z
Does it look better ?
Matthieu
More information about the Binutils
mailing list