[Gllug] pimping my elf

Daniel P. Berrange dan at berrange.com
Wed Jun 14 14:06:57 UTC 2006


On Wed, Jun 14, 2006 at 02:37:31PM +0100, Alex Sayle wrote:
> 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.

I assumed you've already tried the simple symlink  "libbar-4.2.so" => 
"libbar.so.4.2", or vica-versa ?   Since everything is versioned you
shouldn't get any file name clashes by having both filename schemes 
present in your central LIB dir ?

Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20060614/3c96b752/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list