• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 522
  • Last Modified:

How do you relink an existing .so?

Alright, you people who link you know unix .. time to see what yur all about. ;)
Actually, I'm not even sure if this is possible, but ldd seems to indicate that some shared object file I have that I got from a third party as an API for one of their products can't find any of the symbols in libc.so .... ie, I get

$ ldd -r foobar.so

symbol not found: putf            (./foobar)
symbol not found: printf      (./foobar)

etc, etc  for another 300 or so lines (it prints an error everytime it encounters a referenace, even if it's complained about that symbol not having been found before) ..... my LD_LIBRARY_PATH is set, but from my understanding, there is no way this .so should be blind to any of the libc symbols .. so why is it? How can I fix it?

(Heh, I'd offer more for the answer, but I only got 35 points left. Besides, you do it for the prestige, don't ya? ;)
0
notanexpert
Asked:
notanexpert
  • 4
  • 2
1 Solution
 
notanexpertAuthor Commented:
Oh, by the way, I'm running Solaris 2.5.1.
0
 
Rajkumar_RCommented:
Using the -d or -r  option  with  shared  objects  can  give
misleading  results.   ldd does a ``worst case'' analysis of
the shared objects.  However, in practice some or all of the
symbols  reported  as unresolved can be resolved by the exe-
cutable file referencing the shared object.                      

Succeeds quietly if dependencies do not exit.  

This is a part of the man page for ldd. Just remove the -r option and those messages should go away.    
0
 
notanexpertAuthor Commented:
I'd give you the points, but I already knew this ... I was wondering if there /was/ a way of directly linking an .so so I don't even have to be concerned about whether the executable is picking up the symbols.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
rgmisraCommented:
Well, this won't effect what ldd returns, but may effect running
programs. Setting the LD_PRELOAD variable will fore the dynamic
linker to link in a specific object/library. You may also be able
to use an /etc/ld.preload file, although I'm not sure Solaris
supports this.
0
 
notanexpertAuthor Commented:
Well, here ya go. Not too bad. It actually ended up not mattering in the end .. I got it working, and ldd will still complain if I check it for symbols.

Anywho, the info wasn't bad. Thanks.
0
 
rgmisraCommented:
Thank you! What did the problem turn out to be?
0
 
notanexpertAuthor Commented:
A stupid permission problem ... when the webserver loaded the .so, the .so's working directory was that of the web server .. not where it was residing in the directory structure. And my .so was trying to write to it's pwd .. which ended up being not where I thought it was, and consequently didn't have the permissions I thought it did. :)

Turns out just becaose ldd can't find those symbols, it's not a problem .. the .so finds them when it's loaded anyhow. <shrug> :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now