[PATCH v1 04/14] gas/write.c: add missing flag SEC_HAS_CONTENT on object attributes section

Jan Beulich jbeulich@suse.com
Fri Mar 28 14:30:06 GMT 2025


On 21.03.2025 18:14, Matthieu Longo wrote:
> A section with a content should have this flag set. If it is not,
> there is a risk that this section be ignored later by the linker.

If this is about SHF_ALLOC becoming set in the object file's section header,
then ...

> --- a/gas/write.c
> +++ b/gas/write.c
> @@ -1936,7 +1936,7 @@ create_obj_attrs_section (void)
>    segT s = subseg_new (name, 0);
>    elf_section_type (s)
>      = get_elf_backend_data (stdoutput)->obj_attrs_section_type;
> -  bfd_set_section_flags (s, SEC_READONLY | SEC_DATA);
> +  bfd_set_section_flags (s, SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);

... I wonder if it's not (also) SEC_ALLOC that you mean here. Would be nice
in any event to know what misbehavior you observed, and hence whether a
testcase couldn't be added right here.

Jan


More information about the Binutils mailing list