Strip deletes information about the debugging connection table generated by-G.
For executable files, after the Strip command is used,
The size is only 1/9 of the original size
Strip command
The strip command removes the symbol table sht_symtab and its associated string table, debugging information, and line number information from elf object files. That is, besides the symbol table and associated string table, the following
Sections are removed:
. Line
. Debug *
. Stab *
This command deletes the sht_symtab, line number information, debugging information, and string table from the executable file, dynamic link library, and other binary file elf object files;
Once the command is successfully executed, GDB will not be able to read the symbol tables of these files, so it will not be able to perform normal debugging;
1. The following is a change in the debugging information of the executable file ismg_logserver_sol10_gcc34_v500_090320 before and after the Strip command is executed:
Debug with GDB before Strip:
-Bash-3.00 $ GDB
Gnu gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
Welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10 ".
(GDB) file ismg_logserver_sol10_gcc34_v500_090320
Reading symbols from/export/home1/ismg/ismg5/bin/ismg_logserver_sol10_gcc34_v500_090320... done.
(GDB)
Run the Strip command:
Strip ismg_logserver_sol10_gcc34_v500_090320
After the string, use the gdb tool for debugging:
-Bash-3.00 $ GDB
Gnu gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
Welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10 ".
(GDB) file ismg_logserver_sol10_gcc34_v500_090320
Reading symbols from/export/home1/ismg/ismg5/bin/ismg_logserver_sol10_gcc34_v500_090320... (no debugging symbols found.
(GDB)
2. The following is a change in the file size before and after the Strip command is executed on the executable file ismg_logserver_sol10_gcc34_v500_090320:
File size before Strip:
-Bash-3.00 $ LS-lt | grep logserver
-Rwxr-XR-x 1 ismg DBA 436944 March 20 ismg_logserver_sol10_gcc34_v500_090320
Run the Strip command:
Strip ismg_logserver_sol10_gcc34_v500_090320
The file size after Strip:
-Bash-3.00 $ LS-lt | grep logserver
-Rwxr-XR-x 1 ismg DBA 71116 March 20 ismg_logserver_sol10_gcc34_v500_090320