[PATCH] elf: Keep zero-sized relocation section in section group

H.J. Lu hjl.tools@gmail.com
Fri Apr 3 20:49:21 GMT 2020


On Thu, Apr 2, 2020 at 11:34 PM Fangrui Song <i@maskray.me> wrote:
>
> On 2020-04-03, Alan Modra via Binutils wrote:
> >On Thu, Apr 02, 2020 at 08:41:18PM -0700, H.J. Lu via Binutils wrote:
> >> We must keep zero-sized relocation section in a section group.  Otherwise,
> >> the relocation section will be missing from the section group.
> >
> >Wouldn't it be better to get rid of these bogus relocation sections?
> >Should be possible with a change to _bfd_elf_fixup_group_sections, I
> >think.
> >
> >--
> >Alan Modra
> >Australia Development Lab, IBM
>
> "19990502 sourceware import" contains
>
> +      if (o->reloc_count > 0)
> +       o->flags |= SEC_RELOC;
> +      else
> +       {
> +         /* Explicitly clear the SEC_RELOC flag.  The linker tends to
> +            set it (this is probably a bug) and if it is set
> +            assign_section_numbers will create a reloc section.  */
> +         o->flags &=~ SEC_RELOC;
> +       }
>
> "this is probably a bug" Shouldn't we fix the bug?

Yes, the real bug will be fixed :-).

-- 
H.J.



More information about the Binutils mailing list