12.6. c29strip - Object File Stripping Tool¶
The c29strip tool can be used to strip sections and symbols from object files.
12.6.1. Usage¶
c29strip [options] inputs …
c29strip - is the command that invokes the object file stripping tool.
options - that affect the behavior of c29strip. If no other stripping or remove options are specified on the command line, then c29strip assumes the --strip-all option is enabled.
inputs - identify one or more object files that are processed by c29strip. By default, the input files are modified in-place. If - is specified for the input file, the input is read from the program’s standard input stream. If the input is an archive, any requested operations are applied to each archive member individually.
12.6.2. Options¶
- --disable-deterministic-archives, -U¶
Use real values for UIDs, GIDs and timestamps when updating archive member headers.
- --discard-all, -x¶
Remove most local symbols from the output. File and section symbols in ELF objects are not discarded.
- --enable-deterministic-archives, -D¶
Enable deterministic mode when stripping archives, i.e. use 0 for archive member header UIDs, GIDs and timestamp fields. This option is enabled by default.
- --help, -h¶
Print a summary of command line options.
- --no-strip-all¶
Disable the --strip-all option.
- -o <file>¶
Write output to specified <file>. Multiple input files cannot be used in combination with the -o option.
- --remove-section <section>, -R <section>¶
Remove the specified <section> from the output. This option can be specified multiple times to remove multiple sections simultaneously.
- --strip-all, -S¶
For ELF objects, remove from the output all symbols and non-alloc sections not within segments, except for the .C29.attribute section and the section name table.
- --strip-debug, -g¶
Remove all debug sections from the output.
- --strip-symbol <symbol>, -N <symbol>¶
Remove all symbols named <symbol> from the output. This option can be specified multiple times to remove multiple symbols.
- --strip-unneeded¶
Remove from the output all local or undefined symbols that are not required by relocations. Also remove all debug sections.
- --version, -V¶
Display the version of the c29strip executable.
- --wildcard, -w¶
Allow wildcard syntax (such as “*” and “?”) for symbol-related options. Wildcards are enabled by default for section-related options.
- @<file>¶
Read command-line options and commands from specified <file>.
- --allow-broken-links¶
Allow c29strip to remove sections even if it would leave invalid section references. Any invalid sh_link fields are set to zero.
- --discard-locals, -X¶
Remove local symbols starting with “.L” from the output.
- --keep-file-symbols¶
Keep symbols of type STT_FILE, even if they would otherwise be stripped.
- --keep-section <section>¶
When removing sections from the output, do not remove sections named <section>. This option can be specified multiple times to keep multiple sections.
- --keep-symbol <symbol>, -K <symbol>¶
When removing symbols from the output, do not remove symbols named <symbol>. This option can be specified multiple times to keep multiple symbols.
- --preserve-dates, -p¶
Preserve access and modification timestamps in the output.
- --strip-sections¶
Remove from the output all section headers and all section data not within segments. Note that many tools cannot use an object without section headers.
12.6.3. Exit Status¶
The c29strip utility exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0.