http://sourceware.org/bugzilla/show_bug.cgi?id=15478

             Bug #: 15478
           Summary: -no-as-needed required to avoid runtime symbol lookup
                    error
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: i...@airs.com
        ReportedBy: sparkpr...@gmail.com
                CC: ccout...@google.com
    Classification: Unclassified


Created attachment 7028
  --> http://sourceware.org/bugzilla/attachment.cgi?id=7028
3 c++ files and a simple build script

situation (see attached tar.bz2 to reproduce):
libmylib.so has unresolved symbols that are found in libmyplugin.so
myapp.c++ calls into libmylib.so
myapp.c++ is being compiled with -lmylib and -lmyplugin

expected behaviour, and behaviour with gnu ld:
myapp is linked against mylib and myplugin

observed behaviour:
myapp is only linked against mylib since it does not make direct calls into
myplugin
myapp is not executable (fails with message about myplugin symbols not being
resolved in mylib)

workaround:
link with -no-as-needed

Can you comment on this observed behaviour?  thanks


dcunnin@tyrion:~$ gcc-4.6 --version
gcc-4.6 (Ubuntu/Linaro 4.6.3-10ubuntu1) 4.6.3 20120918 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

dcunnin@tyrion:~$ ld --version
GNU gold (GNU Binutils for Ubuntu 2.22.90.20120924) 1.11
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to