[PATCH] D53782: [llvm-objcopy] Don't apply --localize flags to common symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 15:13:30 PDT 2018


MaskRay added a comment.

> I'd also feel better if we added a --localize-hidden-common because then we cover the full use cases. Alternatively we can branch from GNU objcopy again and add --localize-hidden-gnu and *also* add a -gnu option that would make all --*-gnu options the semantics when using the non-gnu counter part name. I think we need such an option for --strip-all-gnu to be useful anyway because otherwise you can't really do a proper drop in replacement.

Totally agree.

For my comment, `if (Sym.getShndx() != SHN_UNDEF && Sym.getShndx() != SHN_COMMON && ...` I was just digging into GNU objcopy internals and did not intend to suggest any one direction or the other. I feel the ELF editing interfaces of objcopy is rather bad. I cannot what an option does unless I read the source code. (`bfd/* binutils/objcopy.c`). I favor your preference that these options should be simple and for blanket operations the user intends to do (e.g. `--localize-hidden`), it is reasonable to not specialize case COMMON as this is user fault.

I am still unclear what the good command line ELF editing should do but providing a separate `--*-gnu` interface seems reasonable.


Repository:
  rL LLVM

https://reviews.llvm.org/D53782





More information about the llvm-commits mailing list