Directories Searched by the Runtime Linker

unix

    Next

  • 1. HP OpenView/Network Node Manager
    Where I work is evaluating moving our current Network Node Manager & OpenView operations server from HP-UX on a rp2470 to Solaris on SPARC. We're evaluating a v245 or T2000. Which ever is the better of these two will be compared against staying HP and buying a rx2660 with a single dual core CPU. Does anyone have any experience with Network Node Manager/OpenView on Solaris? Anyone running it successfully on a T2000? We are currently monitoring 1300 networks containing 17,000 interfaces.
  • 2. e4500 does not recognise internal cd-rom
    hi all, I bought a secondhand E4500 but a probe-scsi-all doesn't show the internal cdrom and scsi disk. Any hints on how to find out what the problem could be? thanks in advance for all help.
  • 3. Firefox - where to set helper applications?
    Sorry, this is not really Solaris specific, but I hope someone here will know. I have Solaris 10 update 4, and have the included distribution of Firefox: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.4) Gecko/20070622 Firefox/2.0.0.4 Does anyone know how I can configure this to launch an application if one tries to download a specific file type? If I click 'preferences' on the Edit menu, the 'Content' tab gives me the option of 'Configure how Firefox handles certain types of files', but there is only PDF and SWF set, and I dont see how I can add any of my own. I want to configure Mathematica to launch when a file with the extension .nb is downloaded - better still would be the option to open it or save it.
  • 4. Limit logging in to certain users
    Is there a way to propagate accounts to different servers, but limit who can login to those servers? For instance, only administrators should login, not regular users. I thought about created a second NIS domain and only putting the servers/accounts on it, but there must be another way. Thanks
  • 5. Multiple fdisk partitions on a USB memory stick
    Hi, Can volfs handle USB mass memory with multiple fdisk partitions For a USB memory stick I have the following partition table: 1 Active Solaris2 1 857 857 90 2 FAT16 LBA 858 952 95 10 and I have created fat and ufs file systems on these two partitions. I can mount both partitions manually when volfs is disabled: mount -F ufs /dev/dsk/c4t0d0s0 /export/xufs_usb mount -F pcfs /dev/dsk/c4t0d0p2:c /export/xfat32 but when I have volfs running and plug in the usb stick it looks like only the fat partition gets automounted under /rmdisk/<Label name> and I don't seem to get the ufs partition mounted at all. On the other hand, if I try to mount /dev/dsk/c4t0d0s0 manually I get messages about device already mounted although mount does not show it as mounted. I'm running: Solaris 10, 11/06 X86 Is this a known limitation in volfs or am I doing something wrong in the file system creation ? I have a solaris disk label on the solaris partition and it has two slices (s0, s2). Any suggestions would be appreciated, Karl D

Directories Searched by the Runtime Linker

Postby joeware » Sun, 12 Aug 2007 05:42:47 GMT

I'm using Solaris 8. I have a shared object, whose the RUNPATH was set
with -R <path> options at compile time.  I'm using "ldd -s <lib.so>"
to view its link directory search order.

It tries:
-"."
-Each directory in $LD_LIBRARY_PATH
-Each directory in the RUNPATH

I don't understand why the "." is there.  "." is not in
$LD_LIBRARY_PATH.

For a test, I set $LD_LIBRARY_PATH to nil. Now, "." is no longer
tried, only RUNPATH

Where is "." coming from when $LD_LIBRARY_PATH is not empty?  And why
is it gone when I first set $LD_LIBRARY_PATH to nil.


Re: Directories Searched by the Runtime Linker

Postby andrew » Sun, 12 Aug 2007 05:49:01 GMT

In article < XXXX@XXXXX.COM >,
	 XXXX@XXXXX.COM  writes:

My guess is you have an empty field at the beginning
of LD_LIBRARY_PATH, i.e. it starts with a colon.
Remove any leading/trailing colon.

-- 
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]

Re: Directories Searched by the Runtime Linker

Postby joeware » Sun, 12 Aug 2007 07:31:29 GMT

>

Yes, there was a colon in the front.  I'm not familiar with this
enough to know why a colon does this however.

As to why setting LD_LIBRARY_PATH to nil affect this, when setting up
the LD_LIBRARY_PATH, if it starts as nil some other work isn't done
and the colon doesn't get added to the front.  Hence it worked.

