Search code examples
cshared-librariesaixdbx

Shared object load in AIX?


I have a C program hello.c. I created a shared object hello.so.

hello.c and hello.so are in directory /u/grv/program/hello.c /u/grv/objects/hello.so respectively

LIBPATH is set to /u/grv/objects:$LIBPATH

when i use dbx to debug the code..dbx asks me to choose from a list of two so..

In all the directories of LIBPATH there is only one "hello.so" file..so where is the secound "so" file coming from?

here is the screen shot of dbx session:

(dbx) stop on load "hello.so"
[1] stop on load "hello.so"
(dbx) c
stop:   loaded /u/grv/object/hello.so
[1] stopped in uload at 0x9fffffff0002024 ($t1)
0x9fffffff0002024 (uload+0x104) e8410028          ld   r2,0x28(r1)
(dbx) stop in hello
1. hello.hello
2. glink64.hello
Select one or more of [1 - 2]:

Additional information: genkld command does not the hello.so .. that means its not loaded..is this the reason why it is asking me to select..or there is any other reason..?

How to load a shared object so that it is shown in genkld list?


Solution

  • it is obvious that the library glink64 also contains an entry point called hello.

    You might try changing the function name from hello to something more unique, then have your application call this new unique function name

    I'm not familiar with the genkld utility so cannot help you there