objcopy: add some support for --strip-debug and --strip-all
Support for the use case:
`zig objcopy --strip-all program stripped --extract-to stripped.dbg`
to separate the debug & symbols sections out to a companion file, with a corresponding a .gnu_debuglink.
note: this is "a minimal effort implementation"
It doesn't support all possibile elf files: there may be some sections type that need fixups, the program header may need fix up, ...
It was written for a specific use case (strip debug info to a sperate file, for linux 64-bits executables built with `zig` or `zig c++` )
It doesn't support 32-bit files, or file with non-native endianess.
3a700d60baXavier Bouchoux committed on 3/20/2023, 7:39:23 AMparent30427ff