Thanks.



Re: Directories Searched by the Runtime Linker

Postby Rich Teer » Sun, 12 Aug 2007 08:01:05 GMT




Unless you have good reason not to do so, LD_LIBRARY_PATH should almost
never be set, especially across a login session.  The only kosher use I
can think of is in the instance of a developer testing a new version of
a library.  If poorly built apps require the use of LD_LIBRARY_PATH (and
apparently they do exist), a wrapper script should be used, to set it
and then execute the errant app.

-- 
Rich Teer, SCSA, SCNA, SCSECA, OGB member

CEO,
My Online Home Inventory

URLs:  http://www.**--****.com/ 
       http://www.**--****.com/ 

Re: Directories Searched by the Runtime Linker

Postby Tim Bradshaw » Tue, 14 Aug 2007 20:46:22 GMT




It does it because LD_LIBRARY_PATH is a colon-separated list of
directory names.  So foo:bar means: search "foo", then "bar",
while :foo:bar means search "" then "foo" then "bar".  I agree with
what Rich said about not using LD_LIBRARY_PATH (let alone using it
with relative pathnames, specifically the empty one) except from
wrapper scripts.

--tim


Similar Threads:

1.runtime linker failing to load symbols on some machines

Hello,

I'm having an odd problem where an executable fails to find a symbol
in a shared library.  The missing symbol is the map of maps x3 seen
in the header below.

Using the exact same executable and library, the problem is only seen
on some of our machines.  The 5.1 ML4 machine that it is compiled
on fails to load the object, another 5.1 and now a 5.3 base
level machine.  But it runs on a 5.2 and other 5.3 ML1 machines.
This code has been around for a while and has only started showing
having rtl errors in recent builds.

Any help would be appreciated.

TIA

Gary Bak

Here is the last part of the error and the files below:

<...snip>
_5_Node_v was referenced
      from module ./libtestShared.a(testShared.o), but a runtime
definition
      of the symbol was not found.

rtld: 0712-002 fatal error: exiting.


--------------------File: testLib.h -------------------
#include <map>
#include <string>
#include <vector>

void test();

std::map<std::string, std::map<std::string, std::map<std::string,
std::vector<unsigned int> > > > mapCacheOffsetByConfigSectionAndKeyID;

--------------------File: testLib.cpp -------------------
#include "testLib.h"
void test()
{

}

--------------------File: main.cpp -------------------
#include "testLib.h"
main()
{
   test();
}

--------------------File: Makefile -------------------
CPP             = xlC_r
AR              = ar

%.o:    %.cpp
        $(CPP) $(CPPFLAGS) $(BUILD_OPTIONS) $(ADD_OPTIONS)
$(INCLUDE_PATH) $(ADD_INCLUDES) -c -o $@ $<

libtestLib.a:   testLib.o
        rm -f $@
        $(AR) rcs $@ $<

testShared.o:   libtestLib.a
        $(LD) -r -o tmp.o -L. -ltestLib
        $(CPP) -G  -bernotok -qtwolink -qnamemangling=v5 -qmkshrobj
-bloadmap:loadmap.out -o$@ tmp.o

libtestShared.a:        testShared.o
        $(AR) -rv $@ $<

runme:  main.o libtestShared.a
        $(CPP) -brtl -qtwolink -bloadmap:loadmap.out -o$@ main.o -L. -l
testShared

all:    runme
clean:
        rm -f *.a *.o

2.Runtime linker reports missing symbols

I'm getting this error from the runtime linker when I launch my executable:

rtld: 0712-001 Symbol _Init__Q2_3std5_TreeX...<snip> (over 2048 chars)
      from module /services/Development/Build/Server/Lib/libPersistence.a
      (AccountSimplePersistenceCache.o), but a runtime definition of 
      the symbol was not found.

There are about 27 more of these errors, most with different symbols but all 
from the same shared object, AccountSimplePersistenceCache.o.

I did an nm on the shared object, but it is impossible to find the missing
symbol by hand.  The symbol spit out by the rtld is also mangled and I'm 
unable to demangle it.

There are 33 other shared objects in the libPersistence.a archive, all 
built the exact same way as the failing object and I don't see any errors 
from the other objects.  I'm not sure if this is just the first, or if 
it's the only one with problems.

