Evening sluggers,

I have a rather obscure question that my google-fu has yet to yield
and answer to and was hoping that someone could shed some light on it.

Firstly I must explain how our environment works, we use a lot of FOSS
libraries and for the sake of backwards compatibility we keep them in
their own little sub namespace and link or install them into a central
location for the ease of our use.

it looks a bit like <somepath>/bar/<version>/{lib,include,share} so
we can have multiple libbar's co-existing.

For simplicity we then take bar/<version>/lib/libbar.so.<version> and
install into a central LIB directory. For some historic reason when
we do this the libraries are renamed to libbar-<version>.so.

this name change can be an issue and rather than going against the grain
I'd like to get it working as is. So, here's the question, does anyone
know a non hexedit or binary sed hackery way to change link targets in a an elf binary.

In essence I want to change

$readelf -d foo.so  | head -n 3
Dynamic segment at offset 0x36c0 contains 37 entries:
  Tag        Type                         Name/Value
0x00000001 (NEEDED)                     Shared library: [libbar.so.4.2]

to

0x00000001 (NEEDED) Shared library: [libbar-4.2.1.so]

with out re-linking the whole thing.

I have a need to include the minor version into the library name so
simply symlinking it out of the question.

Given that this information is stored in .dynamic section in the elf
my cunning plan was to create my own .dynamic section based on the
current one and append it to the binary and rewrite the elf header
and simply ignore the existing .dynamic.


any marvellous ideas ?

cheers

--alex

--
[----------------------------------------------------------------------]
 Alex Sayle                                     [EMAIL PROTECTED]


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to