A patch for csu/gmon-start.c
H . J . Lu
hjl@valinux.com
Wed Apr 19 12:03:00 GMT 2000
On Wed, Apr 19, 2000 at 02:55:47PM -0400, Roland McGrath wrote:
> I think your change is ok. It is usual to use `extern void _end;' and the
> like for this, so that &_end has type void *. Another good choice is
> `extern void _end[];' or the like; that has the benefit of `_end' rather
> than `&_end' doing the right thing as it does when using a function
> declaration. (Note that `extern void _end;' has the benefit of giving you
> an error if you use `_end' instead of `&_end', while your declaration using
> a real type can result in confusingly bogus code that fetches from *&_end.)
Thanks. I like it. Here is the new one.
H.J.
---
2000-04-19 H.J. Lu <hjl@gnu.org>
* csu/gmon-start.c (_start): Declared as "extern void".
(etext): Likewise.
--- /work/gnu/import/glibc-2.1/libc/csu/gmon-start.c Mon Jul 28 14:35:38 1997
+++ csu/gmon-start.c Wed Apr 19 11:57:28 2000
@@ -22,8 +22,11 @@
#include <stdlib.h>
#include <unistd.h>
-/* Beginning and end of our code segment. */
-extern void _start (void), etext (void);
+/* Beginning and end of our code segment. We cannot declare them
+ as the external functions since we want the addresses of those
+ labels. Taking the address of a function may have different
+ meanings on different platforms. */
+extern void _start, etext;
#ifndef HAVE_INITFINI
/* This function gets called at startup by the normal constructor
More information about the Libc-hacker
mailing list