ELF binaries much bigger than a.out

ELF binaries much bigger than a.out

Post by Michael-John Turn » Tue, 02 Apr 1996 04:00:00



Hi all

Excuse the slightly misleading subject. A more accurate subject should
be "I've just upgraded to ELF and when I compile binaries, they're
_much_ bigger than their a.out counterparts".

For example, if I compile lsh, the a.out binary is 46,296 bytes, but
the ELF version is 191,420 bytes. Quite a difference!

Am I missing some compiler options here (-Wall -O2 -fmoit-frame-pointer -c)
are the ones I used)? How can I shrink ELF binaries?

Cheers
 M-J
-= Michael-John Turner -=-=-=-=-=-=-=-=-=-=-= UNIX: Live free or die -=-



 
 
 

ELF binaries much bigger than a.out

Post by Norman James Lew » Tue, 02 Apr 1996 04:00:00


: Hi all
:
: Excuse the slightly misleading subject. A more accurate subject should
: be "I've just upgraded to ELF and when I compile binaries, they're
: _much_ bigger than their a.out counterparts".
:
: For example, if I compile lsh, the a.out binary is 46,296 bytes, but
: the ELF version is 191,420 bytes. Quite a difference!
:
: Am I missing some compiler options here (-Wall -O2 -fmoit-frame-pointer -c)
: are the ones I used)? How can I shrink ELF binaries?
:

Sounds like they're getting compiled statically.

The new linker isn't quite as smart as the last one; it must have two links
for each shared library image, otherwise it'll compile static.

You'll need links like this for *all* shared libraries:

libc.so to libc.so.5
libc.so.5 to libc.so.5.2.18 (or whatever)

Hope that helps,
Jay

 
 
 

ELF binaries much bigger than a.out

Post by Mark Vojkovi » Tue, 02 Apr 1996 04:00:00


Quote:>: Excuse the slightly misleading subject. A more accurate subject should
>: be "I've just upgraded to ELF and when I compile binaries, they're
>: _much_ bigger than their a.out counterparts".
>:
>: For example, if I compile lsh, the a.out binary is 46,296 bytes, but
>: the ELF version is 191,420 bytes. Quite a difference!
>:
>: Am I missing some compiler options here (-Wall -O2 -fmoit-frame-pointer -c)
>: are the ones I used)? How can I shrink ELF binaries?
>:

     Maybe there is just more debugging info.  Did you strip the
executable?  eg.  

   strip myprogram

                        MARk.

 
 
 

ELF binaries much bigger than a.out

Post by Robert Nicho » Wed, 03 Apr 1996 04:00:00




:: Excuse the slightly misleading subject. A more accurate subject should
:: be "I've just upgraded to ELF and when I compile binaries, they're
:: _much_ bigger than their a.out counterparts".
:
:Sounds like they're getting compiled statically.
:
:The new linker isn't quite as smart as the last one; it must have two links
:for each shared library image, otherwise it'll compile static.
:
:You'll need links like this for *all* shared libraries:
:
:libc.so to libc.so.5
:libc.so.5 to libc.so.5.2.18 (or whatever)

Another thing that can cause this is if your libc.so link is in a
directory that is not searched until after the one containing an ELF
libc.a (or a link to one).  (I had been trying to arrange things so that
the 'trn' configuration script would work with my ELF system, and
suddenly every program I linked became *huge*.)

You can pass the "-Wl,--verbose" option through gcc to the loader to see
exactly where the loader is looking and what it finds.

--

 
 
 

1. Q: Compiling Elf binaries and a.out binaries....

Hi,

I have the 2.1 slackware distribution andhave a desire to compile both
Elf and a.out binaries... please advice.

Kernel version = 1.2.11
Gcc = 2.6.3

Please respondw/ e-mail as I am unable to read anything but e-mail right now....

        --Thomas

--


          Don't hold them to anything I may write though.
                        Flying high on Windows 95.

2. General Linux Question

3. Can "make" work in ELF-default environment to produce a.out binaries?

4. help from netcom

5. Elf / a.out binaries?

6. Frontpage extensions on Apache 1.3.9

7. ELF to a.out or binary converter?

8. Why no ROM monitor on Intel platforms?

9. How do I make a.out binary on ELF maching?

10. larger ELF binaries than a.out

11. elf vs. a.out binaries

12. MUCH larger ELF binaries than a.out