This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed, libc/machine/cris/libcdtor.c (defaultors): Mark artificiallyas used


Sorry for not looking into the possible GCC bug at this time;
I'm not sure if the code is supposed to be valid actually.
It's playing tricks and alias support has changed a bit in GCC;
being more strict for some definition of strict.  GCC removing
defaultors breaks the build and that's what matters right now.
(The code below is unused on cris-elf FWIW.)

Committed; no regressions compared to last time the tree built.

	* libc/machine/cris/libcdtor.c (defaultors): Mark artificially as
	used.

Index: libcdtor.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/cris/libcdtor.c,v
retrieving revision 1.1
diff -p -u -r1.1 libcdtor.c
--- libcdtor.c	27 Jan 2005 23:54:44 -0000	1.1
+++ libcdtor.c	26 Jul 2005 20:20:38 -0000
@@ -45,10 +45,13 @@ __asm__
 extern vfnp * const _Ctors asm(".$global.lib.ctors");
 extern vfnp * const _Dtors asm(".$global.lib.dtors");

-/* We better provide weak empty ctor and dtor lists, since they are not
-   created if the main program does not have ctor/dtors.  */
+/* We better provide weak empty ctor and dtor lists, since they are
+   not created if the main program does not have ctor/dtors.  Because
+   it's otherwise not used, GCC trunk "Mon Jul 25 22:33:14 UTC 2005"
+   thinks it can remove defaultors, so we need to artificially mark it
+   as used.  FIXME: Perhaps a GCC bug.  */

-static vfnp const defaultors[] = {0, 0};
+static vfnp const defaultors[] __attribute__ ((__used__)) = {0, 0};

 extern vfnp * __CTOR_LIST__ __attribute__ ((weak, alias ("defaultors")));
 extern vfnp * __DTOR_LIST__ __attribute__ ((weak, alias ("defaultors")));

brgds, H-P


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