[PATCH] D46819: [llvm-objcopy] Add --keep-symbol (-K) option

Paul Semel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 09:39:36 PDT 2018


paulsemel added a comment.

In https://reviews.llvm.org/D46819#1101523, @alexshap wrote:

> @paulsemel, as i said, there are 2 (similar but separate) issue. 
>  I'm mostly concerned with the fact that we incorrectly remove the symbols table if --strip-all -K foo is specified because it's a real world use-case.
>  As @jhenderson suggested
>
>   >Instead I'd suggest we need to do two things: 1) If Config.StripAll is set, remove a symbol, unless it is marked as keep. 2) If Config.StripAll is set, and the symbol table is empty (i.e. no symbols were marked as 
>   >keep), we strip the symbol table.
>
> i think this is how it should work, so i completely agree with James.
>  Does it sound good to you ?


Sure, totally fine with this. My point was more that the problem was not in this patch (I mean, even if you would have find this case before, this would still have been a separate one, as it more concerns the `--strip-all` option implementation than this one).
Anyway, I think that the current architecture is not really compliant with this (maybe the symbol removal should happen before the section removal ?)


Repository:
  rL LLVM

https://reviews.llvm.org/D46819





More information about the llvm-commits mailing list