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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 05:40:58 PDT 2018


jhenderson added a comment.

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

> @jakehehrlich Jake, it's one issue, a separate issue (which is probably more important and  creating troubles right now when i first tried to use this newly-implemented flag) (mentioned in my first comment) is
>  that llvm-objcopy removes the symbols table regardless of -K (for a detailed example have a look at that comment), imo this needs to be fixed. Am I missing smth ?


I've not looked at the GNU behaviour, but if GNU keeps that symbol (and only that symbol), it implies that we cannot simply strip the symbol table section via the removeSections code. 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 --strip-all is an example of an "implicit" removal, rather than explicit, so the explicit keep should win out with no warning or error.


Repository:
  rL LLVM

https://reviews.llvm.org/D46819





More information about the llvm-commits mailing list