public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Linking against shared library linked to another shared one, please help
@ 2005-03-10 15:34 matteo.pampolini
  2005-03-10 16:00 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: matteo.pampolini @ 2005-03-10 15:34 UTC (permalink / raw)
  To: binutils

Hi there,

I know this topic was already discussed on this mailing list, but the
answers I found
didn't satisfy my issue.

Ok, suppose a C app links against shared libAAA that in turns links against
libBBB:
why should I tell app of libBBB presence?

If I want to hide the implementation of libAAA and eventually later change
it, I should be
able to avoid putting this information inside app compilation process,
isn't it?

I had a look at ld man page in -rpath-link section, but it seems to me that
it doesn't
fit my needs.

Could please someone help me?

Many thanks in advance,

Matteo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linking against shared library linked to another shared one, please help
  2005-03-10 15:34 Linking against shared library linked to another shared one, please help matteo.pampolini
@ 2005-03-10 16:00 ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2005-03-10 16:00 UTC (permalink / raw)
  To: matteo.pampolini; +Cc: binutils

matteo.pampolini@seleniacomms.com writes:

> Ok, suppose a C app links against shared libAAA that in turns links against
> libBBB:
> why should I tell app of libBBB presence?
> 
> If I want to hide the implementation of libAAA and eventually later change
> it, I should be
> able to avoid putting this information inside app compilation process,
> isn't it?
> 
> I had a look at ld man page in -rpath-link section, but it seems to me that
> it doesn't
> fit my needs.

Why not?

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linking against shared library linked to another shared one, please help
  2005-03-10 16:22 matteo.pampolini
@ 2005-03-10 22:39 ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2005-03-10 22:39 UTC (permalink / raw)
  To: matteo.pampolini; +Cc: binutils

matteo.pampolini@seleniacomms.com writes:

> But my problem is not the linker warning, is the fact that the app doesn't
> link at all
> because of unresolved symbols (the ones implemented inside lb).

Does liba have a DT_NEEDED entry for libb?  You can find out using
objdump -p.

If you force the program to link using --allow-shlib-undefined, is it
possible to run the resulting program?  That is, does the dynamic
linker succeed and does the program run?  In particular, try it with
the LD_BIND_NOW environment variable set.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linking against shared library linked to another shared one, please help
@ 2005-03-10 16:22 matteo.pampolini
  2005-03-10 22:39 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: matteo.pampolini @ 2005-03-10 16:22 UTC (permalink / raw)
  To: binutils

matteo.pampolini@seleniacomms.com writes:

> because I was not able to understand how to use it, could you please help
> me?

Please send a message to the mailing list (not just to me) explaining
what you thought would happen, and what happened that was different.

Basically if the linker sees that -la requires -lb (has a DT_NEEDED
entry for -lb), the linker will search for -lb using directories named
in -rpath-link.  If it finds the library, all should be well.  If it
does not find the library anywhere, it will issue a warning.  This
warning is intended to tell you that your program will not execute
because the dynamic linker will not be able to find -lb.

 Ian

But my problem is not the linker warning, is the fact that the app doesn't
link at all
because of unresolved symbols (the ones implemented inside lb).

Thanks,

Matteo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-10 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 15:34 Linking against shared library linked to another shared one, please help matteo.pampolini
2005-03-10 16:00 ` Ian Lance Taylor
2005-03-10 16:22 matteo.pampolini
2005-03-10 22:39 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).