This is the mail archive of the 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]


On Fri, 18 May 2001 17:48:38 +0930 wrote:

> I suspect some of your recent changes to elflink.h are in 
> violation of the ELF spec.
> says:
> "Names in the dependency list are copies either of the DT_SONAME strings
> or the path names of the shared objects used to build the object file.
> For example, if the link editor builds an executable file using one
> shared object with a DT_SONAME entry of lib1 and another shared
> object library with the path name /usr/lib/lib2, the executable file
> will contain lib1 and /usr/lib/lib2 in its dependency list.

Having been the "bug" reporter I feel obliged to speak up.

On reading the above referenced spec. closely, I am inclined to 
agree with Alan Modra. Also it seems to me that the linker, prior
to HJ's fix has been behaving in accordance with the spec. In 
other words, it was adding the full path names of .so files to 
the dependency list of the linked output since they *did not*
have DT_SONAME strings.

With this background, (where we don't use HJ's patch) consider the
following scenario. Assume I have a couple of shared objects (say and that were built without DT_SONAME entry (i.e.,
have no name). I'd like to use these to rollup my own SO - say  I know that when I use, I'll ensure that
and will be in my LD_LIBRARY_PATH and in a place other than
they were at the time of building How do I instruct the
linker NOT to place the full path names of and in
DT_NEEDED entries of I tried using both the following

gcc -shared -o foo.c /full/path/to/  /full/path/to/

as well as 

gcc -L/full/path/to -shared -o foo.c -la  -lb

but got the full path of and listed in the dependency
list of

Although a couple of possibile "solutions" come to mind, I am
wondering if this is even a problem and if I am missing something
obvious to achieve what I want - i.e., choose which file's full path
name should be in the dependency list and which shouldn't _in case 
the input SO's do not have a DT_SONAME entry._

Thanks in advance for all the help,


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