This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/4109: undefined symbol whith -O2 on solaris 2.7 with gcc 3.0
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/4109: undefined symbol whith -O2 on solaris 2.7 with gcc 3.0
- From: Luc dot Maisonobe at cnes dot fr
- Date: 24 Aug 2001 07:17:29 -0000
- Reply-To: Luc dot Maisonobe at cnes dot fr
>Number: 4109
>Category: c
>Synopsis: undefined symbol whith -O2 on solaris 2.7 with gcc 3.0
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Aug 24 00:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Luc.Maisonobe@cnes.fr
>Release: gcc-3.0
>Organization:
>Environment:
Solaris 2.7
>Description:
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.
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
>How-To-Repeat:
compile the attached file with the -O2 flag :
gcc -O2 -c x.c
look at the symbol table :
nm x.o | grep LL
I get this on my machine :
[5] | 0| 0|NOTY |GLOB |0 |UNDEF |.LL9
>Fix:
the problem disappears when optimization is turned off
>Release-Note:
>Audit-Trail:
>Unformatted:
undefined symbol whith -O2 on solaris 2.7 with gcc 3.0
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="x.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="x.c"
dHlwZWRlZiBzdHJ1Y3QgeyBpbnQgeCwgeTsgfSBBOwoKdHlwZWRlZiB1bmlvbiB7IGludCB0eXBl
OwogICAgICAgICAgICAgICAgQSB4a2V5OwogICAgICAgICAgICAgICAgQSB4YnV0dG9uOwogICAg
ICAgICAgICAgICAgQSB4bW90aW9uOwogICAgICAgICAgICAgICAgbG9uZyBwYWRbMjRdOwogICAg
ICAgICAgICAgIH0gQjsKCnZvaWQgZmZmZiAoaW50ICosIGludCAqKTsKCnZvaWQgZ2dnZ2cgKEIg
KmV2ZW50KQp7CiAgaW50IHgsIHk7CiAgc3dpdGNoKGV2ZW50LT50eXBlKQogIHsKICBjYXNlIDQ6
CiAgY2FzZSA1OgogICAgICB4ID0gZXZlbnQtPnhidXR0b24ueDsKICAgICAgeSA9IGV2ZW50LT54
YnV0dG9uLnk7CiAgICAgIGJyZWFrOwogIGNhc2UgMjoKICBjYXNlIDM6CiAgICAgIHggPSBldmVu
dC0+eGtleS54OwogICAgICB5ID0gZXZlbnQtPnhrZXkueTsKICAgICAgYnJlYWs7CiAgY2FzZSA2
OgogICAgICB4ID0gZXZlbnQtPnhtb3Rpb24ueDsKICAgICAgeSA9IGV2ZW50LT54bW90aW9uLnk7
CiAgICAgIGJyZWFrOwogIGRlZmF1bHQ6CiAgICAgIHJldHVybjsKICB9CiAgZmZmZigmeCwgJnkp
Owp9Cg==