Please login or register. October 17, 2017, 08:35:54 PM

Author Topic: XCOFF and LIBPATH  (Read 777 times)

0 Members and 1 Guest are viewing this topic.

Jimmy

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
XCOFF and LIBPATH
« on: November 18, 2016, 02:09:09 PM »
Hi everybody,

Is there a way to change the library path of a shared library ?

patchelf for xcoff exists ?

Did IBM have an executable to edit the field "l_impidpath" of the "Loader Import File ID Name Table" ?
http://www.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.files/XCOFF.htm

(In fact, I'm rephrasing the same question three times.)

I hate environment var sush as LIBPATH, so I would like to edit the so to store the right pass of the dependencies.

Thanks.
J.


Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: XCOFF and LIBPATH
« Reply #1 on: November 21, 2016, 11:31:06 AM »
Hi,

a) are you compiling yourself, or
b) using something you downloaded/purchased?

In the case of a) adding -L/some/lib/path will add /some/lib/path to the path's that the rtld looks at.

As to a program to just change that value in a executable or shared_library header - I must look further.

FYI: the link into the InfoCenter (err, Knowledge Center these days) does not help me understand your question. In fact it makes me think you may have a 64-bit application that is finding 32-bit shared libraries (actually not finding anything).

A couple of commands will help me understand what you are facing.

a) ldd /the/program/not/loading
b) dump -X32 -H /the/program/not/loading
c) dump -X64 -H /the/program/not/loading

And it is a shared library you are having trouble with change /the/program/not/loading to /the/library/not/loading

Jimmy

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
Re: XCOFF and LIBPATH
« Reply #2 on: November 21, 2016, 12:53:33 PM »
I found the solution.

rtl_enable -X64 -R <binary> -blibpath:<lib dir> -bbigtoc

to check:
dump -H -X64 <binary> | grep "^0 .*" | awk '{print $2}'
« Last Edit: November 21, 2016, 01:45:19 PM by Jimmy »

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +0/-0
Re: XCOFF and LIBPATH
« Reply #3 on: November 21, 2016, 06:33:46 PM »
Thanks for sharing - a new command for me! rtl_enable