HP aC++ A.03.85 Release Notes

HP aC++ Release Notes
New Features in Version A.03.33
Chapter 1 39
-Bhidden and -Bhidden_def Command Line Options
The current behavior of the aC++ compiler on HP-UX systems is to export all symbols with
external linkage by default. In order to facilitate exporting only those symbols marked with
__declspec(dllexport) and hide the rest, use the following two options to hide the symbols
by default.
-Bhidden Command Line Option
This option hides of all the symbols used in the translation unit other than the ones prefixed
with __declspec(dllexport), __declspec(dllimport), or specified with pragma
HP_DEFINED_EXTERNAL.
-Bhidden_def Command Line Option
This option hides all the symbols defined in the translation unit other than the ones prefixed
with __declspec(dllexport) or specified with pragma HP_DEFINED_EXTERNAL.
Since all the functions marked as hidden (both defined and referenced in the translation unit)
are expected to be defined in the same load module, the compiler can optimize the calls to
those functions by generating direct calls. But this requires you to notify the compiler about
the functions not defined in the same load module and ask it to generate indirect calls to them
through the PLT. This can be done using the with pragma HP_DEFINED_EXTERNAL. You have
the option of choosing either of the following:
1. Hide the symbols defined and optimize calls to functions not defined in the current
translation unit (other than the ones specified using pragma HP_DEFINED_EXTERNAL).
2. Hide the symbols defined, but not optimize calls to functions not defined in the current
translation unit In this case, you do not have to worry about HP_DEFINED_EXTERNAL.
NOTE
1. To be able to use these features, the following linker patches need to be
installed:
PHSS_24303 (for HP-UX 11.00)
PHSS_24304 (for HP-UX 11.11)
2. main function is always exported.
3. Compiler generated vtables and typeids are always exported.