[PATCH v2 23/28] gnu directives: parse gnu_attribute and gnu_subsection in BAv2 context

Jan Beulich jbeulich@suse.com
Fri May 2 13:50:36 GMT 2025


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. Yet more generally my request remains: If at all possible I'd like
to see x86 and other targets not using object attributes to not gain dead
code in the library (it's okay-ish in the static one; my concern is largely
about the --enable-shared case).

Also there's an underscore missing between the two opening parentheses, and
the directive mentioned would better start with a dot (to make clear it's a
directive).

Jan


More information about the Binutils mailing list