public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org> To: gcc-gnats@gcc.gnu.org Subject: debug/6577: debug info of static const variables leads to undefined references Date: Mon, 06 May 2002 04:26:00 -0000 [thread overview] Message-ID: <15574.26543.201662.809490@honolulu.ilog.fr> (raw) >Number: 6577 >Category: debug >Synopsis: debug info of static const variables leads to undefined references >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Mon May 06 04:26:05 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Bruno Haible >Release: 3.1 20020423 (prerelease) >Organization: GNU hackers >Environment: System: Linux linuix 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../configure --prefix=/packages/gnu-snapshot --enable-shared --enable-version-specific-runtime-libs --enable-nls >Description: For C++ variables with attributes 'static const' which can be optimized away, the debug info that is generated leads to undefined references. >How-To-Repeat: $ cat <<\EOF > foo.cc struct cl_class {}; extern cl_class cl_class_fixnum; extern cl_class cl_class_bignum; static const void* const cl_I_classes_dummy[] = { &cl_I_classes_dummy, &cl_class_fixnum }; int main () {} EOF $ g++ -O2 foo.cc ; OK, no error $ g++ -O2 -g foo.cc /usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14. /usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14. /usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14. /tmp/cco4BRgH.o::7: undefined reference to `cl_I_classes_dummy' /tmp/cco4BRgH.o::7: undefined reference to `cl_class_fixnum' collect2: ld returned 1 exit status >Fix: Omit the debug info for variables which are optimized away. >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2002-05-06 11:26 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-05-06 4:26 Bruno Haible [this message] 2003-03-14 2:56 bangerth 2003-04-23 12:56 Bruno Haible 2003-04-23 14:05 bangerth
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=15574.26543.201662.809490@honolulu.ilog.fr \ --to=bruno@clisp.org \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).