[Gllug] pimping my elf

Alex Sayle alexs at alphacomplex.info
Wed Jun 14 13:37:31 UTC 2006


Hello fellow Gllugers,

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.so]

with out re-linking the whole thing.

any marvellous ideas ?

--
[----------------------------------------------------------------------]
  Alex Sayle                                     alexs at alphacomplex.info


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list