[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug#128847: binutils: [pa-risc] Bad linkage for float calls
From: |
Torsten Landschoff |
Subject: |
Bug#128847: binutils: [pa-risc] Bad linkage for float calls |
Date: |
Sat, 12 Jan 2002 02:00:22 +0100 |
User-agent: |
Mutt/1.2.5i |
Package: binutils
Version: 2.11.92.0.12.3-4
Severity: important
Hi colleagues,
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.
If more information is needed I'll be happy to provide what I can find
out. Thanks for your great work!!
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...
Friendly
Torsten
-- System Information
Debian Release: 3.0
Architecture: hppa
Kernel: Linux sarti 2.4.16-64 #1 Fri Dec 7 16:08:36 MST 2001 parisc64
Locale: LANG=C, LC_CTYPE=C
Versions of packages binutils depends on:
ii libc6 2.2.4-7 GNU C Library: Shared libraries an
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug#128847: binutils: [pa-risc] Bad linkage for float calls,
Torsten Landschoff <=