| |||
| Home > Linker command-line options > --remove, --no_remove | |||
This option enables or disables the removal of unused input sections from the image. An input section is considered used if it contains an entry point, or if it is referred to from a used section.
The default is --remove. However, if you
also specify the --base_platform, --bpabi,
and --sysv options, the default is --no_remove.
By default, unused section elimination is disabled when building dynamically
linked libraries (DLLs) or shared objects, Use --remove to
re-enable unused section elimination.
Use --no_remove when debugging to retain
all input sections in the final image even if they are unused.
Use --remove with the --keep option
to retain specific sections in a normal build.