Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-08 Thread Goswin Brederlow

Christopher C. Chimelis [EMAIL PROTECTED] writes:

 On 8 Aug 2001, Goswin Brederlow wrote:
 
  A short add on to mklibs.sh.
  
  As I see it it looks for symbols that are in two files, i.e. ash and
  libm, and includes all matches. It thinks that all symbols that match
  names will be needed in the library.
  
  Unfortunatly that will keep any and all symbols with all duplicates in
  the library, so instead of using libc's math funktions it keeps libcs
  _and_ libms.
 
 Ah, ok.  So, if I understand this correctly, you want to only keep the
 symbols in libc/libm that are needed by the binaries on the boot floppies,
 correct?  If so, I may have a scheme to do this, but I would have to see

Yes and now. mklibs.sh keeps all symbols needed, mklibs.py keeps only
one instance of each symbol needed.

We want that set of instances of symbols that results in a minimum of
space. Thats a NP complete problem, in general. So up to now we made a
few assumptions:

- the problem size is small. :)
- all binaries are roughly linked against the same set of libs
- duplicate symbols can savely be ignored, just pick one
  (thats an extension of the previous one)
- versioned symbols will be ignored, or rather the version tag

 the scripts first (I'll check them out of CVS probably tomorrow) to make
 sure they don't already try that :-)
 
  mklibs.py on the other hand includes each symbol only once. Theres a
  small hack to prefer libc symbols (althout not realy needed since libm
  seems to be after libc) but otherwise its a first come first use basis.
 
 Ok...this script probably does what I'm thinking about then.  Is this one
 working well enough or do you want to shrink it even more?

If we can, sure. But the only thing that I see left si to remove
versioned symbols and leave only the right version or the minimal set
of version required. But does that realy help? Its probably just some
stubs that get removed by that.

Another idea would be to use a smaller (but slower) libc and to
optimize for size.

Currently the root.bin fits, so unless someone adds more the jobs
done, but that just a lazy programmers attitude. :)

MfG
Goswin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-08 Thread Daniel Jacobowitz

On Wed, Aug 08, 2001 at 06:01:27PM +0200, Goswin Brederlow wrote:
  the scripts first (I'll check them out of CVS probably tomorrow) to make
  sure they don't already try that :-)
  
   mklibs.py on the other hand includes each symbol only once. Theres a
   small hack to prefer libc symbols (althout not realy needed since libm
   seems to be after libc) but otherwise its a first come first use basis.
  
  Ok...this script probably does what I'm thinking about then.  Is this one
  working well enough or do you want to shrink it even more?
 
 If we can, sure. But the only thing that I see left si to remove
 versioned symbols and leave only the right version or the minimal set
 of version required. But does that realy help? Its probably just some
 stubs that get removed by that.

Actually, I'd bet it saves more than you think.  However, like I've
said, we don't need a profusion of library reducers.  We should have at
least one packaged independently of the boot floppies.  I'm going to
try to dig up and package MontaVista's (also written in python).  It's
quite complete (and strips out unneeded versions, IIRC).

 Currently the root.bin fits, so unless someone adds more the jobs
 done, but that just a lazy programmers attitude. :)

I'm sure we can find things to add.  We're an industrious bunch that
way :)

-- 
Daniel Jacobowitz   Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-07 Thread Falk Hueffner

Adam Di Carlo [EMAIL PROTECTED] writes:

  P. S. the mklibs.sh libm trick didn't seem to work
 
 Meaning -- didn't reduce far enough?

Yes, it acually doesn't seem to make any difference. With mklibs.sh:

-rw-r--r--1 root root  1743331 Aug  7 18:37 root.bin

total 4273
-rwxr-xr-x2 root root   124160 Aug  7 18:36 ld-2.2.3.so*
-rwxr-xr-x2 root root   124160 Aug  7 18:36 ld-linux.so.2*
-rw-r--r--2 root root   963944 Aug  7 18:36 libc-2.2.3.so
-rw-r--r--2 root root   963944 Aug  7 18:36 libc.so.6.1
-rw-r--r--2 root root  Aug  7 18:34 libcom_err.so.2
-rw-r--r--2 root root  Aug  7 18:34 libcom_err.so.2.0
-rw-r--r--2 root root14608 Aug  7 18:34 libdl-2.2.3.so
-rw-r--r--2 root root14608 Aug  7 18:34 libdl.so.2.1
-rw-r--r--2 root root22904 Aug  7 18:34 libe2p.so.2
-rw-r--r--2 root root22904 Aug  7 18:34 libe2p.so.2.3
-rw-r--r--2 root root90488 Aug  7 18:34 libext2fs.so.2
-rw-r--r--2 root root90488 Aug  7 18:34 libext2fs.so.2.4
-rw-r--r--2 root root   578896 Aug  7 18:34 libm-2.2.3.so
-rw-r--r--2 root root   578896 Aug  7 18:34 libm.so.6.1
-rw-r--r--2 root root70800 Aug  7 18:30 libnewt.so.0.50
-rw-r--r--2 root root70800 Aug  7 18:30 libnewt.so.0.50.17
-rw-r--r--2 root root17504 Aug  7 18:26 libnss_dns-2.2.3.so
-rw-r--r--2 root root17504 Aug  7 18:26 libnss_dns.so.2
-rw-r--r--2 root root34264 Aug  7 18:29 libpopt.so.0
-rw-r--r--2 root root34264 Aug  7 18:29 libpopt.so.0.0.0
-rw-r--r--2 root root86352 Aug  7 18:29 libresolv-2.2.3.so
-rw-r--r--2 root root86352 Aug  7 18:29 libresolv.so.2.1
-rw-r--r--2 root root   132168 Aug  7 18:32 libslang.so.1
-rw-r--r--2 root root   132168 Aug  7 18:32 libslang.so.1.4.4
-rw-r--r--2 root root13488 Aug  7 18:27 libuuid.so.1
-rw-r--r--2 root root13488 Aug  7 18:27 libuuid.so.1.2

With mklibs.py:

-rw-r--r--1 root root  1431323 Aug  7 18:56 root.bin

total 3083
-rwxr-xr-x2 root root   124160 Aug  7 18:55 ld-2.2.3.so*
-rwxr-xr-x2 root root   124160 Aug  7 18:55 ld-linux.so.2*
-rw-r--r--2 root root   948288 Aug  7 18:55 libc-2.2.3.so
-rw-r--r--2 root root   948288 Aug  7 18:55 libc.so.6.1
-rw-r--r--2 root root  Aug  7 18:55 libcom_err.so.2
-rw-r--r--2 root root  Aug  7 18:55 libcom_err.so.2.0
-rw-r--r--2 root root14608 Aug  7 18:55 libdl-2.2.3.so
-rw-r--r--2 root root14608 Aug  7 18:55 libdl.so.2.1
-rw-r--r--2 root root22904 Aug  7 18:55 libe2p.so.2
-rw-r--r--2 root root22904 Aug  7 18:55 libe2p.so.2.3
-rw-r--r--2 root root90488 Aug  7 18:55 libext2fs.so.2
-rw-r--r--2 root root90488 Aug  7 18:55 libext2fs.so.2.4
-rw-r--r--2 root root 3168 Aug  7 18:55 libm-2.2.3.so
-rw-r--r--2 root root 3168 Aug  7 18:55 libm.so.6.1
-rw-r--r--2 root root70784 Aug  7 18:55 libnewt.so.0.50
-rw-r--r--2 root root70784 Aug  7 18:55 libnewt.so.0.50.17
-rw-r--r--2 root root17504 Aug  7 18:52 libnss_dns-2.2.3.so
-rw-r--r--2 root root17504 Aug  7 18:52 libnss_dns.so.2
-rw-r--r--2 root root34264 Aug  7 18:55 libpopt.so.0
-rw-r--r--2 root root34264 Aug  7 18:55 libpopt.so.0.0.0
-rw-r--r--2 root root72256 Aug  7 18:55 libresolv-2.2.3.so
-rw-r--r--2 root root72256 Aug  7 18:55 libresolv.so.2.1
-rw-r--r--2 root root   132120 Aug  7 18:55 libslang.so.1
-rw-r--r--2 root root   132120 Aug  7 18:55 libslang.so.1.4.4
-rw-r--r--2 root root13488 Aug  7 18:55 libuuid.so.1
-rw-r--r--2 root root13488 Aug  7 18:55 libuuid.so.1.2

