This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: --as-needed handling of shared libraries that fail -Wl,-z,defs


On Fri, May 20, 2005 at 07:23:49PM +0930, Alan Modra wrote:
> On Thu, May 19, 2005 at 06:37:16PM +0200, Jakub Jelinek wrote:
> > --as-needed doesn't seem to try satisfy undefined references in shared
> > libraries:
> 
> No, as the ld doc says it "causes DT_NEEDED tags to only be emitted
> for libraries that satisfy some symbol reference from regular objects
> which is undefined at the point that the library was linked."

Ok, fine, no problem with that.  But in that case we should issue
an error about unsatisfied references.

gcc -o /tmp/nothing{,.c} -Wl,-u,readline -lreadline
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `BC'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `PC'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status

gcc -o /tmp/nothing{,.c} -Wl,-u,readline -lreadline -Wl,--as-needed -ltermcap -Wl,--no-as-needed; /tmp/nothing
/tmp/nothing: symbol lookup error: /usr/lib64/libreadline.so.4: undefined symbol: BC

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]