Solved

How do you relink an existing .so?

Posted on 1998-07-17
7
422 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

896 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

14 Experts available now in Live!

Get 1:1 Help Now