bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hppa float linkage problems


From: Christopher C. Chimelis
Subject: hppa float linkage problems
Date: Wed, 20 Feb 2002 10:27:08 -0500 (EST)

[Forwarded Bug text from Debian]


When trying to get Ghostscript running on pa-risc it build but always
failed. The reason seemed to be that gcc generates bad code but I was
told that the code is indeed correct and the problem lies in the linker.

My test case is the following code, which runs fine on my i386 machine
but not on sarti.debian.org (which is pa-risc):

======
#include <stdio.h>
void    out(const char *str, double x)
{
        printf("%s: %f\n", str, x);
}
int     main(int argc, char **argv)
{
        void    (*f)(const char *, double) = out;
        f("Calling via function pointer", 3.1415926535);
        out("Calling directly", 3.1415926535);
        return 0;
}
======

This is what happens:

======
address@hidden:~/gccbug$ gcc realind.c -o realind
address@hidden:~/gccbug$ ./realind
Calling via function pointer: 0.000000
Calling directly: 3.141593
======

I am still learning about the pa-risc architecture but according to
this quote this is an assembler/linker problem:

| From: "John David Anglin" <address@hidden>
|
| The ABI specifies that arguments are passed
| in general registers in dynamic calls.  This is most likely a linker
| problem.
| The linker has to create the correct stub to copy the argument to a
| floating
| register.  The test runs as expected with HP's som linker.  With the HP
| assembler, gcc passes floats in both general and floating registers
| because
| there is no way to specifiy argument locations in static
| functions.  With
| GAS, gcc uses .PARAM to specify argument locations in static functions.

And, BTW: The web interface for subscription to bug-binutils does not
work, because binutils and bug-binutils are on different servers. The
web interface tries to subscribe me via redhat.com...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]