Solved

How do you relink an existing .so?

Posted on 1998-07-17
7
435 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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