[Bug middle-end/61577] [4.9.0 Regression] can't compile on hp-ux v3 ia64

dave.anglin at bell dot net gcc-bugzilla@gcc.gnu.org
Sat Feb 22 15:29:00 GMT 2020


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

--- Comment #197 from dave.anglin at bell dot net ---
On 2020-02-21 11:43 p.m., peter.bisroev at groundlabs dot com wrote:
> 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.
Yes.

Thus, ia64 running hpux is essentially the same as hppa64 running hpux in its
support for
weak (sdef) symbols.  We didn't hit the long branch issue I guess because
pc-relative branches
go a factor of two further, and maybe the -O0 code generation is denser.


More information about the Gcc-bugs mailing list