[Bug gold/10875] New: links against libraries I never have specified

View: New views
3 Messages — Rating Filter:   Alert me  

[Bug gold/10875] New: links against libraries I never have specified

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tested different packages in debian and noticed that gold always links
against some libraries which aren't used and I never specified. I also tested
to use --as-needed and it didn't change that weird behavior. This doesn't
happen with the old binutils linker

Example output from zlib:

dpkg-shlibdeps: warning: dependency on libgcc_s.so.1 could be avoided if
"debian/zlib1g/usr/lib/libz.so.1.2.3.3" were not
uselessly linked against it (they use none of its symbols).                    
dpkg-shlibdeps: warning: dependency on ld-linux-x86-64.so.2 could be avoided if
"debian/zlib1g/usr/lib/libz.so.1.2.3.3" were
not uselessly linked against it (they use none of its symbols).              
dpkg-shlibdeps: warning: dependency on libgcc_s.so.1 could be avoided if
"debian/zlib-bin/usr/bin/miniunzip debian/zlib-
bin/usr/bin/minizip" were not uselessly linked against it (they use none of its
symbols).                                                                                                                                                                                                  
dpkg-shlibdeps: warning: dependency on ld-linux-x86-64.so.2 could be avoided if
"debian/zlib-bin/usr/bin/miniunzip
debian/zlib-bin/usr/bin/minizip" were not uselessly linked against it (they use
none of its symbols).                                                                                                                                                                                            
dpkg-shlibdeps: warning: dependency on libgcc_s.so.1 could be avoided if
"debian/zlib1g-udeb/usr/lib/libz.so.1.2.3.3" were
not uselessly linked against it (they use none of its symbols).                
dpkg-shlibdeps: warning: dependency on libgcc_s.so.1 could be avoided if
"debian/lib32z1/usr/lib32/libz.so.1.2.3.3" were not
uselessly linked against it (they use none of its symbols).                  
dpkg-shlibdeps: warning: dependency on ld-linux.so.2 could be avoided if
"debian/lib32z1/usr/lib32/libz.so.1.2.3.3" were not
uselessly linked against it (they use none of its symbols).            

I had also a different package which also linked against libICE without any
visible reason, but cannot find it again at the moment

Downstream bug is http://bugs.debian.org/553436

--
           Summary: links against libraries I never have specified
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: robert dot wohlrab at gmx dot de
                CC: bug-binutils at gnu dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

[Bug gold/10875] links against libraries I never have specified

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From robert dot wohlrab at gmx dot de  2009-10-31 22:10 -------
It seems to be that it is partly related to the problem that --as-needed
doesn't remove files which aren't really needed by the executable. So a simple

echo "int main() {return 0;}" > testme.c
gcc -Wl,--as-needed testme.c -o testme -lglib-2.0

will link against glib-2.0 even if it is not used. So

readelf -d testme|grep -e '(NEEDED)' -e 'glib-2.0'

will not be an empty string.

But this doesn't explain libgcc_s.so.1 and ld-linux-x86-64.so.2

--


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

[Bug gold/10875] links against libraries I never have specified

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From ian at airs dot com  2009-11-07 00:12 -------
Thanks for the bug report.  I fixed --as-needed, and this problem should now be
fixed.

libgcc_s.so.1 is used with --as-needed by the gcc driver.

ld-linux-x86-64.so.2 is used with --as-needed by /usr/lib/libc.so.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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