[PATCH v12 02/25] Object Attributes v2: new abstractions for subsections and attributes
Jan Beulich
jbeulich@suse.com
Fri Jan 23 14:17:16 GMT 2026
On 23.01.2026 13:17, Matthieu Longo wrote:
> On 23/01/2026 11:24, Maciej W. Rozycki wrote:
>> This patch caused hundreds of regressions for `csky-elf' and `csky-linux'
>> making the targets unusable:
>>
>> .../gas/as-new: BFD (GNU Binutils) 2.45.50.20260123 assertion fail .../bfd/elf-attrs.c:2515
>>
>> Please have a look into it.
>
> Here is a first patch to "solve" the issue:
>
> --- a/gas/config/tc-csky.c
> +++ b/gas/config/tc-csky.c
> @@ -1712,6 +1712,9 @@ md_begin (void)
> mach_flag |= CSKY_ARCH_610;
> }
>
> + elf_obj_attr_version (stdoutput)
> + = get_elf_backend_data (stdoutput)->default_obj_attr_version;
> +
> /* Find bfd_mach_flag, it will set to bfd backend data. */
> for (p_arch = csky_archs; p_arch->arch_flag != 0; p_arch++)
> if ((mach_flag & CSKY_ARCH_MASK) == (p_arch->arch_flag & CSKY_ARCH_MASK))
>
> However, I am wondering if this is the right place to do such an initialization.
Well, you provide too little info. md_begin() runs ahead of ...
> The initialization of the default attribute version occurs inside elf_begin() in obj-elf.c
... elf_begin(). Question is whether C-Sky needs what you'd normally do in
elf_begin() already earlier for whatever reason. If so, with a respective
comment the change above might be appropriate. To decide, the call stack
leading to the assertion failure would be of interest. (From that it might
then also turn out that the assertion itself is inappropriate to have.)
As an aside, it looks as if tc-csky.c means to be prepared for use with
non-ELF. You'd want to wrap your addition in #ifdef OBJ_ELF.
Jan
More information about the Binutils
mailing list