GCC: visibility of symbols in standalone C++ applications
- by Albert
Hi,
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 symbols? 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?