> Google (strip glibc gcc "-s"):
> http://hr.uoregon.edu/davidrl/glibc.html (troubleshooting section)
> http://inferno.slug.org/hints/stripped-down.txt
> http://www.linuxfromscratch.org/hints/downloads/files/small-lfs.txt
>...
> I don't know how much of the above is true/current but you're welcome
> to Google more to find out.
>
> Good luck,
> Jeremy.

Hi, Jeremy!

First of all, thanks for the links, they helped me greatly!

I hadn't enough time to check up my thoughts concerning -s flag before 
but now I feel I should speak about it a little.

First, use of the flag in CFLAGS/CXXFLAGS and EVEN LDFLAGS don't seem to 
be dangerous at all.

The idea is that it removes "debugging and relocation information" from 
GCC/G++ and LD output accordingly. But if I (a typical user of the 
software to be compiled with the flag) really need this information? I 
obviously don't need debugging info but what about relocation one? 
Having carried out a simple test I saw executables and shared libraries 
DON'T need relocation tables, probably because they have already been 
(pseudo-)linked with other neccessary libs and they're ready for 
execution

The only files that really need relocation symbols are static libraries 
(.a files) and simple objects (.o files). This need is based on the 
compiler's need to know the symbols to be able to find them when 
linking a program or library statically.

But static libs are created with "ar" util whose behaviour can't be 
controlled with any of C/CXX/LDFLAGS. The latter is proved by the fact 
that applying "strip --strip-debug" to a static library does decrease 
its size (although in the case of glibc the decrease doesn't exceed 5%) 
even if it was compiled with FLAGS containing -s. Applying "strip 
--strip-unneeded" decreases the library size _much_ more (more than 
twice in the case of glibc, libc.a) but the library gets unusable 
although you can still use the shared version.

Applying the above commands to libc.so compiled with -s doesn't make any 
improvement but the library seems to be 100% usable! At least, I've 
build whole LFS with -s flag up to GRUB without any problem, the GRUB 
problem being not in the flag in question.

I'd like to add a few words concerning stripping (using "strip 
--strip-...", not -s flag). You can strip ONLY debug symbols from 
static libraries as well as ALL symbols from shared ones BUT striping 
shared libraries and executables that are used at the moment can break 
the system so it's recommended everywhere that you strip your system 
files from Live CD or another linux only.

I'd like to repeat that I've build whole LFS (including GCC, GLIBC, 
BINUTILS) up to GRUB (chapter 6) with -s FLAG without problems that 
could occur due to its usage.

I hope this information will help somebody.

P.S. Sorry for my not replying for so long. I was to check up my 
suggestions.

--
Nothing but perfection
pv
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to