[PATCH] elf: Don't load archive element after dynamic definition

H.J. Lu hjl.tools@gmail.com
Thu Aug 27 14:05:15 GMT 2020


On Thu, Aug 27, 2020 at 6:53 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Aug 25, 2020 at 10:28:42AM -0700, H.J. Lu via Binutils wrote:
> > Don't load the archive element after seeing a definition in a shared
> > object.
> >
> > bfd/
> >
> >       PR ld/26530
> >       * elflink.c (elf_link_add_object_symbols): Also preserve the
> >       dynamic_def bit for --as-needed.
> >       (elf_link_add_archive_symbols): Don't load the archive element
> >       after seeing a definition in a shared object.
>
> This seems over complicated to me.  Why don't we just load the
> as-needed shared library on the first pass?
>

In the first pass, when we are loading a shared object,  do we have
the IR symbol resolution?


-- 
H.J.


More information about the Binutils mailing list