https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577

--- Comment #195 from Peter Bisroev <peter.bisroev at groundlabs dot com> ---
Hi Dave,

I was doing a bit more searching and found this doc from HP, "Solaris to HP-UX
Porting Guide"
(http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.475.5577&rep=rep1&type=pdf).
I know it is not from hpe.com but seems to be an official HP document HP-UX 11i
v2 and later.

Anyway, on page 56, it states:
------------------------------
In Solaris, symbols can be set with a pragma to be weak, which means that these
symbols are always overridden by any global definition. If an undefined weak
symbol is never satisfied by a global definition, it is set to 0 before the
program starts execution. HP_SECONDARY_DEF symbols are similar to Solaris weak
symbols, but there are some differences. You can use the _HP_SECONDARY_DEF
pragma to connect a weak and a strong definition (for example, _fopen and
fopen). The weak definition can be overridden by other strong definitions.
------------------------------

I guess that confirms your statement about sdef.

On page 85, it states:
------------------------------
The ELF file format provides support for global, local, and weak symbols.
Creating these symbols requires support from the compiler. The HP C and HP C++
compilers do not provide support for weak symbols.

The HP-UX 11i v2 and later assembler (/usr/ccs/bin/as) provides support using
the .weak directive. Example 7-3 “Weak Function Binding Using ASM” defines
weakfunc to be a weak binding to func. Details on the assembler can be found in
the Itanium Architecture Assembly Language Reference Guide.
------------------------------
I guess that confirms your suspicion that aCC does not support weak symbols and
my results that .weak is supported by HP's assembler.

--peter

Reply via email to