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]
Other format: [Raw text]

debug/5770: undefined reference to `.LC0'



>Number:         5770
>Category:       debug
>Synopsis:       undefined reference to `.LC0'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 24 12:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     michael@ritzert.de
>Release:        gcc version 3.1 20020224 (experimental)
>Organization:
>Environment:
Reading specs from /3/gcc/HEAD/install/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /3/gcc/HEAD/gcc/configure --enable-threads=posix --prefix=/3/gcc/HEAD/install
Thread model: posix
gcc version 3.1 20020224 (experimental)
>Description:
# cat bug.cpp
static const char foo[] = "bar";

int
main( int, char* )
{
        return 0;
}

# c++ -O2 -g -o bug bug.cpp
/tmp/ccwmyhBY.o(.debug_info+0x95): undefined reference to `.LC0'
collect2: ld returned 1 exit status

Does not happen when I omit either of '-O2' or '-g'.

Also does not happen with gcc version 3.1 20020123 (experimental) on hppa1.1-hp-hpux11.00 or 2.95.3 and 3.0.2 on i686-pc-linux-gnu.
>How-To-Repeat:
Compile attached file with -O2 -g and try to link the object file.
>Fix:
Use static const char* foo = "bar", omit -O2 or -g.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cpp"

c3RhdGljIGNvbnN0IGNoYXIgZm9vW10gPSAiYmFyIjsKCmludAptYWluKCBpbnQsIGNoYXIqICkK
ewoJcmV0dXJuIDA7Cn0KCg==


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