This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/16849] New: Jump tables for linkonce sections in non-linkonce section
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Aug 2004 08:12:17 -0000
- Subject: [Bug other/16849] New: Jump tables for linkonce sections in non-linkonce section
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When final_scan_insn() emit a jump-table it always puts it in the
readonly_data_section (unless JUMP_TABLES_IN_TEXT_SECTION). If the current
function is located in a linkonce section this generates a reference from a
non-linkonce section to a local label of a linkonce section, and current
binutils complain if the linkonce section is discarded.
$ cat inline.h
inline int foo (int x)
{
switch (x)
{
default:
return -1;
case 1:
return 0;
case 2:
return 1;
case 4:
return 2;
case 8:
return 3;
case 16:
return 4;
case 32:
return 5;
case 64:
return 6;
}
}
$ cat inline1.cc
#include "inline.h"
int (*x1) (int) = foo;
$ cat inline2.cc
#include "inline.h"
int (*x2) (int) = foo;
$ gcc -fPIC -shared inline1.cc inline2.cc
`.gnu.linkonce.t._Z3fooi' referenced in section `.rodata' of /tmp/ccvGwdXw.o:
defined in discarded section `.gnu.linkonce.t._Z3fooi' of /tmp/ccvGwdXw.o
collect2: ld returned 1 exit status
--
Summary: Jump tables for linkonce sections in non-linkonce
section
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schwab at suse dot de
CC: gcc-bugs at gcc dot gnu dot org,matz at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16849