This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
undefined .LL9 symbol whith -O2 on solaris 2.7 with gcc 3.0
- To: gcc-bugs at gcc dot gnu dot org
- Subject: undefined .LL9 symbol whith -O2 on solaris 2.7 with gcc 3.0
- From: Luc Maisonobe <Luc dot Maisonobe at cnes dot fr>
- Date: Wed, 04 Jul 2001 14:56:35 +0200
- Organization: CNES
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
-----------------------------------------------------------------------