Author: asl
Date: Wed Aug 15 13:18:58 2007
New Revision: 41107

URL: http://llvm.org/viewvc/llvm-project?rev=41107&view=rev
Log:
Propagate patch from 4.2 branch:
Mark more stuff as used. This is needed, because LLVM optimizers now are pretty 
clever :)

Modified:
    llvm-gcc-4.0/trunk/gcc/crtstuff.c

Modified: llvm-gcc-4.0/trunk/gcc/crtstuff.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/crtstuff.c?rev=41107&r1=41106&r2=41107&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/crtstuff.c (original)
+++ llvm-gcc-4.0/trunk/gcc/crtstuff.c Wed Aug 15 13:18:58 2007
@@ -176,7 +176,6 @@
 STATIC func_ptr __CTOR_LIST__[1]
 /* APPLE LOCAL begin LLVM */
 #ifdef __llvm__
-/* FIXME: Remove when external weak linkage will be alive. */
   __attribute__ ((__used__, aligned(sizeof(func_ptr))))
 #else  
   __attribute__ ((__unused__, aligned(sizeof(func_ptr))))
@@ -187,7 +186,6 @@
 STATIC func_ptr __CTOR_LIST__[1]
 /* APPLE LOCAL begin LLVM */
 #ifdef __llvm__
-/* FIXME: Remove when external weak linkage will be alive. */
   __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr))))
 #else  
   __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr))))  
@@ -201,11 +199,23 @@
 #elif defined(DTORS_SECTION_ASM_OP)
 asm (DTORS_SECTION_ASM_OP);
 STATIC func_ptr __DTOR_LIST__[1]
+/* LLVM LOCAL begin */
+#ifdef __llvm__
+  __attribute__ ((used, aligned(sizeof(func_ptr))))
+#else
   __attribute__ ((aligned(sizeof(func_ptr))))
+#endif
+/* LLVM LOCAL end */  
   = { (func_ptr) (-1) };
 #else
 STATIC func_ptr __DTOR_LIST__[1]
+/* LLVM LOCAL begin */
+#ifdef __llvm__
+  __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr))))
+#else  
   __attribute__((section(".dtors"), aligned(sizeof(func_ptr))))
+#endif
+/* LLVM LOCAL end */    
   = { (func_ptr) (-1) };
 #endif /* __DTOR_LIST__ alternatives */
 
@@ -213,7 +223,13 @@
 /* Stick a label at the beginning of the frame unwind info so we can register
    and deregister it with the exception handling library code.  */
 STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
+/* LLVM LOCAL begin */
+#ifdef __llvm__
+     __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4)))
+#else  
      __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+#endif
+/* LLVM LOCAL end */      
      = { };
 #endif /* USE_EH_FRAME_REGISTRY */
 
@@ -447,11 +463,23 @@
 static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { };
 asm (CTORS_SECTION_ASM_OP);
 STATIC func_ptr __CTOR_END__[1]
+/* LLVM LOCAL begin */
+#ifdef __llvm__
+  __attribute__((used, aligned(sizeof(func_ptr))))
+#else
   __attribute__((aligned(sizeof(func_ptr))))
+#endif
+/* LLVM LOCAL end */  
   = { (func_ptr) 0 };
 #else
 STATIC func_ptr __CTOR_END__[1]
+/* LLVM LOCAL begin */
+#ifdef __llvm__
+  __attribute__((used, section(".ctors"), aligned(sizeof(func_ptr))))
+#else  
   __attribute__((section(".ctors"), aligned(sizeof(func_ptr))))
+#endif
+/* LLVM LOCAL end */  
   = { (func_ptr) 0 };
 #endif
 
@@ -462,8 +490,7 @@
 STATIC func_ptr __DTOR_END__[1]
 /* APPLE LOCAL begin LLVM */
 #ifdef __llvm__
-/* FIXME: Remove when external weak linkage will be alive. */
-__attribute__ ((__used__, aligned(sizeof(func_ptr))))
+  __attribute__ ((__used__, aligned(sizeof(func_ptr))))
 #else  
   __attribute__ ((unused, aligned(sizeof(func_ptr))))
 #endif    


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to