This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: multiple definitions of 'xxx keyed to...' in egcs-1.1.1


> 
> 
>   In message <m10EJQj-000392C@ocean.lucon.org>you write:
>   > > 
>   > > 
>   > >   In message <m10DUeS-00038sC@ocean.lucon.org>you write:
>   > >   > You got it backward. Making ctors/dtors local on ELF FIXES the bug on
>   > >   > ELF. However, your patch won't hurt.
>   > > Yours works by introducing an ELF specific hack.
>   > > 
>   > > Jason's patch, while not 100% correct either is a lot closer than yours s
>   > ince
>   > 
>   > Mine is 100% correct on ELF.
> And totally useless everywhere else.
> 

I won't go that far.

> 
>   > That is fine. But why cannot we have both? That way, ELF will be 100%
>   > correct and others will be almost correct? For me, this discussion
>   > makes few difference. I will make ELF 100% safe for Linux in anycase.
> Send me a patch and I'll consider it.  I will not accept a hack.
> 
> 
> 

Here it is.

-- 
H.J. Lu (hjl@gnu.org)
----
Fri Jan 29 19:02:50 1999  H.J. Lu  (hjl@gnu.org)

        * decl2.c (start_objects): Make file scope constructors and
        destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
        ASM_OUTPUT_DESTRUCTOR are defined.

--- ../../../../import/egcs/gcc/cp/decl2.c	Tue Nov 10 07:44:01 1998
+++ decl2.c	Sat Feb 20 11:32:58 1999
@@ -2943,6 +2943,11 @@ start_objects (method_type)
 					NULL_TREE),
 		  NULL_TREE, 0);
 
+#if defined(ASM_OUTPUT_CONSTRUCTOR) && defined(ASM_OUTPUT_DESTRUCTOR)
+  /* It can be a static function with .ctors/.dtors sections. */
+  TREE_PUBLIC (current_function_decl) = 0;
+#endif
+
   store_parm_decls ();
   pushlevel (0);
   clear_last_expr ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]