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: Motivation for -rpath-link


Hi Nick,

> >> The behaviour is desired because the executable that is being created
> >> is supposed to be able to run without requiring *any* shared
> >> libraries.  ie it is completely self-contained.
> >
> > Thanks for the explanation! However, I still don't understand something.
> > Is "non-shared non-relocatable link" the same as linking of an excutable,
> > as opposed to .so?
>
> Yes.  Well almost.  Strictly speaking a "non-shared, non-relocatable"
> linker output file is a static executable (ie self-contained), which
> does not contain any relocation information and so cannot be altered
> by a run-time loader to execute at an arbitrary start address.

Thanks again. I understood that term in a broader sense.

> > In my case, the excutable is regular dynamically linked one, so
> > grabbing of transitive dependencies is not required. However, ld
> > still tries to do that, and produces the following warning:
> >
> > /usr/bin/ld: warning: a.so, needed by b/bin/gcc/debug/b.so, not found
> > (try using -rpath or -rpath-link)
> >
> > Of course, after I copy executable and all libraries to one
> > location, all dynamic libraries are found -- so I don't understand
> > why 'a.so' is included in link, and what the warning tries to tell
> > me.
>
> Which version of the sources are you using ?  This problem was
> addressed in a recent series of patches that have been applied to the
> sources in the master CVS repository, but which have not yet made it
> into an official release.  So if you are not using the CVS sources I
> would suggest downloading a snapshot and building yourself a new
> linker.

Okay, I'll try to. The warning should go away for dynamic binaries, right?

> The point of the warning message is that the linker is attempting to
> be thorough.  Is sees that b.so needs a.so so it attempts to locate it
> and verify that a.so does indeed supply the information needed by
> b.so.  Since this is only a warning, it should not stop the linker
> from producing an executable, so you can ignore it if you want to.

I thought the warning is harmless, myself. However, since the question arised 
during my work on a build system, I wanted to be 100% sure, in case I'm asked 
by a user.

Thanks for the help,
Volodya


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