This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
NO_CTORS_DTORS_SECTIONS for MIPS
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Date: Thu, 30 Dec 2010 21:39:01 +0000 (UTC)
- Subject: NO_CTORS_DTORS_SECTIONS for MIPS
I've applied this patch to update MIPS init-first.c files in line with a
recent libc change to define and use NO_CTORS_DTORS_SECTIONS. (This is
largely for logical completeness; it turns out neither affected file is
used on GNU/Linux. Other ports files that ought to be updated for this
are sysdeps/mach/hurd/alpha/init-first.c and
sysdeps/unix/sysv/aix/init-first.c.)
diff --git a/ChangeLog.mips b/ChangeLog.mips
index a52a7fd..0d933f3 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,9 @@
+2010-12-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/init-first.c: Don't call __libc_global_ctors if
+ NO_CTORS_DTORS_SECTIONS is defined.
+ * sysdeps/mach/hurd/mips/init-first.c: Likewise.
+
2010-12-21 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/stackinfo.h: Define DEFAULT_STACK_PERMS with PF_X.
diff --git a/sysdeps/mach/hurd/mips/init-first.c b/sysdeps/mach/hurd/mips/init-first.c
index 6f53e83..2b16cde 100644
--- a/sysdeps/mach/hurd/mips/init-first.c
+++ b/sysdeps/mach/hurd/mips/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For Mips/Hurd.
- Copyright (C) 1996,1997,1998,2000,01,02,03 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1998,2000,01,02,03,10 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -119,7 +119,7 @@ init1 (int argc, char *arg0, ...)
__getopt_clean_environment (envp);
#endif
-#ifdef SHARED
+#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS
__libc_global_ctors ();
#endif
diff --git a/sysdeps/mips/init-first.c b/sysdeps/mips/init-first.c
index b67a444..1390f99 100644
--- a/sysdeps/mips/init-first.c
+++ b/sysdeps/mips/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For mips/Unix.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,7 +50,9 @@ _init (int argc, ...)
{
init (&argc);
+#ifndef NO_CTORS_DTORS_SECTIONS
__libc_global_ctors ();
+#endif
}
#endif
--
Joseph S. Myers
joseph@codesourcery.com