STRIP 1 2005-04-20 binutils-2.15.97 GNU Development Tools

NAME

strip - Discard symbols from object files.

SYNOPSIS

strip [--FF _b_f_d_n_a_m_e |----ttaarrggeett==_b_f_d_n_a_m_e] [--II _b_f_d_n_a_m_e |----iinnppuutt--ttaarrggeett==_b_f_d_n_a_m_e] [--OO _b_f_d_n_a_m_e |----oouuttppuutt--ttaarrggeett==_b_f_d_n_a_m_e] [--ss|----ssttrriipp--aallll] [--SS|--gg|--dd|----ssttrriipp--ddeebbuugg] [--KK _s_y_m_b_o_l_n_a_m_e |----kkeeeepp--ssyymmbbooll==_s_y_m_b_o_l_n_a_m_e] [--NN _s_y_m_b_o_l_n_a_m_e |----ssttrriipp--ssyymmbbooll==_s_y_m_b_o_l_n_a_m_e] [--ww|----wwiillddccaarrdd] [--xx|----ddiissccaarrdd--aallll] [--XX |----ddiissccaarrdd--llooccaallss] [--RR _s_e_c_t_i_o_n_n_a_m_e |----rreemmoovvee--sseeccttiioonn==_s_e_c_t_i_o_n_n_a_m_e] [--oo _f_i_l_e] [--pp|----pprreesseerrvvee--ddaatteess] [----oonnllyy--kkeeeepp--ddeebbuugg] [--vv |----vveerrbboossee] [--VV|----vveerrssiioonn] [----hheellpp] [----iinnffoo] _o_b_j_f_i_l_e...

DESCRIPTION

GNU ssttrriipp discards all symbols from object files _o_b_j_f_i_l_e. The list of object files may include archives. At least one object file must be given.

ssttrriipp modifies the files named in its argument, rather than writing modified copies under different names.

OPTIONS

--FF _b_f_d_n_a_m_e
----ttaarrggeett==_b_f_d_n_a_m_e Treat the original _o_b_j_f_i_l_e as a file with the object
code format _b_f_d_n_a_m_e, and rewrite it in the same format.
----hheellpp Show a summary of the options to ssttrriipp and exit.
----iinnffoo Display a list showing all architectures and object formats available.
--II _b_f_d_n_a_m_e
----iinnppuutt--ttaarrggeett==_b_f_d_n_a_m_e Treat the original _o_b_j_f_i_l_e as a file with the object
code format _b_f_d_n_a_m_e.
--OO _b_f_d_n_a_m_e
----oouuttppuutt--ttaarrggeett==_b_f_d_n_a_m_e Replace _o_b_j_f_i_l_e with a file in the output format _b_f_d_n_a_m_e.
--RR _s_e_c_t_i_o_n_n_a_m_e
----rreemmoovvee--sseeccttiioonn==_s_e_c_t_i_o_n_n_a_m_e Remove any section named _s_e_c_t_i_o_n_n_a_m_e from the output file. This
option may be given more than once. Note that using this option inappropriately may make the output file unusable.
--ss
----ssttrriipp--aallll Remove all symbols.
--gg
--SS
--dd
----ssttrriipp--ddeebbuugg Remove debugging symbols only.
----ssttrriipp--uunnnneeeeddeedd Remove all symbols that are not needed for relocation processing.
--KK _s_y_m_b_o_l_n_a_m_e
----kkeeeepp--ssyymmbbooll==_s_y_m_b_o_l_n_a_m_e Keep only symbol _s_y_m_b_o_l_n_a_m_e from the source file. This option may
be given more than once.
--NN _s_y_m_b_o_l_n_a_m_e
----ssttrriipp--ssyymmbbooll==_s_y_m_b_o_l_n_a_m_e Remove symbol _s_y_m_b_o_l_n_a_m_e from the source file. This option may be
given more than once, and may be combined with strip options other than --KK.
--oo _f_i_l_e Put the stripped output in _f_i_l_e, rather than replacing the
existing file. When this argument is used, only one _o_b_j_f_i_l_e argument may be specified.
--pp
----pprreesseerrvvee--ddaatteess Preserve the access and modification dates of the file.
--ww
----wwiillddccaarrdd Permit regular expressions in _s_y_m_b_o_l_n_a_m_es used in other command
line options. The question mark (?), asterisk (*), backslash (\) and square brackets ([]) operators can be used anywhere in the symbol name. If the first character of the symbol name is the exclamation point (!) then the sense of the switch is reversed for that symbol. For example:


          -w -K !foo -K fo*


would cause strip to only keep symbols that start with the letters ``fo'', but to discard the symbol ``foo''.
--xx
----ddiissccaarrdd--aallll Remove non-global symbols.
--XX
----ddiissccaarrdd--llooccaallss Remove compiler-generated local symbols.
(These usually start with LL or ...)
----oonnllyy--kkeeeepp--ddeebbuugg Strip a file, removing any sections that would be stripped by
----ssttrriipp--ddeebbuugg and leaving the debugging sections.

The intention is that this option will be used in conjunction with ----aadddd--ggnnuu--ddeebbuugglliinnkk to create a two part executable. One a stripped binary which will occupy less space in RAM and in a distribution and the second a debugging information file which is only needed if debugging abilities are required. The suggested procedure to create these files is as follows:
1. "foo" then...
1. create a file containing the debugging info.
1. stripped executable.
1. to add a link to the debugging info into the stripped executable.


Note - the choice of ".dbg" as an extension for the debug info file is arbitrary. Also the "--only-keep-debug" step is optional. You could instead do this:
1.
1.
1.
1.

ie the file pointed to by the ----aadddd--ggnnuu--ddeebbuugglliinnkk can be the full executable. It does not have to be a file created by the ----oonnllyy--kkeeeepp--ddeebbuugg switch.
--VV
----vveerrssiioonn Show the version number for ssttrriipp.
--vv
----vveerrbboossee Verbose output: list all object files modified. In the case of
archives, ssttrriipp --vv lists all members of the archive.

SEE ALSO

the Info entries for _b_i_n_u_t_i_l_s. Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''.