[PATCH] D47052: [llvm-objcopy] Fix the behavior of --strip-* and --keep-symbol

Paul Semel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 01:12:12 PDT 2018


paulsemel added a comment.

Hi !
I have a few thoughts about option conflicts handling.

First, for example, if we take `localize-hidden.test` test, and we apply `-R .rel.text -N undefLocal`, this way we would trigger an error. I know that `objcopy` is behaving the same as this patch behaves, but I was wondering if we could/want to do better ?

Then, for the example you gave, it seems that the behavior is not matching what you're saying. For instance, still with `localize-hidden.test` with `--strip-all -K defaultGlobal`, every other global/weak symbols are kept, which is not the case with `objcopy`.
Last, if you really test this, you will notice that it won't work, because there will be an error complaining about a symbol referenced by a relocation. This error happens because you are trying to remove `undefLocal` symbol, which is not permitted while it is a relocatable symbol.

I think this change is not sufficient to handle this problem (and more generally option conflicts), and it is creating other problems we might at least be aware of.


Repository:
  rL LLVM

https://reviews.llvm.org/D47052





More information about the llvm-commits mailing list