| |||
| Home > fromelf command reference > --strip=option[,option,...] | |||
This 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.
--strip=option[,option,...]
Where option is one of:
allFor
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.
Do not use the --strip=all option with SysV
images.
debugRemoves all debug sections from the ELF file.
commentRemoves the .comment section from the ELF file.
filesymbolsThe STT_FILE symbols
are removed from the ELF file.
localsymbolsThe 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 the fromelf
--text output.
notesRemoves the .notes section from the ELF file.
pathnamesRemoves
the path information from all symbols with type STT_FILE.
For example, an STT_FILE symbol with the name C:\work\myobject.o is
renamed to myobject.o.
This option does not strip path names that are in the debug information.
symbolsThe 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 the fromelf
--text output.
Stripping the symbols, path names, or file symbols might make the file harder to debug.
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
Using the Linker: