Solved

How do you relink an existing .so?

Posted on 1998-07-17
7
477 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 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