Changing executable dependency

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Changing executable dependency
# 1  
Old 02-16-2012
Changing executable dependency

hello,

can anyone help in changing the executable dependency on a certain shared library. eg, .. say i am having an executable by name utest. when i run UNIX ldd command on it then it shows the libraries on which it depends as follows:

Code:
ldd release/utest
release/utest needs:
         /usr/lib/libxnet.a(shr_64.o)
         /usr/lib/libpthread.a(shr_xpg5_64.o)
         /usr/lib/libdl.a(shr_64.o)
         /usr/lib/libC.a(shr_64.o)
         /usr/java6//jre/bin/classic//libjvm.so

Clearly it shows dependency on /usr/java6//jre/bin/classic//libjvm.so

WHat i want is that instead of depending on libjvm.so present in path /usr/java6//jre/bin/classic// , the exe utest should depend of libjvm.so present in any other path. I want to do this on the fly .... Can anyone suggest. Also, the ldd should show dependeny on new libjvm.so after modification.

Any suggestions?
# 2  
Old 02-16-2012
Which "any other path" would you like it to depend on? It has to depend on something. Usually it's the path itself that's generic, a symbolic link that just points to the latest JRE.

What's your system?
# 3  
Old 02-17-2012
Hello,
the path can be anything ..right?

let's say its /root/abc/def/mng/hjf/libjvm.so

I am on AIX 5.3 64 bit ....

---------- Post updated 02-17-12 at 06:53 AM ---------- Previous update was 02-16-12 at 09:28 PM ----------

There are couple of instances that there is no reply to my posts through this forum which i always look up as an expert forum. its strange that even problems which have simpler solutions dont get response within time. I had been observing this for the past 3-4 posts of mine. are the experts not looking frequently at the posts? or have the experts left this forum?

--------------------
btw the above problem gets resolved when you add "appropriate" path to the environment variable "LIBPATH" on AIX.
----------------------
# 4  
Old 02-17-2012
define the environment variable LD_PRELOAD to point to a valid .so, probably in /etc/profile, or in some init script that is relevant to your problem.

Code:
export LD_PRELOAD=/path/to/another/libjvm.so

This will NOT work with setuid exectuable programs.

Okay - now please tell us what problem you are trying to fix, before you do this and break something else. We already know you believe this solves a problem.
# 5  
Old 02-20-2012
actually using LIBPATH on aix solved my problem. how actually LD_PRELOAD maked the difference? is this supported on all platforms?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get the missing dependency from two files

#cat hwlock-full.dep libx11-6 >= 1.4.4 libz1 >= 1.2.7 libtinfo5 >= 5.9 libxcb1 >= 1.8.1 numactl >= 2.0.8+rc4 libpixman-1-0 >= 0.29.2 libxml2 >= 2.7.8 libxext6 >= 1.3.1 libxrender1 >= 0.9.7 libfreetype6 >= 2.4.9 libxcb-render0 >= 1.8.1 libcairo2 >= 1.12.14 libc6 >= 2.15 libxcb-shm0... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

2. Shell Programming and Scripting

Processing Dependency Printing

Gurus, I came across a typical requirement where the input is like- TRANS FIRM DEPT CUST TRANS CUST TRANS DEPT FIRM CUST & the expected Output is- CUST DEPT FIRM TRANS This is basically a dependency list for processing the tables where FIRM is feeding data to TRANS... (3 Replies)
Discussion started by: kapeeljoshi
3 Replies

3. HP-UX

Library dependency coming out of nowhere

I'm building on a HP-UX ia64 system. During building, I'm getting an error ld: Can't find dependent library "libnnz10.so" Nowhere in my makefile do I link with this library. This library is there in the directory /databases/oracle10.2.0_64BIT/lib. I'm having two source files ora8ibulk.cpp... (1 Reply)
Discussion started by: old_as_a_fossil
1 Replies

4. UNIX for Dummies Questions & Answers

make -j dependency

Hi, I had a make file, something like that, all: cd dir1; make cd dir2; make the problem is the makefile under dir2 need some objs from dir1, so I need to set some dependency let dir2 run only after the dir1 run is done. how to set the dependency? Thanks. peter (2 Replies)
Discussion started by: laopi
2 Replies

5. Programming

Fortran dependency checking

Hello, I'm creating an add-on for a large piece of software written in Fortran. In my directory I reference subroutines in other directories, which in turn reference more subroutines. I'm running into trouble because on occasion the developers of the main software change some sub calls. ... (2 Replies)
Discussion started by: kudude
2 Replies

6. Infrastructure Monitoring

Weird dependency problem!

Hi, I want to install net-snmp-devel package but i have following dependecy problem. It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S Could you help me please? Here are the steps: # ls -l total... (4 Replies)
Discussion started by: oduth
4 Replies

7. Solaris

Dependency problem

Hi all am new to solaris ............ i installed amanda client pkg that time am getting lots of dependency problem.......... is there any Yum server like things in solaris Regards ' prAn (8 Replies)
Discussion started by: pran
8 Replies

8. UNIX for Dummies Questions & Answers

Dependency problems with Fedora7

Hey guys, I installed Fedora7 from DVD yesterday. I have previously worked with RHEL4 and Fedora4(As of RPM based systems). I used to copy all the rpms from the media to a directory. #mkdir /rpms #copy /path_to_rpms_in_media/* /rpms/ My intention for doing this was to get around the... (0 Replies)
Discussion started by: tmm
0 Replies

9. UNIX for Dummies Questions & Answers

process dependency

how to find all the processes associated with a given process in unix,is there any command for this. (3 Replies)
Discussion started by: laddu
3 Replies
Login or Register to Ask a Question