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

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

Re: gnu ld problem with sparc solaris 2.8 assembler


From: Nick Clifton
Subject: Re: gnu ld problem with sparc solaris 2.8 assembler
Date: Thu, 19 Oct 2000 10:20:14 -0700

Hi Ted,

: Issue 2: with the following program:
: 
: void FooBar(void) {;}
: int Value=(int)FooBar;
: int main(void)
: {
:     return Value;
: }

  First of all, just a quick note to say that the above is actually
bad C, since there is no guarantee that a function pointer can be
stored in an int.  It would probably be better to use function
pointers throughout:

  int FooBar (void) { return 1; }
  int (* Value)(void) = FooBar;
  int main (void) { return Value (); }

: We had no problem on SunOS5.5.1, but on two different computers with
: SunOS5.8 we had a problem when using the combination of the gcc
: compiler (gcc-2.95.2), the sun /usr/ccs/bin/as, and the gnu "ld" 
: (binutils-2.9.5.0.22).

Secondly - can you show us what the objdump output looks like for a
program like this ?  I would be particularly interested to see what
'objdump -dr' shows for the .o output of Sun's "as", ie which
relocations it is producing to initialise Value, since it is
presumably an incorrect implementation of these relocations by the GNU
linker that is causing the problem.

Cheers
        Nick



reply via email to

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