This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/13177: garbage collector retains zombie references to external libraries


On Wed, Sep 14, 2011 at 5:25 PM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Sep 14, 2011 at 12:14:38PM -0700, H.J. Lu wrote:
>> We shoul also remove symbols without PLT nor GOT references from dynamic
>> symbol table. ?OK to install?
>
> No. ?A symbol that isn't used in the defining object will have no PLT
> or GOT refs in that object, but may need to be exported to satisfy a
> reference in some other object.
>

There are


  if (((h->root.type == bfd_link_hash_defined
        || h->root.type == bfd_link_hash_defweak)
       && !h->root.u.def.section->gc_mark
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       && (!(h->root.u.def.section->owner->flags & DYNAMIC)
           || (h->plt.refcount <= 0
               && h->got.refcount <= 0)))
      || (h->root.type == bfd_link_hash_undefined
          && h->plt.refcount <= 0
          && h->got.refcount <= 0))

Shouldn't gc_mark be 1 if the section where the symbol is defined is kept?

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]