How about this?  Tested under mipsisa64-elf with no regressions.  The
other two I found by inspection; they're the only other two that have
.sdata and use -G 0.

2006-05-09  DJ Delorie  <[EMAIL PROTECTED]>

        * crtstuff.c: Ensure that __dso_handle is placed in .sdata for
        mips, iq2000, and m32r targets.

Index: crtstuff.c
===================================================================
--- crtstuff.c  (revision 113691)
+++ crtstuff.c  (working copy)
@@ -225,6 +225,9 @@
    in one DSO or the main program is not used in another object.  The
    dynamic linker takes care of this.  */
 
+#if defined(__mips__) || defined(__iq2000__) || defined(__m32r__)
+extern void *__dso_handle __attribute__ ((__section__ (".sdata")));
+#endif
 #ifdef HAVE_GAS_HIDDEN
 extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
 #endif

Reply via email to