Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jun 2003 06:38:29 -0700
From:      Joe Kelsey <joek@mail.flyingcroc.net>
To:        "\"Brandon S. Allbery \"KF8NH" <allbery@ece.cmu.edu>
Cc:        questions@freebsd.org
Subject:   Re: Tools to modify shared libraries
Message-ID:  <3EEF19D5.9040706@mail.flyingcroc.net>
In-Reply-To: <1055804020.79093.2.camel@rushlight.kf8nh.apk.net>
References:  <3EEE4717.2090409@mail.flyingcroc.net> <1055804020.79093.2.camel@rushlight.kf8nh.apk.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Brandon S. Allbery KF8NH wrote:
> On Mon, 2003-06-16 at 18:39, Joe Kelsey wrote:
> 
>>Has anyone ever come across general-purpose tools for modifying shared 
>>libraries?  What I want to do is to edit the list of "needed" shared 
>>libraries to correct the common mistakes that developers make in 
>>creating shared objects with large lists of shared libraries.
> GNU objcopy --- but it's a bit *too* general; you'd need to extract the
> .dynamic section, edit it using some binary editing tool, and re-add it.

I have tried and failed... I even looked at the code.  objcopy is
horrible as far as it goes.  Maybe if I could learn more about bfd in
general, there might be something I could do with objcopy, but it does 
not look promising.

> I doubt there are any tools of the kind you're looking for because the
> details are too different between different systypes; even if someone
> had developed one, it's just as likely to be for Linux or Solaris as for
> *BSD, and as a result wouldn't be particularly useful.

All 32-bit Elf libraries look the same as far as the DT_NEEDED entries
in the DYNAMIC section.  In fact, *all* ELF libraries look the same
relative to the size of the string table offset used for entries.  The
DYNAMIC section is the simplest of all sections, generally consisting of
a tag and a value, both in the native word size (e.g., 32 or 64).  I am
surprised that no one has done this yet.

I tried elfsh, but the version in ports is too old.  I got the most 
recent version from the website, but it has a lot of linuxisms in it.

Basically, what I want to do is remove several entries from the *front* 
of the dynamic section.  Actually, I would settle for just removing all 
of a certain tag (such as DT_NEEDED) from the dynamic section.

/Joe








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EEF19D5.9040706>