[PATCH v2] Support for SHF_GNU_RETAIN ELF Section Flag
H.J. Lu
hjl.tools@gmail.com
Fri Oct 2 12:33:09 GMT 2020
On Fri, Oct 2, 2020 at 5:30 AM Jozef Lawrynowicz
<jozef.l@mittosystems.com> wrote:
>
> On Thu, Oct 01, 2020 at 09:09:07PM +0930, Alan Modra via Binutils wrote:
> > On Thu, Oct 01, 2020 at 11:50:33AM +0100, Jozef Lawrynowicz wrote:
> > > --- a/bfd/elflink.c
> > > +++ b/bfd/elflink.c
> > > @@ -14102,7 +14102,8 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
> > > || (elf_section_data (o)->this_hdr.sh_type
> > > == SHT_FINI_ARRAY)))
> > > || (elf_section_data (o)->this_hdr.sh_type == SHT_NOTE
> > > - && elf_next_in_group (o) == NULL )))
> > > + && elf_next_in_group (o) == NULL)
> > > + || (elf_section_flags (o) & SHF_GNU_RETAIN)))
> >
> > Flag bits in SHF_MASKOS depend on OS, so this needs a test of OSABI.
> > That can be done by checking elf_tdata (sub)->has_gnu_osabi for the
> > appropriate bit.
> >
>
> Fixed the two OSABI issues in the attached patch.
>
Please rebase since this part has been changed on master branch.
--
H.J.
More information about the Binutils
mailing list