开发者

GCC: visibility of symbols in standalone C++ applications

开发者 https://www.devze.com 2022-12-31 00:18 出处:网络
Because of a strange C++ warning about the visibility of some symbols and an interesting answer, linking to a paper which describes the different visibility types and cases (section 2.2.4 is about C++

Because of a strange C++ warning about the visibility of some symbols and an interesting answer, linking to a paper which describes the different visibility types and cases (section 2.2.4 is about C++ classes), I started to wonder if it is needed for a standalone application to export symbols at all (except main - or is that needed?).

Why exactly are they needed to be exported in standalone applications?

Is "an exported symbol" an synomym for "visible symbol"? I.e. a hidden symbol is a symbol which is not exported?

Do the object files already differ between visible symbols and hidden symb开发者_JAVA技巧ols? Or is this made at the linking step, so that only the visible symbols are exported?

Does the visibility of symbols matter in case for debug information? Or is that completely independent, i.e. I would also get a nice backtrace if I have all symbols hidden? How is STABS/DWARF related to the visibility of symbols?


For applications you do not need this because you do not have API...

The visibility is relevant for shared-objects only.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号