I do not have this problem when I build the objects without the -O compiler 
option.

I'm using an updated version of the 5.0.2 compiler.  IBM sent me a 
compilerPTF instafix to enable me to compile code with the -O option, and 
I'm not sure if the problems are related.

I'm building the shared object from an object archive based on a tip 
I saw in the document C_and_C++_Application_Development_on_AIX:

ld -r -o tmp.o -L<bla bla> -lAccountSimplePersistenceCache 
                                 -l<various libs to satisfy link>
xlC -G -qmkshrobj -bloadmap:loadmap.out  -oAccountSimplePersistenceCache.o 
                                             tmp.o -l<same here>


I've killed a day on this problem and I'm no closer to a solution now.

Any help would be appreciated.


Gary

3.Looking for some help understanding action of the runtime dynamic linker

Application A , a 32 bit application, is linked with -R
/path/to/vendors/32/bit/library -L/path/to/vendors/32/bit/library
-lclient

Before the application runs, a tool is run that sets a series of
environmental variables, including making certain that LD_LIBRARY_PATH
contains all necessary directories. This includes
/path/to/vendors/library .

In the path, that library was 32 bit. With the latest generation of
software, /path/to/vendors/library happens to be a 64 bit set of
libraries with the identical name to the 32 bit libraries.

The weird thing we are seeing is that ldd isn't pointing (incorrectly)
to the 64 bit libraries, but instead appears to be ignoring the
LD_LIBRARY_PATH and pointing to the 32 bit versions of the libraries.

I've read the ld, ld.so.1, and crle man pages, but it doesn't really
cover this level of complexity. Good old vendor shared libraries...

My hypothesis is that as the runtime linker goes looking, it realises
it is dealing with a 32 bit application, and so ignores the 64 bit
libraries and keeps looking.

Does that make sense?

4.Looking for some help understanding action of the runtime dynamic linker

Rich Teer wrote:
> On Tue, 1 Aug 2006, Larry W. Virden wrote:

>
> > Before the application runs, a tool is run that sets a series of
> > environmental variables, including making certain that LD_LIBRARY_PATH
> > contains all necessary directories. This includes
> > /path/to/vendors/library .
>
> Well for starters, LD_LIBRARY_PATH should be empty (not even defined);
> by using -L and -R, it looks like the app is built correctly.


Alas, not my decision. System admins set the path so that vendor
programs, etc. do not generate an error when applications are executed.

Or are you saying that during the compile step, one should empty the
LD_LIBRARY_PATH?



>
> > In the path, that library was 32 bit. With the latest generation of
> > software, /path/to/vendors/library happens to be a 64 bit set of
> > libraries with the identical name to the 32 bit libraries.
>
> Those 64-bit libs shouldn't be there; they should be in a subdirectory
> called 64 (so /path/to/vendors/libs/64).

I agree. Alas, what the vendor ships is what I have, and given the size
of the vendor, and my past requests for things like specifying
subdependencies when they create the libclnt library, etc. apparently
being ignored, I face dealing with the reality, rather than the ideal.


>
> > My hypothesis is that as the runtime linker goes looking, it realises
> > it is dealing with a 32 bit application, and so ignores the 64 bit
> > libraries and keeps looking.
>
> That could be the case.

Thanks for looking over it. Is there a manual or a tutorial to which I
could refer the vendor, etc. with (doomed to disappointment) hope they
might decide that the world doesn't revolve around the O* database
environment?

5.find files in one directory to use to search through another directory

HI,
I'm a beginner to intermediate user.

Here's what I am trying to do. I have a directory (call it X) with many
sub-directories with many .h files.
I want to use the names of the .h files in directory X to search
through another directory (call it Y) and see where the .h files from X
are included in the .h and .cpp files in Y.

In directory X I used the following command to find all the .h files:
find . -name "*.h"

The above command generates a list of all the .h files, but with the
path name. I don't want the path names, only the name of the file.h

Then I want to do a grep in directory Y and search in every .cpp and .h
file in Y to see if any of the .h files from X are used.

Thanks
Jami

6. Compiler/Linker option to search for .so library

7. Linker Default Search Path Additions

8. Mozilla Upgrade: Cannot find runtime directory



Return to unix

 

Who is online

Users browsing this forum: No registered users and 94 guest