[PATCH] D43475: [llvm-objcopy] Implement --only-keep-debug

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 10:43:21 PST 2018


jakehehrlich added a comment.

I can ask some people about this stuff and get back to everyone on this. Like James I have no clue if this is valid or why the old tools converted allocated sections to NOBITS. As for --strip-debug, we should do some testing to see if .zdebug, .gdb_index, etc... are removed by it. Making --strip-debug more aggressive where possible is probably a good thing. Funny anecdote: my main use case for --strip-debug is to tell other people to use it so that they can send me large binaries via email and I can still see the symbol table and relocations.

The following is speculation:
I think there are two use cases for --only-keep-debug that require the NOBITS sections.

1. If you pre-link the stripped binary then things might be relocated and thus the debug information would need to have access to the original sections in order to translate. I vaguely remember Roland talking about a case like this.
2. If you use --strip-all/--strip-sections with the right --keep options you might still be able to debug the stripped binary due to extra information in the debug binary. If this is possible then --strip-debug should become as aggressive as it can be without actually preventing this from happening.


Repository:
  rL LLVM

https://reviews.llvm.org/D43475





More information about the llvm-commits mailing list