Bug 60819

Summary: Unresolved symbols with g++ -g -O2
Product: [Retired] Red Hat Raw Hide Reporter: Stefan Sorensen <sts>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-07 11:48:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Sorensen 2002-03-07 11:48:30 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.1.3 (X11; Linux i686; U;) Gecko/20020206

Description of problem:
When defining a global const variable, compiling it with g++ with optimization
and debugging turned on, unresolved symbold are generated.

Version-Release number of selected component (if applicable):
3.1-0.21

How reproducible:
Always

Steps to Reproduce:
$ cat foo.cpp
const char foo[] = "bar";
$ g++ -g -O2 -c foo.cpp
$ nm foo.o
         U .LC0


Actual Results:  An unresolved symbol.

Expected Results: No unresolved symbols.

Additional info:

Leaving out debugging info, optimization or const qualifier produces expected
result.

Comment 1 Jakub Jelinek 2002-03-09 21:57:19 UTC
This should be fixed in 3.1-0.22.