From: Roland McGrath Date: Tue, 4 Apr 1995 21:53:15 +0000 (+0000) Subject: Tue Apr 4 00:48:53 1995 Roland McGrath X-Git-Tag: cvs/libc-950411~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45b28a8f0b36a48ab37ca973c2a93d8c43120488;p=thirdparty%2Fglibc.git Tue Apr 4 00:48:53 1995 Roland McGrath * misc/progname.c (program_invocation_name, program_invocation_short_name): Make these initialized data definitions. * sysdeps/mach/hurd/setitimer.c (fork_itimer): Add self reference so gcc doesn't optimize out the function entirely. --- diff --git a/ChangeLog b/ChangeLog index 88babc2b39a..3868aeb5e76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Apr 4 00:48:53 1995 Roland McGrath + + * misc/progname.c (program_invocation_name, + program_invocation_short_name): Make these initialized data + definitions. + + * sysdeps/mach/hurd/setitimer.c (fork_itimer): Add self reference + so gcc doesn't optimize out the function entirely. + Sun Apr 2 13:13:52 1995 Roland McGrath * posix/execvp.c: Don't use stat to search path; just try execv diff --git a/misc/progname.c b/misc/progname.c index 265ca5c3a92..d4efac976d5 100644 --- a/misc/progname.c +++ b/misc/progname.c @@ -21,8 +21,11 @@ Cambridge, MA 02139, USA. */ #include #include -char *program_invocation_name; -char *program_invocation_short_name; +/* These must be initialized data definitions. Common definitions satisfy + references to these variables, but do not cause the whole file to be + linked in, and so omit the set-up function. */ +char *program_invocation_name = NULL; +char *program_invocation_short_name = NULL; static void DEFUN(set_progname, (argc, argv, envp), diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c index 4351c5ea996..4f494a4c6ef 100644 --- a/sysdeps/mach/hurd/setitimer.c +++ b/sysdeps/mach/hurd/setitimer.c @@ -326,6 +326,8 @@ fork_itimer (void) it.it_value = it.it_interval; setitimer_locked (&it, NULL, NULL); + + (void) &fork_itimer; /* Avoid gcc optimizing out the function. */ } text_set_element (_hurd_fork_child_hook, fork_itimer);