Bug 16276 - [3.4 only] G++ generates local references to linkonce sections
Summary: [3.4 only] G++ generates local references to linkonce sections
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: link-failure
Depends on:
Blocks:
 
Reported: 2004-06-29 16:22 UTC by H.J. Lu
Modified: 2006-02-28 09:34 UTC (History)
6 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 4.0.0
Known to fail:
Last reconfirmed: 2006-01-15 21:04:31


Attachments
Another testcase (412.72 KB, application/octet-stream)
2004-07-08 09:44 UTC, Fabian Wenzel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-06-29 16:22:13 UTC
http://sources.redhat.com/bugzilla/show_bug.cgi?id=233

has a testcase where g++ generates non-debug local references
to linkonce sections. Due to a linker bug, those references
are ignored, which may lead to linker failure or corrupted
binary. With the fixed linker, I get

[hjl@gnu obj]$ g++ main.o modules/.libs/libmodules.a -B./
`local symbol 0' referenced in section `.text': discarded in section
`.gnu.linkonce.d._ZTIP9CTemplateIhE' from modules/.libs/libmodules.a(secondmodule.o)
`local symbol 1' referenced in section `.text': discarded in section
`.gnu.linkonce.d._ZTIP9CTemplateIhE' from modules/.libs/libmodules.a(secondmodule.o)
Comment 1 Andrew Pinski 2004-06-29 16:39:15 UTC
Huh? If that is the case then every gcc since 3.0 has been wrong.
Comment 2 H.J. Lu 2004-06-29 17:05:52 UTC
It could be the case.

BTW, local references to linkonce sections may be OK if they are also in
linkonce sections. In any case, it doesn't make any senses to have local
definions in linkonce sections referenced by other non-linkonce sections.
Comment 3 Fabian Wenzel 2004-07-05 08:13:47 UTC
(Reply to Andrews comment from 06/29): The bug appeared on my system not with
3.0 but with a later version. It may be though that the problem has been
introduced with 3.0. My project (which I stripped down to the testcase
http://sources.redhat.com/bugzilla/show_bug.cgi?id=233 also mentioned by HJL)
failed to build starting around the beginning of may on Debian/sid. I don't know
if this can help find the relevant gcc-parts which have been modified at that
time but who knows...
Comment 4 H.J. Lu 2004-07-06 22:45:06 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00526.html
Comment 5 Andrew Pinski 2004-07-07 05:14:21 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00526.html>.
Comment 6 GCC Commits 2004-07-07 18:29:49 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hjl@gcc.gnu.org	2004-07-07 18:29:40

Modified files:
	gcc/cp         : ChangeLog rtti.c 

Log message:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR c++/16276
	* rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
	is not public.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4172&r2=1.4173
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.185&r2=1.186

Comment 7 GCC Commits 2004-07-07 18:30:22 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	hjl@gcc.gnu.org	2004-07-07 18:30:19

Modified files:
	gcc/cp         : ChangeLog rtti.c 

Log message:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR c++/16276
	* rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
	is not public.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.130&r2=1.3892.2.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.176.4.3&r2=1.176.4.4

Comment 8 H.J. Lu 2004-07-07 18:31:15 UTC
A testcase patch is at

http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00637.html
Comment 9 GCC Commits 2004-07-08 04:58:17 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hjl@gcc.gnu.org	2004-07-08 04:58:11

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/rtti: tinfo1.C 

Log message:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR c++/16276
	* g++.dg/rtti/tinfo1.C: New file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3949&r2=1.3950
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/tinfo1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 10 GCC Commits 2004-07-08 05:00:52 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	hjl@gcc.gnu.org	2004-07-08 05:00:49

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/rtti: tinfo1.C 

Log message:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR c++/16276
	* g++.dg/rtti/tinfo1.C: New file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.222&r2=1.3389.2.223
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/tinfo1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1

Comment 11 Andrew Pinski 2004-07-08 05:03:37 UTC
Fixed for 3.4.2.
Comment 12 Fabian Wenzel 2004-07-08 09:44:41 UTC
Created attachment 6709 [details]
Another testcase

There are still references to linkonce - sections - now in .rodata. I cannot
reopen the bug, so this has to do someone else. I still think it makes sense
not to file a new one because it is related to the same problem.

Attached is a testcase. It uses vigra (template-based image processing
library), and I could not strip it down to not using it.
Comment 13 H.J. Lu 2004-07-08 15:35:13 UTC
Your testcase won't even compile with gcc 3.4.1:

/usr/gcc-3.4/bin/g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
-DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
-DPACKAGE=\"linkoncebug\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -I../.. -g -O2 -c
firstvigramodule.cpp  -fPIC -DPIC -o .libs/firstvigramodule.o
In file included from ../../vigra/stdimage.hxx:27,
                 from ../../vigra/edgedetection.hxx:31,
                 from firstvigramodule.cpp:4:
../../vigra/basicimage.hxx: In member function `PIXELTYPE&
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::operator*() const':
../../vigra/basicimage.hxx:289: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx:289: error: (if you use `-fpermissive', G++ will
accept your code, but allowing the use of an undeclared name is deprecated)
../../vigra/basicimage.hxx: In member function `PIXELTYPE*
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::operator->() const':
../../vigra/basicimage.hxx:294: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `PIXELTYPE&
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::operator[](const vigra::Diff2D&)
const':
../../vigra/basicimage.hxx:299: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `PIXELTYPE&
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::operator()(int, int) const':
../../vigra/basicimage.hxx:304: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `PIXELTYPE*
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::operator[](int) const':
../../vigra/basicimage.hxx:309: error: `y' undeclared (first use this function)
../../vigra/basicimage.hxx:309: error: (Each undeclared identifier is reported
only once for each function it appears in.)
../../vigra/basicimage.hxx:309: error: `x' undeclared (first use this function)
../../vigra/basicimage.hxx: In member function `PIXELTYPE*
vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::rowIterator() const':
../../vigra/basicimage.hxx:313: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function
`vigra::IteratorAdaptor<vigra::LineBasedColumnIteratorPolicy<vigra::BasicImageIterator<PIXELTYPE,
ITERATOR> > > vigra::BasicImageIterator<PIXELTYPE, ITERATOR>::columnIterator()
const':
../../vigra/basicimage.hxx:318: error: there are no arguments to `line' that
depend on a template parameter, so a declaration of `line' must be available
../../vigra/basicimage.hxx:318: error: `x' undeclared (first use this function)
../../vigra/basicimage.hxx: In member function `const PIXELTYPE&
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::operator*() const':
../../vigra/basicimage.hxx:422: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `const PIXELTYPE*
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::operator->() const':
../../vigra/basicimage.hxx:427: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `const PIXELTYPE&
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::operator[](const
vigra::Diff2D&) const':
../../vigra/basicimage.hxx:432: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `const PIXELTYPE&
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::operator()(int, int) const':
../../vigra/basicimage.hxx:437: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function `const PIXELTYPE*
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::operator[](int) const':
../../vigra/basicimage.hxx:442: error: `y' undeclared (first use this function)
../../vigra/basicimage.hxx:442: error: `x' undeclared (first use this function)
../../vigra/basicimage.hxx: In member function `const PIXELTYPE*
vigra::ConstBasicImageIterator<PIXELTYPE, ITERATOR>::rowIterator() const':
../../vigra/basicimage.hxx:446: error: there are no arguments to `current' that
depend on a template parameter, so a declaration of `current' must be available
../../vigra/basicimage.hxx: In member function
`vigra::IteratorAdaptor<vigra::LineBasedColumnIteratorPolicy<vigra::ConstBasicImageIterator<PIXELTYPE,
ITERATOR> > > vigra::ConstBasicImageIterator<PIXELTYPE,
ITERATOR>::columnIterator() const':
../../vigra/basicimage.hxx:451: error: there are no arguments to `line' that
depend on a template parameter, so a declaration of `line' must be available
../../vigra/basicimage.hxx:451: error: `x' undeclared (first use this function)
In file included from ../../vigra/iteratortraits.hxx:27,
                 from ../../vigra/stdimage.hxx:28,
                 from ../../vigra/edgedetection.hxx:31,
                 from firstvigramodule.cpp:4:
../../vigra/accessor.hxx: In member function `std::pair<typename
Acc1::value_type, typename Acc2::value_type> vigra::MultiImageAccessor2<Iter1,
Acc1, Iter2, Acc2>::operator()(DIFFERENCE) const':
../../vigra/accessor.hxx:951: error: `i' undeclared (first use this function)
In file included from ../../vigra/stdimage.hxx:30,
                 from ../../vigra/edgedetection.hxx:31,
                 from firstvigramodule.cpp:4:
../../vigra/rgbvalue.hxx: In member function `VALUETYPE&
vigra::RGBValue<VALUETYPE>::red()':
../../vigra/rgbvalue.hxx:161: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `VALUETYPE&
vigra::RGBValue<VALUETYPE>::green()':
../../vigra/rgbvalue.hxx:165: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `VALUETYPE&
vigra::RGBValue<VALUETYPE>::blue()':
../../vigra/rgbvalue.hxx:169: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `const VALUETYPE&
vigra::RGBValue<VALUETYPE>::red() const':
../../vigra/rgbvalue.hxx:173: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `const VALUETYPE&
vigra::RGBValue<VALUETYPE>::green() const':
../../vigra/rgbvalue.hxx:177: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `const VALUETYPE&
vigra::RGBValue<VALUETYPE>::blue() const':
../../vigra/rgbvalue.hxx:181: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `void
vigra::RGBValue<VALUETYPE>::setRed(V)':
../../vigra/rgbvalue.hxx:206: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `void
vigra::RGBValue<VALUETYPE>::setGreen(V)':
../../vigra/rgbvalue.hxx:212: error: `data_' undeclared (first use this function)
../../vigra/rgbvalue.hxx: In member function `void
vigra::RGBValue<VALUETYPE>::setBlue(V)':
../../vigra/rgbvalue.hxx:218: error: `data_' undeclared (first use this function)
In file included from ../../vigra/edgedetection.hxx:34,
                 from firstvigramodule.cpp:4:
../../vigra/separableconvolution.hxx: In member function `void
vigra::Kernel1D<ARITHTYPE>::initAveraging(int, ARITHTYPE)':
../../vigra/separableconvolution.hxx:1537: error: `i' undeclared (first use this
function)
Comment 14 H.J. Lu 2004-07-08 17:50:47 UTC
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.

Comment 15 H.J. Lu 2004-07-08 21:56:17 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00838.html
Comment 16 Andrew Pinski 2004-07-09 04:24:03 UTC
Reopening for now.
Comment 17 GCC Commits 2004-07-12 22:26:42 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	pinskia@gcc.gnu.org	2004-07-12 22:26:39

Modified files:
	gcc/cp         : ChangeLog rtti.c 

Log message:
	2004-07-12  Andrew Pinski  <apinski@apple.com>
	
	PR c++/16475
	Revert:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	PR c++/16276
	* rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
	is not public.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.131&r2=1.3892.2.132
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.176.4.4&r2=1.176.4.5

Comment 18 GCC Commits 2004-07-12 22:28:57 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-07-12 22:28:54

Modified files:
	gcc/cp         : ChangeLog rtti.c 

Log message:
	2004-07-12  Andrew Pinski  <apinski@apple.com>
	
	PR c++/16475
	Revert:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	PR c++/16276
	* rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
	is not public.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4193&r2=1.4194
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.187&r2=1.188

Comment 19 GCC Commits 2004-08-12 13:57:13 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2004-08-12 13:57:05

Modified files:
	gcc            : ChangeLog varasm.c output.h target-def.h 
	                 final.c target.h 
	gcc/testsuite  : ChangeLog 
	gcc/config/mcore: mcore.c 
	gcc/config/ip2k: ip2k.c 
	gcc/config/rs6000: xcoff.h 
	gcc/config/alpha: alpha.c 
	gcc/config/i386: i386-interix.h cygming.h 
	gcc/config/arm : pe.h 
	gcc/config/avr : avr.c 
	gcc/config     : darwin.h 
	gcc/doc        : tm.texi 
Added files:
	gcc/testsuite/g++.old-deja/g++.other: comdat4-aux.cc comdat4.C 

Log message:
	PR c++/16276
	* output.h (default_function_rodata_section,
	default_no_function_rodata_section): New prototypes.
	* target.h (struct gcc_target): Add asm_out.function_rodata_section.
	* target-def.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
	(TARGET_ASM_OUT): Add it.
	* varasm.c (default_function_rodata_section,
	default_no_function_rodata_section): New functions.
	* final.c (final_scan_insn): Call
	targetm.asm_out.function_rodata_section instead of
	readonly_data_section.
	* config/darwin.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
	* config/mcore/mcore.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/ip2k/ip2k.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/rs6000/xcoff.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/alpha/alpha.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/i386/cygming.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/i386/i386-interix.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/arm/pe.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* doc/tm.texi (TARGET_ASM_FUNCTION_RODATA_SECTION): Document.
	
	* g++.old-deja/g++.other/comdat4.C: New test.
	* g++.old-deja/g++.other/comdat4-aux.cc: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4878&r2=2.4879
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.438&r2=1.439
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/output.h.diff?cvsroot=gcc&r1=1.142&r2=1.143
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target-def.h.diff?cvsroot=gcc&r1=1.92&r2=1.93
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&r1=1.326&r2=1.327
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target.h.diff?cvsroot=gcc&r1=1.104&r2=1.105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4124&r2=1.4125
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mcore/mcore.c.diff?cvsroot=gcc&r1=1.68&r2=1.69
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ip2k/ip2k.c.diff?cvsroot=gcc&r1=1.39&r2=1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/xcoff.h.diff?cvsroot=gcc&r1=1.52&r2=1.53
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/alpha.c.diff?cvsroot=gcc&r1=1.381&r2=1.382
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386-interix.h.diff?cvsroot=gcc&r1=1.49&r2=1.50
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/cygming.h.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/pe.h.diff?cvsroot=gcc&r1=1.26&r2=1.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&r1=1.118&r2=1.119
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/darwin.h.diff?cvsroot=gcc&r1=1.88&r2=1.89
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/tm.texi.diff?cvsroot=gcc&r1=1.353&r2=1.354
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 20 Andrew Pinski 2004-08-12 14:38:29 UTC
Fixed in 3.5.0.  But it seems like this needs to be fixed in 3.4.0 also but I want to say the patch here is 
too big for the release branch, Mark?
Comment 21 Mark Mitchell 2004-08-12 17:46:08 UTC
Subject: Re:  [3.4 only] G++ generates local references to
 linkonce sections

pinskia at gcc dot gnu dot org wrote:

>------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-12 14:38 -------
>Fixed in 3.5.0.  But it seems like this needs to be fixed in 3.4.0 also but I want to say the patch here is 
>too big for the release branch, Mark?
>  
>
Actually, it looks OK to me -- if someone will backport it and test it.

Comment 22 Mark Mitchell 2004-08-23 21:00:13 UTC
Postponed until GCC 3.4.3.
Comment 23 GCC Commits 2004-09-01 15:48:13 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-09-01 15:48:02

Modified files:
	gcc            : ChangeLog final.c output.h target-def.h 
	                 target.h varasm.c 
	gcc/config/alpha: alpha.c 
	gcc/config/arm : pe.h 
	gcc/config/avr : avr.c 
	gcc/config/i386: cygming.h i386-interix.h 
	gcc/config/ip2k: ip2k.c 
	gcc/config/mcore: mcore.c 
	gcc/config/rs6000: xcoff.h 
	gcc/doc        : tm.texi 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.old-deja/g++.other: comdat4-aux.cc comdat4.C 

Log message:
	PR c++/16276
	* output.h (default_function_rodata_section,
	default_no_function_rodata_section): New prototypes.
	* target.h (struct gcc_target): Add asm_out.function_rodata_section.
	* target-def.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
	(TARGET_ASM_OUT): Add it.
	* varasm.c (default_function_rodata_section,
	default_no_function_rodata_section): New functions.
	* final.c (final_scan_insn): Call
	targetm.asm_out.function_rodata_section instead of
	readonly_data_section.
	* config/mcore/mcore.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
	* config/ip2k/ip2k.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/rs6000/xcoff.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/alpha/alpha.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/i386/cygming.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/i386/i386-interix.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
	Likewise.
	* config/arm/pe.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
	* doc/tm.texi (TARGET_ASM_FUNCTION_RODATA_SECTION): Document.
	
	* g++.old-deja/g++.other/comdat4.C: New test.
	* g++.old-deja/g++.other/comdat4-aux.cc: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=2.2326.2.399.2.29&r2=2.2326.2.399.2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.304.4.2&r2=1.304.4.2.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/output.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.133.10.2&r2=1.133.10.2.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target-def.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.63.4.2.2.1&r2=1.63.4.2.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.74.2.3.2.1&r2=1.74.2.3.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.405.2.3&r2=1.405.2.3.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/alpha.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.342.4.8.2.2&r2=1.342.4.8.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/pe.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.23.6.1&r2=1.23.6.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.108.4.2&r2=1.108.4.2.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/cygming.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.11.4.1.2.1&r2=1.11.4.1.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386-interix.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.47.4.1&r2=1.47.4.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ip2k/ip2k.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.29.4.1&r2=1.29.4.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mcore/mcore.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.55.4.1&r2=1.55.4.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/xcoff.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.51.4.1&r2=1.51.4.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/tm.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.281.2.13.2.3&r2=1.281.2.13.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3389.2.170.2.15&r2=1.3389.2.170.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.8.1

Comment 24 GCC Commits 2004-09-01 15:51:36 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-09-01 15:51:34

Modified files:
	gcc            : ChangeLog 
	gcc/cp         : rtti.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/rtti: tinfo1.C 

Log message:
	2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR c++/16276
	* rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
	is not public.
	
	2004-08-18  Jakub Jelinek  <jakub@redhat.com>
	
	Revert:
	2004-07-27  Andrew Pinski  <apinski@apple.com>
	* g++.dg/rtti/tinfo1.C: Correct the xfail.
	
	2004-07-26  Andrew Pinski  <apinski@apple.com>
	* g++.dg/rtti/tinfo1.C: Xfail.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=2.2326.2.399.2.30&r2=2.2326.2.399.2.31
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.176.4.3&r2=1.176.4.3.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3389.2.170.2.16&r2=1.3389.2.170.2.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/tinfo1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.1.6.2&r2=1.1.6.3

Comment 25 Andrew Pinski 2004-09-27 04:05:54 UTC
The patch referenced via an url to gcc-patches is wrong, someone needs to find the one which was 
applied to fix the problem and back port it to 3.4.
Comment 26 GCC Commits 2004-10-29 13:00:10 UTC
Subject: Bug 16276

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-10-29 12:59:56

Modified files:
	gcc            : ChangeLog final.c output.h varasm.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.old-deja/g++.other: comdat4-aux.cc comdat4.C 

Log message:
	PR c++/16276
	* output.h (function_readonly_data_section): New prototype.
	* varasm.c (function_readonly_data_section): New function.
	* final.c (final_scan_insn): Call it instead of
	readonly_data_section.
	
	* g++.old-deja/g++.other/comdat4.C: New test.
	* g++.old-deja/g++.other/comdat4-aux.cc: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.16114.2.523.2.114&r2=1.16114.2.523.2.115
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.271.2.1.4.2&r2=1.271.2.1.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/output.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.116.6.1&r2=1.116.6.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.324.2.4.2.10&r2=1.324.2.4.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.2261.2.170.2.62&r2=1.2261.2.170.2.63
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4-aux.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=NONE&r2=1.1.32.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/comdat4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=NONE&r2=1.1.32.1

Comment 28 Mark Mitchell 2004-10-31 01:03:59 UTC
Postponed until GCC 3.4.4.
Comment 29 H.J. Lu 2004-12-03 17:51:33 UTC
An updated patch for gcc 3.4 is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00276.html
Comment 30 Gabriel Dos Reis 2006-02-28 09:34:53 UTC
Fixed in 4.0 and up.
Won't fix for 3.4.6.