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. Specifically, I want to modify linux-flashplugin6/libflashplayer.so to remove all of the idiotic references to shared libraries that the Flash 6 developers added. Since this is a plugin for Mozilla, it does not need to specify any extra shared libraries especially since Mozilla has already loaded all of them! I want to do this to make Flash 6 work with flashpluginwrapper. If I can remove the list of needed shared libraries from the DYNAMIC section of the shared library, everyone will be that much closer to a real flash 6 plugin for BSD. /Joe
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 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. -- brandon s allbery [openafs/solaris/japh/freebsd] allbery@kf8nh.apk.net system administrator [linux/heimdal/too many hats] allbery@ece.cmu.edu electrical and computer engineering KF8NH carnegie mellon university [better check the oblivious first -ke6sls]
Apparently, On Mon, Jun 16, 2003 at 03:39:19PM -0700, Joe Kelsey said words to the effect of;> 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. > > Specifically, I want to modify linux-flashplugin6/libflashplayer.so to > remove all of the idiotic references to shared libraries that the Flash > 6 developers added. Since this is a plugin for Mozilla, it does not > need to specify any extra shared libraries especially since Mozilla has > already loaded all of them! > > I want to do this to make Flash 6 work with flashpluginwrapper. If I > can remove the list of needed shared libraries from the DYNAMIC section > of the shared library, everyone will be that much closer to a real flash > 6 plugin for BSD.I've needed to do similar things to remove the interp section from static binaries with full dynamic symbol tables. I just wrote a C program that mmapped the elf file, parsed the headers and changed the p_type of the PT_INTERP program header entries to PT_NULL. You may be able to do something similar by changing the d_tag of the DT_NEEDED entries to some value larger than DT_COUNT so they will be ignored by the dynamic linker. Jake