bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/14826] New: ld flag --as-needed do not remove extra link


From: bioinfornatics at fedoraproject dot org
Subject: [Bug ld/14826] New: ld flag --as-needed do not remove extra link
Date: Sat, 10 Nov 2012 13:01:19 +0000

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

             Bug #: 14826
           Summary: ld flag --as-needed do not remove extra link
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Hi,


with a simple file libFoo.d ld not remove all unused link

----------------libFoo.d--------------------------
size_t add( size_t a , size_t b ){ return a + b ; }
---------------------------------------------------

without --as-needed

----------------Terminal--------------------------
$ ldc2 -shared libFoo.d -of libFoo.so.1 -soname=libFoo.so.1  -v | grep gcc
/usr/lib64/ccache/gcc libFoo.so.o -shared -o libFoo.so.1 -Xlinker -L/usr/lib64
-Xlinker -lphobos-ldc -lrt -ldl -lpthread -lm -m64 -Wl,-soname,libFoo.so.1 

$ ldd -r -u libFoo.so.1
Unused direct dependencies:
    /lib64/librt.so.1
    /lib64/libdl.so.2
    /lib64/libpthread.so.0
    /lib64/libm.so.6
---------------------------------------------------

whith

----------------Terminal--------------------------
$ ldc2 -shared libFoo.d -of libFoo.so.1 -soname=libFoo.so.1  -v -L--as-needed|
grep gcc
/usr/lib64/ccache/gcc libFoo.so.o -shared -o libFoo.so.1 -Xlinker --as-needed
-Xlinker -L/usr/lib64 -Xlinker -lphobos-ldc -lrt -ldl -lpthread -lm -m64
-Wl,-soname,libFoo.so.1

$ ldd -r -u libFoo.so.1
Unused direct dependencies:
    /lib64/librt.so.1
    /lib64/libdl.so.2
    /lib64/libm.so.6
---------------------------------------------------

The we see here that --as-needed is able to remove only one unused link
libpthread . Why is not able to do same for others ?

-- 
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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]