so libm is still the culprit. I think I'll just change rootdisk.sh to
use mklibs.py for Alpha for now.

Falk


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-07 Thread Christopher C. Chimelis


On 7 Aug 2001, Falk Hueffner wrote:

 Yes, it acually doesn't seem to make any difference. With mklibs.sh:

What exactly does this script do to libc (or really, what isn't it doing
now)?  There are some binutils issues that I'm working on that may be
related...

C


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-07 Thread Falk Hueffner

Christopher C. Chimelis [EMAIL PROTECTED] writes:

 On 7 Aug 2001, Falk Hueffner wrote:
 
  Yes, it acually doesn't seem to make any difference. With mklibs.sh:
 
 What exactly does this script do to libc (or really, what isn't it
 doing now)?  There are some binutils issues that I'm working on that
 may be related...

The only difference between the two scripts is how the set of symbols
to be incuded is determined. mklibs.py simply adds missing symbols
iteratively until everything is satisfied. mklibs.sh does something
different (I just realized that it doesn't do what I thought it
did... unfortunately there's no real documentation... Hm, I'm afraid
somebody else will have to tell you how it works :) You can find both
scripts in the boot-floppies CVS, in scripts/rootdisk.

Well another difference: mklibs.py uses readelf insead of objdump,
since that seemed to be slightly easier to parse.

Falk


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-07 Thread Goswin Brederlow

Falk Hueffner [EMAIL PROTECTED] writes:

 Christopher C. Chimelis [EMAIL PROTECTED] writes:
 
  On 7 Aug 2001, Falk Hueffner wrote:
  
   Yes, it acually doesn't seem to make any difference. With mklibs.sh:
  
  What exactly does this script do to libc (or really, what isn't it
  doing now)?  There are some binutils issues that I'm working on that
  may be related...
 
 The only difference between the two scripts is how the set of symbols
 to be incuded is determined. mklibs.py simply adds missing symbols
 iteratively until everything is satisfied. mklibs.sh does something
 different (I just realized that it doesn't do what I thought it
 did... unfortunately there's no real documentation... Hm, I'm afraid
 somebody else will have to tell you how it works :) You can find both
 scripts in the boot-floppies CVS, in scripts/rootdisk.
 
 Well another difference: mklibs.py uses readelf insead of objdump,
 since that seemed to be slightly easier to parse.

Main reason for readelf was objdump failing on some files. Can't
remember which though.
 
 Falk

MfG
Goswin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Library reduction on Alpha (was: Re: Alpha: aboot rescue disk)

2001-08-07 Thread Goswin Brederlow

Falk Hueffner [EMAIL PROTECTED] writes:

 Christopher C. Chimelis [EMAIL PROTECTED] writes:
 
  On 7 Aug 2001, Falk Hueffner wrote:
  
   Yes, it acually doesn't seem to make any difference. With mklibs.sh:
  
  What exactly does this script do to libc (or really, what isn't it
  doing now)?  There are some binutils issues that I'm working on that
  may be related...
 
 The only difference between the two scripts is how the set of symbols
 to be incuded is determined. mklibs.py simply adds missing symbols
 iteratively until everything is satisfied. mklibs.sh does something
 different (I just realized that it doesn't do what I thought it
 did... unfortunately there's no real documentation... Hm, I'm afraid
 somebody else will have to tell you how it works :) You can find both
 scripts in the boot-floppies CVS, in scripts/rootdisk.

A short add on to mklibs.sh.

As I see it it looks for symbols that are in two files, i.e. ash and
libm, and includes all matches. It thinks that all symbols that match
names will be needed in the library.

Unfortunatly that will keep any and all symbols with all duplicates in
the library, so instead of using libc's math funktions it keeps libcs
_and_ libms.



mklibs.py on the other hand includes each symbol only once. Theres a
small hack to prefer libc symbols (althout not realy needed since libm
seems to be after libc) but otherwise its a first come first use basis.

MfG
Goswin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]