[Top][All Lists]

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

[Bug ld/14915] --copy-dt-needed-entries not working

From: matz at suse dot de
Subject: [Bug ld/14915] --copy-dt-needed-entries not working
Date: Tue, 04 Dec 2012 14:56:09 +0000


--- Comment #8 from Michael Matz <matz at suse dot de> 2012-12-04 14:56:09 UTC 
Let's create a different testcase showing also similar symptoms of not
correctly adding DT_NEEDED entries as documented, this time to search scopes:

% cat bla.c
extern double sin (double);
double f (double i) { return sin (i); }
% gcc -c -fPIC bla.c
% ./ld/ld-new -shared -o libt1.so bla.o -lm -zdefs
% readelf -d libt1.so | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]

Everything fine so far.  Now we want to generate libt2 also referring
to a libm function, want to link it only with libt1 and expect that
there's some way to include libm into the search scopes with some option to ld.
 The documented option is --copy-dt-needed-entries, so:

% cat bla2.c
extern double f (double);
extern double sin (double);
double g (double i) { return f(i) + sin (i); }
% gcc -c -fPIC bla2.c

So, bla2 refers to functions of libt1 and to libm, but still:

% ./ld/ld-new -shared -o libt2.so bla.o --copy-dt-needed-entries -L. -lt1 -z
bla2.o: In function `g':
bla2.c:(.text+0x22): undefined reference to `sin'

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]