[PATCH] D46369: [llvm-objcopy] Add --strip-symbol (-N) option

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 04:36:51 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D46369#1086201, @paulsemel wrote:

> Alright, I understand what you're saying to me !
>  However, in this case, we might want to change other options behavior (I can also leave the ELF file in an invalid state with `--localize-symbol` or `--globalize-symbol`.
>  I actually truly think that, for the options where the user explicitly gives a symbol name, we might just do whatever he wants. But I agree with you for other options like `--weaken` or `--strip-unneeded`, where in this case we really want to have the ELF file in a valid state.
>  Anyway, if you want it, I can follow, the GNU objcopy behavior for this one (if I understood you well, this might consist of issuing a warning, and removing section)


I think --strip-symbol is slightly different to --localize-symbol etc, because the relocations and groups will still be valid (if a little less than expected). I'm not quite sure what context you meant by leaving it in an invalid state for these.

I have no particular issue about doing what the user wants, but if we do that, we need to do something with the relocations/groups in this situation - we can't leave dangling references, so we'd need to remove these references, if we did. I'd like to defer this to @jakehehrlich to decide, whether we match the GNU objcopy behaviour or attempt to do something slightly different (but still leave things in a valid structural state).


Repository:
  rL LLVM

https://reviews.llvm.org/D46369





More information about the llvm-commits mailing list