Solved

How do you relink an existing .so?

Posted on 1998-07-17
7
404 Views
Last Modified: 2013-12-26
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
Comment
Question by:notanexpert
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:notanexpert
ID: 1295024
Oh, by the way, I'm running Solaris 2.5.1.
0
 
LVL 1

Expert Comment

by:Rajkumar_R
ID: 1295025
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
 
LVL 1

Author Comment

by:notanexpert
ID: 1295026
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Accepted Solution

by:
rgmisra earned 30 total points
ID: 1295027
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
 
LVL 1

Author Comment

by:notanexpert
ID: 1295028
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
 
LVL 1

Expert Comment

by:rgmisra
ID: 1295029
Thank you! What did the problem turn out to be?
0
 
LVL 1

Author Comment

by:notanexpert
ID: 1295030
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now