--strip=option[,option,…]
Helps to protect your code in images and objects that are delivered to third parties. You can also use it to help reduce the size of the output image.
Syntax
--strip=option
[,option
,…]
Where option
is one of:
all
For object modules, this option removes all debug, comments, notes and symbols from the ELF file. For executables, this option works the same as
--no_linkview
.debug
Removes all debug sections from the ELF file.
comment
Removes the
.comment
section from the ELF file.filesymbols
The
STT_FILE
symbols are removed from the ELF file.localsymbols
The effect of this option is different for images and object files.
For images, this option removes all local symbols, including mapping symbols, from the output symbol table.
For object files, this option:
Keeps mapping symbols and build attributes in the symbol table.
Removes those local symbols that can be removed without loss of functionality.
Symbols that cannot be removed, such as the targets for relocations, are kept. For these symbols, the names are removed. These are marked as
[Anonymous Symbol]
in thefromelf --text
output.
notes
Removes the
.notes
section from the ELF file.pathnames
Removes the path information from all symbols with type
STT_FILE
. For example, anSTT_FILE
symbol with the name C:\work\myobject.o is renamed to myobject.o.Note
This option does not strip path names that are in the debug information.symbols
The effect of this option is different for images and object files.
For images, this option removes the complete symbol table, and all static symbols. If any of these static symbols are used as a static relocation target, then these relocations are also removed. In all cases,
STT_FILE
symbols are removed.For object files, this option:
Keeps mapping symbols and build attributes in the symbol table.
Removes those local symbols that can be removed without loss of functionality.
Symbols that cannot be removed, such as the targets for relocations, are kept. For these symbols, the names are removed. These are marked as
[Anonymous Symbol]
in thefromelf --text
output.
Note
Stripping the symbols, path names, or file symbols might make the file harder to debug.Restrictions
You must use --elf
and --output
with this option.
Example
To produce an output.axf file without debug from the ELF file infile.axf originally produced with debug, enter:
fromelf --strip=debug,symbols --elf --output=outfile.axf infile.axf