Dynamic loader taking function from wrong lib


 
Thread Tools Search this Thread
Top Forums Programming Dynamic loader taking function from wrong lib
# 1  
Old 01-08-2008
Dynamic loader taking function from wrong lib

Hi,

I have two dynamically loaded libraries (shared objects), both of which include functions of the same name - foo. When I call 'foo' from libA, it takes it from libB, although it is implemented in libA as well. Since we need the function to be called from libA, we tried linking it with the flag -bSymbolic, to no avail. It still called the function from libB.

Specifics: Working on HP 11.23, compiling with HP gdb 5.7.4.

Background: In this case libA is an ODBC driver we've written. libB is the unixODBC driver manager. The way these works is that in our driver we implement a set of SQLxxx functions, which have the same names as the set of functions in the driver manager. When the driver manager loads our ODBC driver, it knows to call the SQLxxx functions from our driver. Our problem is in a case where we call our own SQLxxx function from within our own driver, and it calls the function from the driver manager instead!

Ideas?

Thanks.
# 2  
Old 01-29-2008
Problem resolution – for anyone interested.
The problem was finally solved by -Bsymbolic, but it was in a roundabout way.
We are working on HP and when we ran into the problem we were compiling with gcc. We tried adding –Bsymbolic to the gcc command but it didn’t help. We then tried adding –W1,Bsymbolic in order to pass the option to the linker, but this didn’t help either.
Now we have moved to compile with HP’s native aCC, for reasons that are unrelated to this problem. With aCC when we gave it –W1,Bsymbolic the library’s symbols were finally taken locally.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wrong parameters are taking

Hi All, Could you please assist the below query :- had created the below script to print the below content email, however the instance now is not displaying correctly and it is print the wrong instance name. Please find the below code for errors.sh , in this script had written the code as... (7 Replies)
Discussion started by: venkat918
7 Replies

2. Shell Programming and Scripting

Wrong test interpretation for simple function.

Hello everyone, I have written simple script below to check if ip is added to interface #!/usr/local/bin/bash IFCONFIG="/sbin/ifconfig" SERVICE="/usr/sbin/service" IP="79.137.X.X" GREP=$(${IFCONFIG} | grep ${IP}) ip_quantity_check () { echo ${GREP} | wc -l } if ];... (2 Replies)
Discussion started by: bryn1u
2 Replies

3. Shell Programming and Scripting

Python - Function print vs return - whats wrong

All, I have a basic buzz program written in python with return function. If i change return with print,it works fine but i want to know whats wrong with return statement.Can anyone help me whats wrong with this #!/usr/bin/python def div4and6(s,e): for i in range(s,e+1): if... (5 Replies)
Discussion started by: oky
5 Replies

4. Solaris

Wrong ELF data format: ELFDATA2MSB at /usr/perl5/5.8.4/lib/i86pc-solaris-64int/DynaLoader.pm

We are trying to install our project on solaris 10 x86 machine. we are getting the following error. Can't load '/u01/apps/WatchMark/FlexPM//R39FOA1/sw/perl/lib/auto/DBI/DBI.so' for module DBI: ld.so.1: perl: fatal: /u01/apps/WatchMark/FlexPM//R39FOA1/sw/perl/lib/auto/DBI/DBI.so: wrong ELF data... (3 Replies)
Discussion started by: Jagandadi
3 Replies

5. Shell Programming and Scripting

Whats wrong in the Function ?

Need your assistance, to find the bug in the function. Function usage erroring out even after passing parameters. usage() { if || ; then echo "************************************************************" echo " CHECK USAGE FOR CORRECT PARAMETERS ... (26 Replies)
Discussion started by: raghunsi
26 Replies

6. Shell Programming and Scripting

Function returns wrong values - solved

Hi I have a small function which returns a wrong value. The function tries to make a connection to oracle database and tries to get the open_mode of the database in the variable status. However when a database is down the value of the status column is set to READWRITE i am not sure why. I... (0 Replies)
Discussion started by: xiamin
0 Replies

7. Programming

what is wrong with the log function in c?

Hi I looked up the reference but couldn't figure out whats wrong with my log funtions in ANSI C, need this log functions for a memory compiler, please help!! #include <stdio.h> #include <math.h> int main(void) { double d ; double logB(double x, double base); printf(" ... (2 Replies)
Discussion started by: return_user
2 Replies

8. Shell Programming and Scripting

Wrong date function

Hi, I am getting some very strange output when using date function in PERL on Solaris. Infact the month portion is wrong and it is 1 less then the current, means today it is responding as month =3 , andthis should be 4 ------> April Any help my code is ($day, $month, $year) =... (3 Replies)
Discussion started by: Asteroid
3 Replies

9. Shell Programming and Scripting

Whats wrong with my function?? <newbie>

First of all im using Bash, on a Debian-based machine. I tried to write a function that if the ls program found listed more than 25 lines I would automaticly use "ls | less". Its on another computer but if I recall it looked something like this... Note: some code may look strange because im on... (4 Replies)
Discussion started by: riwa
4 Replies

10. Programming

HOw to load dynamic lib from a statically linked program ?

I need to load a dynamic library from a statically linked program. Is there a way without recompiling my program. when i try to do that my program just crashes. If not possible, how can I avoid crashing the program when i try to load the dynamic lib, again without recompiling. If my... (1 Reply)
Discussion started by: disclaimer
1 Replies
Login or Register to Ask a Question