This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16276] G++ generates local references to linkonce sections
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2004 17:50:49 -0000
- Subject: [Bug c++/16276] G++ generates local references to linkonce sections
- References: <20040629162213.16276.hjl@lucon.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From hjl at lucon dot org 2004-07-08 17:50 -------
I assume you compiled your testcase with gcc 3.3, which doesn't have my
fix. I looked at the assembly output and I found the problem. We are
generating
.section .gnu.linkonce.t.foo
...
.L1:
...
.L2:
...
.L3:
...
.L4:
...
jmp *.L5(,%esi,4)
.section .rodata
.align 4
.align 4
.L5:
.long .L1
.long .L2
.long .L3
.long .L4
Now if .gnu.linkonce.t.foo is discarded, we have undefined references in
.rodata. One way to solve it is not to use .rodata. I think the best way
to solve it is to use comdat group.
BTW, I think you should open a new bug report and provide a testcase for
gcc 3.4.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16276