On Wed Jun 14, 2006 at 15:56:10 +0100, Alex Sayle wrote:
>
>Evening sluggers,
>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.

Mmm, I think this would be reasonably easy to do by adding
libbar-4.2.1.so to the necessary string table, and then change the
string index appropriately.

I'm not sure if objcopy provides a way to do this. It is coincidental,
that I'm in the middle of putting some release notes to a python
library for screwing around with elf files, which might make it kind
of easy to do. Mail me off-list and I can probably give you a copy of
the code.

Cheers,

Benno
-- 
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