[PATCH v2 23/28] gnu directives: parse gnu_attribute and gnu_subsection in BAv2 context
Richard Earnshaw (lists)
Richard.Earnshaw@arm.com
Wed Jun 25 12:52:15 GMT 2025
On 02/05/2025 14:50, Jan Beulich wrote:
> On 02.05.2025 12:32, Matthieu Longo wrote:
>> @@ -2065,6 +2067,22 @@ obj_elf_gnu_attribute (int ignored ATTRIBUTE_UNUSED)
>> obj_attr_process_attribute (OBJ_ATTR_GNU);
>> }
>>
>> +/* Parse a .gnu_subsection directive. */
>> +
>> +static void
>> +obj_elf_gnu_subsection (int ignored ATTRIBUTE_UNUSED)
>> +{
>> + obj_attr_version_t version = elf_obj_attr_version (stdoutput);
>> + if (version < OBJ_ATTR_V2)
>> + {
>> + as_bad (("gnu_subsection is only available with object attributes v2, and"
>> + " the current target only supports object attributes v1"));
>
> I appreciate the desire to make this generically usable, but taking x86: If
> this message didn't trigger upon use of the directive, I expect that would
> be wrong. But if it does trigger, it's wrong too: x86 doesn't support v1
> either.
According to the manual:
8.1 gnu Object Attributes
The .gnu_attribute directive records an object attribute with vendor `gnu'.
[...]
8.1.1 Common gnu attributes
These attributes are valid on all architectures.
Tag_compatibility (32)
So technically even x86 should support this, though it appears that readelf doesn't recognize it correctly. Perhaps the manual is just wrong, or perhaps the x86 support wasn't wired up correctly.
R.
More information about the Binutils
mailing list