Please add support for setting SHF_EXCLUDE flag for sections using --set-section-flags option. So far objcopy does not support setting this flag.
Currently, --set-section-flags preserves SHF_EXCLUDE. We can add
1. "+exclude" to add SHF_EXCLUDE.
2. "-exclude" to remove SHF_EXCLUDE.
Looks good to me.
We don't have precedent for +flag or -flag. Isn't it an overkill to invent the +- prefix and use +exclude and -exclude?
Other than .debug_*.dwo and an LLVM extension .linker-options, I can't think of any use cases of SHF_EXCLUDE. Nobody will --set-section-flags on .debug_*.dwo . I'd prefer treating 'exclude' like other flags such as 'alloc','readonly','data'... I can send a patch for this.
in the spirit of a previous patch by HJ. Lu that makes SHF_EXCLUDE generic rather than processor-specific.