[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why is libc-2.1.*.so not stripped?



Nils Rennebarth <nils@ipe.uni-stuttgart.de> writes:

> [1  <text/plain; us-ascii (7bit)>]
> Subject says it all:
>    Why is the libc DLL not stripped on potato systems? It enlarges *every*
> executable (linked dynamically!) by about 100k

> Long Story:
> I compiled a short gtk program that I wrote as an example to learn gtk
> programming on a potato system. The executable (linked dynamically,
> stripped) was > 100k in size.

> Then I transferred the program to a slink system, compiled again, using the
> same Makefile and presto, the size of the executable shrank to 7k stripped,
> a much more reasonable size.

> After much searching around I compiled the simplest hello world program on
> the potato machine. source code like this:
> -------------------------------------------------------------
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>         printf("Hi folks\n");
> }
> -------------------------------------------------------------
> again > 100k in size.

This has nothing to do with whether libc is stripped or not.

Also:

 # gcc foo.c
 # strip a.out
 # ls -l a.out
 -rwx------   1 dunham   gnats        3064 Jul 26 16:30 a.out*

This is on an up-to-date potato system, using your code.

I'm guessing that your problem is that you are compiling this as a C++
program, with exceptions enabled.  (Exceptions are enabled in g++ by
default because if you compile any code with exceptions disabled, you
can't use it in a program that needs exceptions.)


Steve
dunham@cse.msu.edu


Reply to: