public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Abort in elflink.c: elf_link_check_versioned_symbol
@ 2009-08-26 11:31 Ramana Radhakrishnan
  2009-08-26 13:17 ` Ramana Radhakrishnan
  2009-08-26 19:04 ` Ian Lance Taylor
  0 siblings, 2 replies; 7+ messages in thread
From: Ramana Radhakrishnan @ 2009-08-26 11:31 UTC (permalink / raw)
  To: binutils

Hi,

I've been looking at a linker abort in
elflink.c:elf_link_check_versioned_symbol as a part of a larger project
that a coworker is doing on an arm-linux-gnueabi platform. 

I haven't yet constructed a smaller testcase but I am looking at a bit
of code that doesn't look correct to me. 

This bit of code is the bit that aborts in
elflink.c:elf_link_check_versioned_symbol .

  if ((iver.vs_vers & VERSYM_HIDDEN) == 0)
            {
              /* If we have a non-hidden versioned sym, then it should
                 have provided a definition for the undefined sym.  */
              abort ();
            }

The symbol for which this abort happens is
_ZNSsC1IN9__gnu_cxx17__normal_iteratorIPcSsEEEET_S4_RKSaIcE from libstdc
++.so. Looking at this symbol in libstdc++.so, I can see that this is
versioned and weak as below but the actual symbol doesn't appear in the
shared object.  

From the Symbol Table of libstdc++

  936: 0008e1e4    40 FUNC    WEAK   DEFAULT   11
_ZNSsC1IN9__gnu_cxx17__normal_iteratorIPcSsEEEET_S4_RKSaIcE@@GLIBCXX_3.4

From the Version Table of libstdc++

3a8:   2 (GLIBCXX_3.4)   2 (GLIBCXX_3.4)   2 (GLIBCXX_3.4)   2
(GLIBCXX_3.4)

There is a reference to this file in foo.o compiled with fPIC present in
a library lib.a which is in the final link.

00005950  0003d51b R_ARM_PLT32            00000000
_ZNSsC1IN9__gnu_cxx17__normal_iteratorIPcSsEEEET_S4_RKSaIcE



Shouldn't this be an error condition for an undefined symbol instead of
an abort as here ? While fixing this will not  fix the underlying
problem my colleague faces, surely the linker should at this point give
an error for an undefined reference and bail out gracefully rather than
aborting. 


cheers
Ramana




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-03 11:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26 11:31 Abort in elflink.c: elf_link_check_versioned_symbol Ramana Radhakrishnan
2009-08-26 13:17 ` Ramana Radhakrishnan
2009-08-26 19:04 ` Ian Lance Taylor
2009-09-02 12:49   ` Ramana Radhakrishnan
2009-09-02 16:28     ` Ian Lance Taylor
2009-09-03 11:15       ` Ramana Radhakrishnan
2009-09-02 16:37     ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).