[PATCH] D65893: [llvm-objcopy] Allow the visibility of the start, end and size symbols created by --binary to be specified with --binary-symbol-visibility

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 22:46:15 PDT 2019


MaskRay added a comment.

In D65893#1623201 <https://reviews.llvm.org/D65893#1623201>, @chrisjackson wrote:

> - For our use cases it is more convenient to change the symbol's visibility with an option than to have users alter their source code.


I accepted D65891 <https://reviews.llvm.org/D65891> because:

- It deals with an existing option: `--add-symbol`. `protected` is a natural extension to the existing `default`/`hidden` visibility. Nobody will get puzzled by this addition.
- According to Changes to symbol visibility between RVCT v3.1 for µVision and RVCT v4.0 <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0593a/BEHEHEFC.html> for µVision you linked, there are some use cases. I guess it is used for preventing inadvertent preemption in static linking.

The first bullet is sufficient for me to accept it, but I hope you can elaborate more on the second bullet. How do you use STV_PROTECTED in object files and shared objects? What semantics do you expected when linking STV_DEFAULT/STV_PROTECTED undefined/defined together?

> For our use cases it is more convenient to change the symbol's visibility with an option than to have users alter their source code.

`--binary-symbol-visibility` can cause confusion. As suggested by rupprecht, it should be generalized to `--redefine-visibility=` if we do want the option.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65893/new/

https://reviews.llvm.org/D65893





More information about the llvm-commits mailing list