This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problem with JUMP_TABLES_IN_TEXT_SECTION and linkonce section
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 8 Jul 2004 10:59:03 -0700
- Subject: Problem with JUMP_TABLES_IN_TEXT_SECTION and linkonce section
For those targets which define JUMP_TABLES_IN_TEXT_SECTION as 0 and
support linkonce section, we may generate
.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 to make JUMP_TABLES_IN_TEXT_SECTION
depend on section and set it to 1 for linkonce sections. But I think
the best way to solve it is to use comdat group.
BTW, there is a testcase in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16276
for gcc 3.3. You need the binutils in CVS to see the error.
H.J.