.so dynamic library mangling tool

Steve Harvey sgh-Ja3L+HSX0kI at public.gmane.org
Mon Dec 6 02:42:53 UTC 2004


On Sun, Dec 05, 2004 at 06:18:56PM +0200, Peter L. Peres wrote:
> 
> ld -shared -fpic -soname=libZ.so.6 ... -o /lib/hacked/libc.so.6 would work 
> great imho.

  I was going to suggest using ld in this manner, however when I try
copying a test library (adding a NEEDED entry), the filesize shrinks
dramatically (to 8% of its original size!).

ld  -shared -fpic -lz  --whole-archive libe2p.so.2.3 -o /tmp/libe2p2.so.2.3 
ls -l libe2p.so.2.3 /tmp/libe2p2.so.2.3

-rwxr-xr-x    1 sgh      users        1380 Dec  5 21:13 /tmp/libe2p2.so.2.3*
-rwxr-xr-x    1 root     root        16696 Dec 10  2002 libe2p.so.2.3*

  A good idea of the amount of lost metadata can be shown by  readelf -a
run against each one.  From just the size difference, I was loath to
recommend such an approach.  Since Sergey is running Gentoo, I didn't
think it would be untoward to suggest rebuilding a library (as a non-
root user to be safe).

> 
> ld can concatenate as many libraries as you need.
> 
> Peter
> --
> The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list