* Re: [PATCH] Revert HJL's G++ generates local references to linkonce
2004-07-09 7:15 ` Mark Mitchell
@ 2004-07-13 0:37 ` Andrew Pinski
2004-07-13 1:20 ` Mark Mitchell
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2004-07-13 0:37 UTC (permalink / raw)
To: Mark Mitchell; +Cc: Andrew Pinski, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 11148 bytes --]
>
> Andrew Pinski wrote:
>
> >The problem with HJL's patch to fix G++ generates local references to linkonce is
> >that it is wrong for targets which use the MAKE_DECL_ONE_ONLY target macro which I
> >think only *-darwin does.
> >
> >I am only askinig reverting for the mainline as the 3.4 branch does not have the target
> >macro.
> >
> >OK?
> >
> OK.
>
> Since I approved the original patch, I can approve its reversion too. :-)
I figured out a better way of fixing this regression besides reverting the patch.
See <http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00878.html>.
Here is the updated patch which has been bootstrapped on powerpc-apple-darwin and fixes these
two regressions and also should fix the regressions on the other targets too unlike my previous patch
in the message above.
OK?
ChangLog:
PR c++/16475
* config/darwin-protos.h (darwin_make_decl_non_one_only): Prototype.
* config/darwin.c (darwin_make_decl_non_one_only): Declare.
* config/darwin.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/elfos.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/alpha/elf.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/i386/djgpp.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/mips/elf.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/mips/elf64.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/mips/iris5gld.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/mips/iris6gld.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/mmix/mmix.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* config/pa/som.h (MAKE_DECL_NON_ONE_ONLY): Declare.
* doc/tm.texi (MAKE_DECL_NON_ONE_ONLY): Document.
cp/ChangeLog:
PR c++/16475
* cp/rtti.c (emit_tinfo_decl): Call MAKE_DECL_NON_ONE_ONLY when
making the decl non weak.
Index: config/darwin-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin-protos.h,v
retrieving revision 1.35
diff -u -p -r1.35 darwin-protos.h
--- config/darwin-protos.h 19 May 2004 02:11:42 -0000 1.35
+++ config/darwin-protos.h 12 Jul 2004 20:39:08 -0000
@@ -85,6 +85,7 @@ extern void darwin_pragma_unused (struct
extern void darwin_file_end (void);
extern void darwin_make_decl_one_only (tree decl);
+extern void darwin_make_decl_non_one_only (tree decl);
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
extern void const_section (void);
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.71
diff -u -p -r1.71 darwin.c
--- config/darwin.c 10 Jul 2004 05:54:26 -0000 1.71
+++ config/darwin.c 12 Jul 2004 20:39:08 -0000
@@ -1142,6 +1142,14 @@ darwin_make_decl_one_only (tree decl)
}
void
+darwin_make_decl_non_one_only (tree decl)
+{
+ TREE_PUBLIC (decl) = 0;
+ DECL_ONE_ONLY (decl) = 0;
+ DECL_SECTION_NAME (decl) = NULL;
+}
+
+void
machopic_select_section (tree exp, int reloc,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.84
diff -u -p -r1.84 darwin.h
--- config/darwin.h 11 Jul 2004 00:23:39 -0000 1.84
+++ config/darwin.h 12 Jul 2004 20:39:08 -0000
@@ -335,6 +335,10 @@ do { text_section (); \
/* Making a symbols weak on Darwin requires more than just setting DECL_WEAK. */
#define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL)
+/* Making a symbol non-weak again on Darwin requires more than just
+ setting DECL_WEAK. */
+#define MAKE_DECL_NON_ONE_ONLY(DECL) darwin_make_decl_non_one_only (DECL)
+
/* Representation of linkonce symbols for the MACH-O assembler. Linkonce
symbols must be given a special section *and* must be preceded by a
special assembler directive. */
Index: config/elfos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/elfos.h,v
retrieving revision 1.65
diff -u -p -r1.65 elfos.h
--- config/elfos.h 5 Jul 2004 19:49:13 -0000 1.65
+++ config/elfos.h 12 Jul 2004 20:39:08 -0000
@@ -213,6 +213,7 @@ Boston, MA 02111-1307, USA. */
#endif
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
Index: config/alpha/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/elf.h,v
retrieving revision 1.75
diff -u -p -r1.75 elf.h
--- config/alpha/elf.h 25 Dec 2003 15:17:34 -0000 1.75
+++ config/alpha/elf.h 12 Jul 2004 20:39:08 -0000
@@ -229,6 +229,7 @@ void FN (void) \
#define TARGET_ASM_SELECT_SECTION default_elf_select_section
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
Index: config/i386/djgpp.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/djgpp.h,v
retrieving revision 1.48
diff -u -p -r1.48 djgpp.h
--- config/i386/djgpp.h 31 Jan 2004 02:06:57 -0000 1.48
+++ config/i386/djgpp.h 12 Jul 2004 20:39:08 -0000
@@ -196,3 +196,4 @@ while (0)
/* Support for C++ templates. */
#undef MAKE_DECL_ONE_ONLY
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
Index: config/mips/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf.h,v
retrieving revision 1.61
diff -u -p -r1.61 elf.h
--- config/mips/elf.h 31 Jan 2004 02:07:02 -0000 1.61
+++ config/mips/elf.h 12 Jul 2004 20:39:08 -0000
@@ -106,6 +106,7 @@ Boston, MA 02111-1307, USA. */
} while (0)
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
Index: config/mips/elf64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf64.h,v
retrieving revision 1.63
diff -u -p -r1.63 elf64.h
--- config/mips/elf64.h 31 Jan 2004 02:07:02 -0000 1.63
+++ config/mips/elf64.h 12 Jul 2004 20:39:08 -0000
@@ -91,6 +91,7 @@ Boston, MA 02111-1307, USA. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
crtstuff.c and other files know this by defining the following symbols.
Index: config/mips/iris5gld.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5gld.h,v
retrieving revision 1.1
diff -u -p -r1.1 iris5gld.h
--- config/mips/iris5gld.h 17 Feb 2004 20:42:53 -0000 1.1
+++ config/mips/iris5gld.h 12 Jul 2004 20:39:08 -0000
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
@@ -73,3 +74,4 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
Index: config/mips/iris6gld.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6gld.h,v
retrieving revision 1.14
diff -u -p -r1.14 iris6gld.h
--- config/mips/iris6gld.h 17 Feb 2004 20:42:53 -0000 1.14
+++ config/mips/iris6gld.h 12 Jul 2004 20:39:08 -0000
@@ -55,6 +55,7 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
Index: config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.65
diff -u -p -r1.65 mmix.h
--- config/mmix/mmix.h 9 Jul 2004 00:29:14 -0000 1.65
+++ config/mmix/mmix.h 12 Jul 2004 20:39:09 -0000
@@ -936,6 +936,7 @@ typedef struct { int regs; int lib; } CU
#define MAKE_DECL_ONE_ONLY(DECL) \
mmix_make_decl_one_only (DECL)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
mmix_asm_output_labelref (STREAM, NAME)
Index: config/pa/som.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/som.h,v
retrieving revision 1.47
diff -u -p -r1.47 som.h
--- config/pa/som.h 2 Nov 2003 01:01:24 -0000 1.47
+++ config/pa/som.h 12 Jul 2004 20:39:09 -0000
@@ -366,6 +366,7 @@ do { \
/* Use weak (secondary definitions) to make one only declarations. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* This is how we tell the assembler that a symbol is weak. The SOM
weak implementation uses the secondary definition (sdef) flag.
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.187
diff -u -p -r1.187 rtti.c
--- cp/rtti.c 12 Jul 2004 16:06:35 -0000 1.187
+++ cp/rtti.c 12 Jul 2004 20:39:09 -0000
@@ -1463,7 +1463,13 @@ emit_tinfo_decl (tree decl)
{
DECL_COMDAT (decl) = 0;
if (SUPPORTS_ONE_ONLY)
- DECL_ONE_ONLY (decl) = 0;
+ {
+#ifdef MAKE_DECL_NON_ONE_ONLY
+ MAKE_DECL_NON_ONE_ONLY (decl);
+#endif
+ DECL_ONE_ONLY (decl) = 0;
+
+ }
}
DECL_INITIAL (decl) = var_init;
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.338
diff -u -p -r1.338 tm.texi
--- doc/tm.texi 9 Jul 2004 22:42:43 -0000 1.338
+++ doc/tm.texi 12 Jul 2004 20:39:12 -0000
@@ -6728,6 +6728,13 @@ section flags in the Microsoft Windows P
requires changes to @var{decl}, such as putting it in a separate section.
@end defmac
+@defmac MAKE_DECL_NON_ONE_ONLY (@var{decl})
+A C statement (sans semicolon) to mark @var{decl} to be emitted as a
+public symbol such that extra copies in multiple translation units will
+be not discarded by the linker. This is used to revert the effects of
+the MAKE_DECL_ONE_ONLY macro.
+@end defmac
+
@defmac SUPPORTS_ONE_ONLY
A C expression which evaluates to true if the target supports one-only
semantics.
[-- Attachment #2: ASCII C program text --]
[-- Type: text/plain, Size: 9339 bytes --]
Index: config/darwin-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin-protos.h,v
retrieving revision 1.35
diff -u -p -r1.35 darwin-protos.h
--- config/darwin-protos.h 19 May 2004 02:11:42 -0000 1.35
+++ config/darwin-protos.h 12 Jul 2004 20:39:08 -0000
@@ -85,6 +85,7 @@ extern void darwin_pragma_unused (struct
extern void darwin_file_end (void);
extern void darwin_make_decl_one_only (tree decl);
+extern void darwin_make_decl_non_one_only (tree decl);
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
extern void const_section (void);
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.71
diff -u -p -r1.71 darwin.c
--- config/darwin.c 10 Jul 2004 05:54:26 -0000 1.71
+++ config/darwin.c 12 Jul 2004 20:39:08 -0000
@@ -1142,6 +1142,14 @@ darwin_make_decl_one_only (tree decl)
}
void
+darwin_make_decl_non_one_only (tree decl)
+{
+ TREE_PUBLIC (decl) = 0;
+ DECL_ONE_ONLY (decl) = 0;
+ DECL_SECTION_NAME (decl) = NULL;
+}
+
+void
machopic_select_section (tree exp, int reloc,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.84
diff -u -p -r1.84 darwin.h
--- config/darwin.h 11 Jul 2004 00:23:39 -0000 1.84
+++ config/darwin.h 12 Jul 2004 20:39:08 -0000
@@ -335,6 +335,10 @@ do { text_section (); \
/* Making a symbols weak on Darwin requires more than just setting DECL_WEAK. */
#define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL)
+/* Making a symbol non-weak again on Darwin requires more than just
+ setting DECL_WEAK. */
+#define MAKE_DECL_NON_ONE_ONLY(DECL) darwin_make_decl_non_one_only (DECL)
+
/* Representation of linkonce symbols for the MACH-O assembler. Linkonce
symbols must be given a special section *and* must be preceded by a
special assembler directive. */
Index: config/elfos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/elfos.h,v
retrieving revision 1.65
diff -u -p -r1.65 elfos.h
--- config/elfos.h 5 Jul 2004 19:49:13 -0000 1.65
+++ config/elfos.h 12 Jul 2004 20:39:08 -0000
@@ -213,6 +213,7 @@ Boston, MA 02111-1307, USA. */
#endif
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
Index: config/alpha/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/elf.h,v
retrieving revision 1.75
diff -u -p -r1.75 elf.h
--- config/alpha/elf.h 25 Dec 2003 15:17:34 -0000 1.75
+++ config/alpha/elf.h 12 Jul 2004 20:39:08 -0000
@@ -229,6 +229,7 @@ void FN (void) \
#define TARGET_ASM_SELECT_SECTION default_elf_select_section
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
Index: config/i386/djgpp.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/djgpp.h,v
retrieving revision 1.48
diff -u -p -r1.48 djgpp.h
--- config/i386/djgpp.h 31 Jan 2004 02:06:57 -0000 1.48
+++ config/i386/djgpp.h 12 Jul 2004 20:39:08 -0000
@@ -196,3 +196,4 @@ while (0)
/* Support for C++ templates. */
#undef MAKE_DECL_ONE_ONLY
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
Index: config/mips/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf.h,v
retrieving revision 1.61
diff -u -p -r1.61 elf.h
--- config/mips/elf.h 31 Jan 2004 02:07:02 -0000 1.61
+++ config/mips/elf.h 12 Jul 2004 20:39:08 -0000
@@ -106,6 +106,7 @@ Boston, MA 02111-1307, USA. */
} while (0)
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
Index: config/mips/elf64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf64.h,v
retrieving revision 1.63
diff -u -p -r1.63 elf64.h
--- config/mips/elf64.h 31 Jan 2004 02:07:02 -0000 1.63
+++ config/mips/elf64.h 12 Jul 2004 20:39:08 -0000
@@ -91,6 +91,7 @@ Boston, MA 02111-1307, USA. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
crtstuff.c and other files know this by defining the following symbols.
Index: config/mips/iris5gld.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5gld.h,v
retrieving revision 1.1
diff -u -p -r1.1 iris5gld.h
--- config/mips/iris5gld.h 17 Feb 2004 20:42:53 -0000 1.1
+++ config/mips/iris5gld.h 12 Jul 2004 20:39:08 -0000
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
@@ -73,3 +74,4 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
Index: config/mips/iris6gld.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6gld.h,v
retrieving revision 1.14
diff -u -p -r1.14 iris6gld.h
--- config/mips/iris6gld.h 17 Feb 2004 20:42:53 -0000 1.14
+++ config/mips/iris6gld.h 12 Jul 2004 20:39:08 -0000
@@ -55,6 +55,7 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
Index: config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.65
diff -u -p -r1.65 mmix.h
--- config/mmix/mmix.h 9 Jul 2004 00:29:14 -0000 1.65
+++ config/mmix/mmix.h 12 Jul 2004 20:39:09 -0000
@@ -936,6 +936,7 @@ typedef struct { int regs; int lib; } CU
#define MAKE_DECL_ONE_ONLY(DECL) \
mmix_make_decl_one_only (DECL)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
mmix_asm_output_labelref (STREAM, NAME)
Index: config/pa/som.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/som.h,v
retrieving revision 1.47
diff -u -p -r1.47 som.h
--- config/pa/som.h 2 Nov 2003 01:01:24 -0000 1.47
+++ config/pa/som.h 12 Jul 2004 20:39:09 -0000
@@ -366,6 +366,7 @@ do { \
/* Use weak (secondary definitions) to make one only declarations. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#define MAKE_DECL_NON_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 0)
/* This is how we tell the assembler that a symbol is weak. The SOM
weak implementation uses the secondary definition (sdef) flag.
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.187
diff -u -p -r1.187 rtti.c
--- cp/rtti.c 12 Jul 2004 16:06:35 -0000 1.187
+++ cp/rtti.c 12 Jul 2004 20:39:09 -0000
@@ -1463,7 +1463,13 @@ emit_tinfo_decl (tree decl)
{
DECL_COMDAT (decl) = 0;
if (SUPPORTS_ONE_ONLY)
- DECL_ONE_ONLY (decl) = 0;
+ {
+#ifdef MAKE_DECL_NON_ONE_ONLY
+ MAKE_DECL_NON_ONE_ONLY (decl);
+#endif
+ DECL_ONE_ONLY (decl) = 0;
+
+ }
}
DECL_INITIAL (decl) = var_init;
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.338
diff -u -p -r1.338 tm.texi
--- doc/tm.texi 9 Jul 2004 22:42:43 -0000 1.338
+++ doc/tm.texi 12 Jul 2004 20:39:12 -0000
@@ -6728,6 +6728,13 @@ section flags in the Microsoft Windows P
requires changes to @var{decl}, such as putting it in a separate section.
@end defmac
+@defmac MAKE_DECL_NON_ONE_ONLY (@var{decl})
+A C statement (sans semicolon) to mark @var{decl} to be emitted as a
+public symbol such that extra copies in multiple translation units will
+be not discarded by the linker. This is used to revert the effects of
+the MAKE_DECL_ONE_ONLY macro.
+@end defmac
+
@defmac SUPPORTS_ONE_ONLY
A C expression which evaluates to true if the target supports one-only
semantics.
^ permalink raw reply [flat|nested] 6+ messages in thread