This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

undefined .LL9 symbol whith -O2 on solaris 2.7 with gcc 3.0


Hello,

I have encountered a bug on Solaris 2.7 with gcc 3.0.

The problem occurs at link time. If the -O2 flag is used, then there is
an undefined global symbol in the object file, and this symbol is not
resolved at link time.

Here is a self contained file that reproduces the bug, in this case, the
undefined symbol is .LL9:

typedef struct { int x, y; } A;

typedef union { int type;
                A xkey;
                A xbutton;
                A xmotion;
                long pad[24];
              } B;

void ffff (int *, int *);

void ggggg (B *event)
{
  int x, y;
  switch(event->type)
  {
  case 4:
  case 5:
      x = event->xbutton.x;
      y = event->xbutton.y;
      break;
  case 2:
  case 3:
      x = event->xkey.x;
      y = event->xkey.y;
      break;
  case 6:
      x = event->xmotion.x;
      y = event->xmotion.y;
      break;
  default:
      return;
  }
  ffff(&x, &y);
}


I compile this program with the following command:
         gcc -O2 -c x.c

If I look at the symbol table with nm, I get this result:

(tucana) luc% nm x.o | grep LL
[5]        |         0|       0|NOTY |GLOB |0    |UNDEF  |.LL9



I use a standard gcc 3.0 built on Solaris 2.7:

(tucana) luc% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.0/specs
Configured with: ../configure --prefix=/usr/local --enable-shared
--enable-threads --enable-languages=c++,f77,java --enable-libgcj
Thread model: posix
gcc version 3.0


                                                        Luc

-- 
-----------------------------------------------------------------------
 Luc Maisonobe - DTS/MPI/MS/AM       |  Tel  : (33) 05-61-28-26-31
            CNES                     |  Fax  : (33) 05-61-27-35-40
     18 avenue E. Belin              |
 31401 Toulouse CEDEX 4 - FRANCE     |  Email: Luc.Maisonobe@cnes.fr
-----------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]