This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: Should undefined symbols in sysv hash table be ignored in do_lookup_x?


On Wed, Feb 6, 2013 at 2:27 PM, Roland McGrath <roland@hack.frob.com> wrote:
> Can you demonstrate any user-visible effect of this?  I thought it implied
> that lookup could go awry if there were an object with only DT_HASH and no
> DT_GNU_HASH with a SHN_UNDEF symbol of a given name that's earlier in the
> search order than the object that actually defines that name.  But I tried
> a simple test case and that does not seem to be so.
>

There are

        if (__builtin_expect ((sym->st_value == 0 /* No value.  */
                               && stt != STT_TLS)
                              || (type_class & (sym->st_shndx == SHN_UNDEF)),
                              0))
          return NULL;

before that code.  Since undefined symbol has st_value == 0, we
will only see it with TLS symbols.  Since most of relocations against
TLS symbols are treated PLT relocations, we will return NULL for
undefined TLS symbols, except for SIZE relocations against TLS
symbols.

-- 
H.J.


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