Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Bernd Anhaeupl
Mon, 09 Nov 1992 12:24
gcc 2.3.1 - HPPA shared libraries bug
Author: Bernd Anhaeupl
Date: Mon, 09 Nov 1992 12:24
Date: Mon, 09 Nov 1992 12:24
56 lines
4144 bytes
4144 bytes
gcc Version: 2.3.1 (both versions from prep.ai.mit edu and jaguar.cs.utah.edu (u1))
gcc config: configure hp720-hpux --gas
description:
the following program does not link using the shared libraries:
------------cut here-----------------
#include <stdio.h>
static int (*a)(char const *,...) = printf;
int main()
{
(*a)("Hello, world!\n");
return 0;
}
------------cut here-----------------
compilation without static:
------------------------------------------
gcc -V 2.3.1 -v test.c
Reading specs from /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/specs
gcc version 2.3.1-u1
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__-D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE test.c /usr/tmp/cca01849.i
GNU CPP version 2.3.1 (hppa)
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/cc1 /usr/tmp/cca01849.i -quiet -dumpbase test.c -version -o /usr/tmp/cca01849.s
GNU C version 2.3.1 (hppa) compiled by GNU C version 2.3.1.
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/as -o /usr/tmp/cca018491.o /usr/tmp/cca01849.s
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/ld -u main -L/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1 -L/users/late/gnu/lib /lib/crt0.o /usr/tmp/cca018491.o /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/libgcc.a -lc /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/libgcc.a
ld: R_DATA_ONE_SYMBOL fixup in file /usr/tmp/cca018491.o for code unsat symbol "printf" - use P' fixup
collect: /bin/ld returned 1 exit status
-------------------------------------------
compilation with -static (after simple patch to specs which inserts -a archive when linking)
-------------------------------------------
gcc -V 2.3.1 -static -v test.c
Reading specs from /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/specs
gcc version 2.3.1-u1
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__-D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE test.c /usr/tmp/cca01898.i
GNU CPP version 2.3.1 (hppa)
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/cc1 /usr/tmp/cca01898.i -quiet -dumpbase test.c -version -o /usr/tmp/cca01898.s
GNU C version 2.3.1 (hppa) compiled by GNU C version 2.3.1.
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/as -o /usr/tmp/cca018981.o /usr/tmp/cca01898.s
/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/ld -u main -a archive -L/users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1 -L/users/late/gnu/lib /lib/crt0.o /usr/tmp/cca018981.o /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/libgcc.a -lc /users/late/gnu/lib/gcc-lib/hp720-hpux/2.3.1/libgcc.a
-----------------------------------------------------------------------------------
ps:
HPUX 8.07 cc also does not like this program, if you use an intermediate assembler file:
---------------------------
cc -S test.c; cc test.s
as: test.s @line#2 [err#7]
(warning) Space characteristics may not be changed after first declaration
as: test.s @line#36 [err#7]
(warning) Space characteristics may not be changed after first declaration
/bin/ld: R_DATA_ONE_SYMBOL fixup in file test.o for code unsat symbol "printf" - use P' fixup
---------------------------
Bernd Anhaeupl
(anhaeupl@late.e-technik.uni-erlangen.de)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads