This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, roland/csu-init_array, created. glibc-2.14-101-gc7f407f
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Jul 2011 22:07:12 -0000
- Subject: GNU C Library master sources branch, roland/csu-init_array, created. glibc-2.14-101-gc7f407f
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, roland/csu-init_array has been created
at c7f407fe7835c68c0a8d68e3e11bfc5d2b35fb5e (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c7f407fe7835c68c0a8d68e3e11bfc5d2b35fb5e
commit c7f407fe7835c68c0a8d68e3e11bfc5d2b35fb5e
Author: Roland McGrath <roland@hack.frob.com>
Date: Sat Jul 9 18:48:56 2011 -0700
sysdeps/init_array: Use .preinit_array rather than .init_array for gmon.
diff --git a/ChangeLog b/ChangeLog
index 1a25b6a..94c7635 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2011-07-09 Roland McGrath <roland@hack.frob.com>
+ * csu/gmon-start.c: Use .preinit_array rather than .init_array.
+
* csu/gmon-start.c [GMON_START_ARRAY_SECTION]: Don't define
__gmon_start__ as global, but as static with an .init_array pointer.
* sysdeps/init_array/gmon-start.c: New file. Use that.
diff --git a/sysdeps/init_array/gmon-start.c b/sysdeps/init_array/gmon-start.c
index 591b90e..7fe14ea 100644
--- a/sysdeps/init_array/gmon-start.c
+++ b/sysdeps/init_array/gmon-start.c
@@ -1,4 +1,4 @@
-/* gmon startup hook using .init_array.
+/* gmon startup hook using .preinit_array.
Copyright (C) 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -35,8 +35,8 @@
02111-1307 USA. */
/* Instead of defining __gmon_start__ globally in gcrt1.o, we make it
- static and just put a pointer to it into the .init_array section. */
+ static and just put a pointer to it into the .preinit_array section. */
-#defined GMON_START_ARRAY_SECTION ".init_array"
+#defined GMON_START_ARRAY_SECTION ".preinit_array"
#include <csu/gmon-start.c>
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8eeb8a46727222770009141551461ef4c61b37ca
commit 8eeb8a46727222770009141551461ef4c61b37ca
Author: Roland McGrath <roland@hack.frob.com>
Date: Sat Jul 9 18:46:32 2011 -0700
Add sysdeps/init_array to produce empty crt[in].o and use .init_array for gcrt1.o
diff --git a/ChangeLog b/ChangeLog
index 953e879..1a25b6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-09 Roland McGrath <roland@hack.frob.com>
+
+ * csu/gmon-start.c [GMON_START_ARRAY_SECTION]: Don't define
+ __gmon_start__ as global, but as static with an .init_array pointer.
+ * sysdeps/init_array/gmon-start.c: New file. Use that.
+ * sysdeps/init_array/initfini.c: New file. Produce empty assembly.
+
2011-07-10 Roland McGrath <roland@hack.frob.com>
* csu/elf-init.c (__libc_csu_init): Comment typo.
diff --git a/csu/gmon-start.c b/csu/gmon-start.c
index 7d585e1..350d4f5 100644
--- a/csu/gmon-start.c
+++ b/csu/gmon-start.c
@@ -1,5 +1,6 @@
/* Code to enable profiling at program startup.
- Copyright (C) 1995,1996,1997,2000,2001,2002 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1997,2000,2001,2002,2011
+ 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
@@ -49,6 +50,11 @@ extern char etext[];
so this constructor will be first in the list. */
extern void __gmon_start__ (void) __attribute__ ((constructor));
+#elif defined (GMON_START_ARRAY_SECTION)
+static void __gmon_start__ (void);
+static void (*const gmon_start_initializer) (void)
+ __attribute__ ((used, section (GMON_START_ARRAY_SECTION))) = &__gmon_start__;
+static
#else
/* In ELF and COFF, we cannot use the normal constructor mechanism to call
__gmon_start__ because gcrt1.o appears before crtbegin.o in the link.
diff --git a/sysdeps/init_array/gmon-start.c b/sysdeps/init_array/gmon-start.c
new file mode 100644
index 0000000..591b90e
--- /dev/null
+++ b/sysdeps/init_array/gmon-start.c
@@ -0,0 +1,42 @@
+/* gmon startup hook using .init_array.
+ Copyright (C) 2011 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Instead of defining __gmon_start__ globally in gcrt1.o, we make it
+ static and just put a pointer to it into the .init_array section. */
+
+#defined GMON_START_ARRAY_SECTION ".init_array"
+
+#include <csu/gmon-start.c>
diff --git a/sysdeps/init_array/initfini.c b/sysdeps/init_array/initfini.c
new file mode 100644
index 0000000..36bf857
--- /dev/null
+++ b/sysdeps/init_array/initfini.c
@@ -0,0 +1,59 @@
+/* Stub for no .init/.fini section support.
+ Copyright (C) 2011 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file is compiled into assembly code which is then munged by a
+ sed script into two files: crti.s and crtn.s.
+
+ In this configuration, these are both empty because the
+ .init_array/.fini_array sections are used exclusively.
+
+ Older ports cannot use this because even if the linker used to
+ build libc itself has .init_array support, we don't want to produce
+ a crt[in].o that presume a linker that new will be used to link
+ other things later.
+
+ But new configurations without compatibility concerns for
+ toolchains without .init_array support can use this to avoid the
+ superfluous .init and .fini boilerplate code. */
+
+/* The initial common code ends here. */
+asm ("\n/*@HEADER_ENDS*/");
+
+asm ("\n/* Nothing here, we use .init_array and .fini_array instead. */");
+
+asm ("\n/*@TRAILER_BEGINS*/");
+
+/* End of file. */
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources