bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/12320] New: ld --as-needed links libgcc_s.so.1 unnecessarily on


From: ro at TechFak dot Uni-Bielefeld.DE
Subject: [Bug ld/12320] New: ld --as-needed links libgcc_s.so.1 unnecessarily on Solaris 11
Date: Tue, 14 Dec 2010 19:03:12 +0000

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

           Summary: ld --as-needed links libgcc_s.so.1 unnecessarily on
                    Solaris 11
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
              Host: i386-pc-solaris2.11
            Target: i386-pc-solaris2.11
             Build: i386-pc-solaris2.11


While trying to make the libgcc unwinder use dl_iterate_phdr on Solaris 11, I
ran
into the fact that gld 2.21 unnecessarily links libgcc_s.so.1 into even a
trivial
program if USE_LD_AS_NEEDED is defined in gcc/config/sol2.h.

The problem can be shown with the following trivial example, even stripping
down
the usual ld invocation:

$ cat main.c
int main (void) { return (0); }
$ gcc -c main.c
$ gld-2.21 -o main /usr/lib/crt1.o /usr/lib/crti.o -L. main.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc
$ ldd -u main
        libgcc_s.so.1 =>         /usr/lib/libgcc_s.so.1
        libc.so.1 =>     /lib/libc.so.1
        libm.so.2 =>     /lib/libm.so.2

   unused object=/usr/lib/libgcc_s.so.1

I have no idea why ld thinks it needs to use libgcc_s.so.1 and have found no
way
to trace this down.

This unnecessary linking is causing serious trouble, especially since
libgcc_s.so.1
isn't available in the regular ld.so.1 search patch on Solaris 11.

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