[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r8368 - in /fsf/trunk/libc: ./ debug/ elf/ gmon/ inet/ libio/ nptl/ nptl/sysdeps/unix/sysv/linux/ nscd/ nss/ stdio-common/ s...
- To: commits@xxxxxxxxxx
- Subject: [commits] r8368 - in /fsf/trunk/libc: ./ debug/ elf/ gmon/ inet/ libio/ nptl/ nptl/sysdeps/unix/sysv/linux/ nscd/ nss/ stdio-common/ s...
- From: eglibc@xxxxxxxxxx
- Date: Mon, 27 Apr 2009 07:05:45 -0000
Author: eglibc
Date: Mon Apr 27 00:05:44 2009
New Revision: 8368
Log:
Import glibc-mainline for 2009-04-27
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/debug/vasprintf_chk.c
fsf/trunk/libc/debug/vsnprintf_chk.c
fsf/trunk/libc/debug/vsprintf_chk.c
fsf/trunk/libc/elf/dl-load.c
fsf/trunk/libc/elf/dl-profile.c
fsf/trunk/libc/elf/dl-runtime.c
fsf/trunk/libc/elf/sprof.c
fsf/trunk/libc/gmon/gmon.c
fsf/trunk/libc/inet/inet6_option.c
fsf/trunk/libc/inet/rcmd.c
fsf/trunk/libc/inet/rexec.c
fsf/trunk/libc/libio/iovsprintf.c
fsf/trunk/libc/libio/iovsscanf.c
fsf/trunk/libc/libio/strfile.h
fsf/trunk/libc/libio/vasprintf.c
fsf/trunk/libc/libio/vsnprintf.c
fsf/trunk/libc/nptl/ChangeLog
fsf/trunk/libc/nptl/sem_open.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
fsf/trunk/libc/nscd/connections.c
fsf/trunk/libc/nscd/nscd_helper.c
fsf/trunk/libc/nss/nsswitch.c
fsf/trunk/libc/stdio-common/isoc99_vsscanf.c
fsf/trunk/libc/stdlib/strfmon_l.c
fsf/trunk/libc/sunrpc/clnt_raw.c
fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c
fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/s_expm1f.c
fsf/trunk/libc/sysdeps/ieee754/k_standard.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/readv.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/writev.c
fsf/trunk/libc/sysdeps/x86_64/dl-machine.h
fsf/trunk/libc/sysdeps/x86_64/fpu/s_expm1l.S
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Apr 27 00:05:44 2009
@@ -1,3 +1,74 @@
+2009-04-26 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * sysdeps/ieee754/dbl-64/s_expm1.c: Set errno for overflow.
+ * sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
+ * sysdeps/x86_64/fpu/s_expm1l.S: Likewise.
+
+ * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors in
+ atanh should set ERANGE.
+
+ [BZ #10087]
+ * elf/dl-runtime.c (_dl_fixup): Use DL_FIXUP_VALUE_ADDR to access
+ result of lookup to make call to implement STT_GNU_IFUNC.
+ (_dl_profile_fixup): Likewise.
+ Patch by H.J. Lu <hjl.tools@xxxxxxxxx>.
+
+ * nscd/connections.c (send_ro_fd): Define temporary variable to avoid
+ warning.
+
+ * sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Remove inline
+ from definition.
+
+ * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Don't define
+ label if it is not used.
+
+ * elf/dl-profile.c (_dl_start_profile): Define real-type variant
+ of gmon_hist_hdr and gmon_hdr structures and use them.
+ * elf/sprof.c: Likewise.
+
+ * elf/dl-load.c (open_verify): Add temporary variable to avoid
+ warning.
+
+ * nscd/nscd_helper.c (get_mapping): Avoid casts to avoid warnings.
+
+ * sunrpc/clnt_raw.c (clntraw_private_s): Use union in definition
+ to avoid cast.
+
+ * inet/rexec.c (rexec_af): Make sa2 a union to avoid warnings.
+ * inet/rcmd.c (rcmd_af): Make from a union of the various needed types
+ to avoid warnings.
+ (iruserok_af): Use ss_family instead of casts.
+
+ * gmon/gmon.c (write_hist): Define real-type variant of
+ gmon_hist_hdr structure and use it.
+ (write_gmon): Likewise for gmon_hdr.
+
+ * sysdeps/unix/sysv/linux/readv.c: Avoid declaration of replacement
+ function if we are not going to define it.
+ * sysdeps/unix/sysv/linux/writev.c: Likewise.
+
+ * inet/inet6_option.c (option_alloc): Add temporary variable to
+ avoid warning.
+
+ * libio/strfile.h (struct _IO_streambuf): Use correct type and
+ name of VTable element.
+ * libio/iovsprintf.c: Avoid casts to avoid warnings.
+ * libio/iovsscanf.c: Likewise.
+ * libio/vasprintf.c: Likewise.
+ * libio/vsnprintf.c: Likewise.
+ * stdio-common/isoc99_vsscanf.c: Likewise.
+ * stdlib/strfmon_l.c: Likewise.
+ * debug/vasprintf_chk.c: Likewise.
+ * debug/vsnprintf_chk.c: Likewise.
+ * debug/vsprintf_chk.c: Likewise.
+
+ * nss/nsswitch.c (__nss_lookup_function): En/Decrypt cached
+ function pointers.
+
+2009-04-26 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * sysdeps/ieee754/dbl-64/s_tan.c (tan): Fix -Wsequence-point warnings.
+
2009-04-25 Ulrich Drepper <drepper@xxxxxxxxxx>
* posix/bits/posix1_lim.h: Cleanup namespace a bit.
Modified: fsf/trunk/libc/debug/vasprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vasprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vasprintf_chk.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008
+/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -53,8 +53,8 @@
#ifdef _IO_MTSAFE_IO
sf._sbf._f._lock = NULL;
#endif
- _IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+ _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, init_string_size, string);
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
Modified: fsf/trunk/libc/debug/vsnprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vsnprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vsnprintf_chk.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006
+/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -53,7 +53,7 @@
}
_IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
+ _IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
s[0] = '\0';
/* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
@@ -62,7 +62,7 @@
sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
_IO_str_init_static_internal (&sf.f, s, maxlen - 1, s);
- ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
+ ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
Modified: fsf/trunk/libc/debug/vsprintf_chk.c
==============================================================================
--- fsf/trunk/libc/debug/vsprintf_chk.c (original)
+++ fsf/trunk/libc/debug/vsprintf_chk.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006
+/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -75,7 +75,7 @@
__chk_fail ();
_IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &f._sbf) = &_IO_str_chk_jumps;
+ _IO_JUMPS (&f._sbf) = &_IO_str_chk_jumps;
s[0] = '\0';
_IO_str_init_static_internal (&f, s, slen - 1, s);
@@ -84,7 +84,7 @@
if (flags > 0)
f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
- ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &f._sbf, format, args);
+ ret = INTUSE(_IO_vfprintf) (&f._sbf._f, format, args);
*f._sbf._f._IO_write_ptr = '\0';
return ret;
Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Mon Apr 27 00:05:44 2009
@@ -1655,7 +1655,8 @@
EI_PAD), 0))
{
/* Something is wrong. */
- if (*(Elf32_Word *) &ehdr->e_ident !=
+ const Elf32_Word *magp = (const void *) ehdr->e_ident;
+ if (*magp !=
#if BYTE_ORDER == LITTLE_ENDIAN
((ELFMAG0 << (EI_MAG0 * 8)) |
(ELFMAG1 << (EI_MAG1 * 8)) |
Modified: fsf/trunk/libc/elf/dl-profile.c
==============================================================================
--- fsf/trunk/libc/elf/dl-profile.c (original)
+++ fsf/trunk/libc/elf/dl-profile.c Mon Apr 27 00:05:44 2009
@@ -1,5 +1,5 @@
/* Profiling of shared libraries.
- Copyright (C) 1997-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2004, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
Based on the BSD mcount implementation.
@@ -178,8 +178,6 @@
const ElfW(Phdr) *ph;
ElfW(Addr) mapstart = ~((ElfW(Addr)) 0);
ElfW(Addr) mapend = 0;
- struct gmon_hdr gmon_hdr;
- struct gmon_hist_hdr hist_hdr;
char *hist, *cp;
size_t idx;
size_t tossize;
@@ -251,15 +249,52 @@
+ 4 + 4 + fromssize * sizeof (struct here_cg_arc_record));
/* Create the gmon_hdr we expect or write. */
- memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
+ struct real_gmon_hdr
+ {
+ char cookie[4];
+ int32_t version;
+ char spare[3 * 4];
+ } gmon_hdr;
+ if (sizeof (gmon_hdr) != sizeof (struct gmon_hdr)
+ || (offsetof (struct real_gmon_hdr, cookie)
+ != offsetof (struct gmon_hdr, cookie))
+ || (offsetof (struct real_gmon_hdr, version)
+ != offsetof (struct gmon_hdr, version)))
+ abort ();
+
memcpy (&gmon_hdr.cookie[0], GMON_MAGIC, sizeof (gmon_hdr.cookie));
- *(int32_t *) gmon_hdr.version = GMON_SHOBJ_VERSION;
+ gmon_hdr.version = GMON_SHOBJ_VERSION;
+ memset (gmon_hdr.spare, '\0', sizeof (gmon_hdr.spare));
/* Create the hist_hdr we expect or write. */
- *(char **) hist_hdr.low_pc = (char *) mapstart;
- *(char **) hist_hdr.high_pc = (char *) mapend;
- *(int32_t *) hist_hdr.hist_size = kcountsize / sizeof (HISTCOUNTER);
- *(int32_t *) hist_hdr.prof_rate = __profile_frequency ();
+ struct real_gmon_hist_hdr
+ {
+ char *low_pc;
+ char *high_pc;
+ int32_t hist_size;
+ int32_t prof_rate;
+ char dimen[15];
+ char dimen_abbrev;
+ } hist_hdr;
+ if (sizeof (hist_hdr) != sizeof (struct gmon_hist_hdr)
+ || (offsetof (struct real_gmon_hist_hdr, low_pc)
+ != offsetof (struct gmon_hist_hdr, low_pc))
+ || (offsetof (struct real_gmon_hist_hdr, high_pc)
+ != offsetof (struct gmon_hist_hdr, high_pc))
+ || (offsetof (struct real_gmon_hist_hdr, hist_size)
+ != offsetof (struct gmon_hist_hdr, hist_size))
+ || (offsetof (struct real_gmon_hist_hdr, prof_rate)
+ != offsetof (struct gmon_hist_hdr, prof_rate))
+ || (offsetof (struct real_gmon_hist_hdr, dimen)
+ != offsetof (struct gmon_hist_hdr, dimen))
+ || (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
+ != offsetof (struct gmon_hist_hdr, dimen_abbrev)))
+ abort ();
+
+ hist_hdr.low_pc = (char *) mapstart;
+ hist_hdr.high_pc = (char *) mapend;
+ hist_hdr.hist_size = kcountsize / sizeof (HISTCOUNTER);
+ hist_hdr.prof_rate = __profile_frequency ();
if (sizeof (hist_hdr.dimen) >= sizeof ("seconds"))
{
memcpy (hist_hdr.dimen, "seconds", sizeof ("seconds"));
Modified: fsf/trunk/libc/elf/dl-runtime.c
==============================================================================
--- fsf/trunk/libc/elf/dl-runtime.c (original)
+++ fsf/trunk/libc/elf/dl-runtime.c Mon Apr 27 00:05:44 2009
@@ -137,7 +137,7 @@
value = elf_machine_plt_value (l, reloc, value);
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
/* Finally, fix up the plt itself. */
if (__builtin_expect (GLRO(dl_bind_not), 0))
@@ -225,7 +225,8 @@
if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
== STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void))
+ DL_FIXUP_VALUE_ADDR (value)) ();
}
else
{
@@ -235,7 +236,8 @@
if (__builtin_expect (ELFW(ST_TYPE) (refsym->st_info)
== STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void))
+ DL_FIXUP_VALUE_ADDR (value)) ();
result = l;
}
Modified: fsf/trunk/libc/elf/sprof.c
==============================================================================
--- fsf/trunk/libc/elf/sprof.c (original)
+++ fsf/trunk/libc/elf/sprof.c Mon Apr 27 00:05:44 2009
@@ -195,13 +195,24 @@
};
+struct real_gmon_hist_hdr
+{
+ char *low_pc;
+ char *high_pc;
+ int32_t hist_size;
+ int32_t prof_rate;
+ char dimen[15];
+ char dimen_abbrev;
+};
+
+
struct profdata
{
void *addr;
off_t size;
char *hist;
- struct gmon_hist_hdr *hist_hdr;
+ struct real_gmon_hist_hdr *hist_hdr;
uint16_t *kcount;
uint32_t narcs; /* Number of arcs in toset. */
struct here_cg_arc_record *data;
@@ -740,8 +751,6 @@
int fd;
struct stat st;
void *addr;
- struct gmon_hdr gmon_hdr;
- struct gmon_hist_hdr hist_hdr;
uint32_t *narcsp;
size_t fromlimit;
struct here_cg_arc_record *data;
@@ -828,10 +837,10 @@
/* Pointer to data after the header. */
result->hist = (char *) ((struct gmon_hdr *) addr + 1);
- result->hist_hdr = (struct gmon_hist_hdr *) ((char *) result->hist
- + sizeof (uint32_t));
+ result->hist_hdr = (struct real_gmon_hist_hdr *) ((char *) result->hist
+ + sizeof (uint32_t));
result->kcount = (uint16_t *) ((char *) result->hist + sizeof (uint32_t)
- + sizeof (struct gmon_hist_hdr));
+ + sizeof (struct real_gmon_hist_hdr));
/* Compute pointer to array of the arc information. */
narcsp = (uint32_t *) ((char *) result->kcount + shobj->kcountsize
@@ -841,18 +850,46 @@
+ sizeof (uint32_t));
/* Create the gmon_hdr we expect or write. */
- memset (&gmon_hdr, '\0', sizeof (struct gmon_hdr));
+ struct real_gmon_hdr
+ {
+ char cookie[4];
+ int32_t version;
+ char spare[3 * 4];
+ } gmon_hdr;
+ if (sizeof (gmon_hdr) != sizeof (struct gmon_hdr)
+ || (offsetof (struct real_gmon_hdr, cookie)
+ != offsetof (struct gmon_hdr, cookie))
+ || (offsetof (struct real_gmon_hdr, version)
+ != offsetof (struct gmon_hdr, version)))
+ abort ();
+
memcpy (&gmon_hdr.cookie[0], GMON_MAGIC, sizeof (gmon_hdr.cookie));
- *(int32_t *) gmon_hdr.version = GMON_SHOBJ_VERSION;
+ gmon_hdr.version = GMON_SHOBJ_VERSION;
+ memset (gmon_hdr.spare, '\0', sizeof (gmon_hdr.spare));
/* Create the hist_hdr we expect or write. */
- *(char **) hist_hdr.low_pc = (char *) shobj->lowpc - shobj->map->l_addr;
- *(char **) hist_hdr.high_pc = (char *) shobj->highpc - shobj->map->l_addr;
+ struct real_gmon_hist_hdr hist_hdr;
+ if (sizeof (hist_hdr) != sizeof (struct gmon_hist_hdr)
+ || (offsetof (struct real_gmon_hist_hdr, low_pc)
+ != offsetof (struct gmon_hist_hdr, low_pc))
+ || (offsetof (struct real_gmon_hist_hdr, high_pc)
+ != offsetof (struct gmon_hist_hdr, high_pc))
+ || (offsetof (struct real_gmon_hist_hdr, hist_size)
+ != offsetof (struct gmon_hist_hdr, hist_size))
+ || (offsetof (struct real_gmon_hist_hdr, prof_rate)
+ != offsetof (struct gmon_hist_hdr, prof_rate))
+ || (offsetof (struct real_gmon_hist_hdr, dimen)
+ != offsetof (struct gmon_hist_hdr, dimen))
+ || (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
+ != offsetof (struct gmon_hist_hdr, dimen_abbrev)))
+ abort ();
+
+ hist_hdr.low_pc = (char *) shobj->lowpc - shobj->map->l_addr;
+ hist_hdr.high_pc = (char *) shobj->highpc - shobj->map->l_addr;
if (do_test)
- printf ("low_pc = %p\nhigh_pc = %p\n",
- *(char **) hist_hdr.low_pc, *(char **) hist_hdr.high_pc);
- *(int32_t *) hist_hdr.hist_size = shobj->kcountsize / sizeof (HISTCOUNTER);
- *(int32_t *) hist_hdr.prof_rate = __profile_frequency ();
+ printf ("low_pc = %p\nhigh_pc = %p\n", hist_hdr.low_pc, hist_hdr.high_pc);
+ hist_hdr.hist_size = shobj->kcountsize / sizeof (HISTCOUNTER);
+ hist_hdr.prof_rate = __profile_frequency ();
strncpy (hist_hdr.dimen, "seconds", sizeof (hist_hdr.dimen));
hist_hdr.dimen_abbrev = 's';
@@ -1280,7 +1317,7 @@
size_t n;
void *data = NULL;
- tick_unit = 1.0 / *(uint32_t *) profdata->hist_hdr->prof_rate;
+ tick_unit = 1.0 / profdata->hist_hdr->prof_rate;
printf ("Flat profile:\n\n"
"Each sample counts as %g %s.\n",
Modified: fsf/trunk/libc/gmon/gmon.c
==============================================================================
--- fsf/trunk/libc/gmon/gmon.c (original)
+++ fsf/trunk/libc/gmon/gmon.c Mon Apr 27 00:05:44 2009
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stddef.h>
#include <unistd.h>
#include <libc-internal.h>
#include <not-cancel.h>
@@ -180,10 +181,18 @@
int fd;
{
u_char tag = GMON_TAG_TIME_HIST;
- struct gmon_hist_hdr thdr __attribute__ ((aligned (__alignof__ (char *))));
if (_gmonparam.kcountsize > 0)
{
+ struct real_gmon_hist_hdr
+ {
+ char *low_pc;
+ char *high_pc;
+ int32_t hist_size;
+ int32_t prof_rate;
+ char dimen[15];
+ char dimen_abbrev;
+ } thdr;
struct iovec iov[3] =
{
{ &tag, sizeof (tag) },
@@ -191,11 +200,25 @@
{ _gmonparam.kcount, _gmonparam.kcountsize }
};
- *(char **) thdr.low_pc = (char *) _gmonparam.lowpc;
- *(char **) thdr.high_pc = (char *) _gmonparam.highpc;
- *(int32_t *) thdr.hist_size = (_gmonparam.kcountsize
- / sizeof (HISTCOUNTER));
- *(int32_t *) thdr.prof_rate = __profile_frequency ();
+ if (sizeof (thdr) != sizeof (struct gmon_hist_hdr)
+ || (offsetof (struct real_gmon_hist_hdr, low_pc)
+ != offsetof (struct gmon_hist_hdr, low_pc))
+ || (offsetof (struct real_gmon_hist_hdr, high_pc)
+ != offsetof (struct gmon_hist_hdr, high_pc))
+ || (offsetof (struct real_gmon_hist_hdr, hist_size)
+ != offsetof (struct gmon_hist_hdr, hist_size))
+ || (offsetof (struct real_gmon_hist_hdr, prof_rate)
+ != offsetof (struct gmon_hist_hdr, prof_rate))
+ || (offsetof (struct real_gmon_hist_hdr, dimen)
+ != offsetof (struct gmon_hist_hdr, dimen))
+ || (offsetof (struct real_gmon_hist_hdr, dimen_abbrev)
+ != offsetof (struct gmon_hist_hdr, dimen_abbrev)))
+ abort ();
+
+ thdr.low_pc = (char *) _gmonparam.lowpc;
+ thdr.high_pc = (char *) _gmonparam.highpc;
+ thdr.hist_size = _gmonparam.kcountsize / sizeof (HISTCOUNTER);
+ thdr.prof_rate = __profile_frequency ();
strncpy (thdr.dimen, "seconds", sizeof (thdr.dimen));
thdr.dimen_abbrev = 's';
@@ -318,7 +341,6 @@
static void
write_gmon (void)
{
- struct gmon_hdr ghdr __attribute__ ((aligned (__alignof__ (int))));
int fd = -1;
char *env;
@@ -350,9 +372,21 @@
}
/* write gmon.out header: */
- memset (&ghdr, '\0', sizeof (struct gmon_hdr));
+ struct real_gmon_hdr
+ {
+ char cookie[4];
+ int32_t version;
+ char spare[3 * 4];
+ } ghdr;
+ if (sizeof (ghdr) != sizeof (struct gmon_hdr)
+ || (offsetof (struct real_gmon_hdr, cookie)
+ != offsetof (struct gmon_hdr, cookie))
+ || (offsetof (struct real_gmon_hdr, version)
+ != offsetof (struct gmon_hdr, version)))
+ abort ();
memcpy (&ghdr.cookie[0], GMON_MAGIC, sizeof (ghdr.cookie));
- *(int32_t *) ghdr.version = GMON_VERSION;
+ ghdr.version = GMON_VERSION;
+ memset (ghdr.spare, '\0', sizeof (ghdr.spare));
write_not_cancel (fd, &ghdr, sizeof (struct gmon_hdr));
/* write PC histogram: */
Modified: fsf/trunk/libc/inet/inet6_option.c
==============================================================================
--- fsf/trunk/libc/inet/inet6_option.c (original)
+++ fsf/trunk/libc/inet/inet6_option.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2003.
@@ -216,7 +216,8 @@
/* Too long. */
return NULL;
- ((struct ip6_ext *) CMSG_DATA (cmsg))->ip6e_len = len8b;
+ struct ip6_ext *ie = (void *) CMSG_DATA (cmsg);
+ ie->ip6e_len = len8b;
return result;
}
Modified: fsf/trunk/libc/inet/rcmd.c
==============================================================================
--- fsf/trunk/libc/inet/rcmd.c (original)
+++ fsf/trunk/libc/inet/rcmd.c Mon Apr 27 00:05:44 2009
@@ -112,7 +112,13 @@
{
char paddr[INET6_ADDRSTRLEN];
struct addrinfo hints, *res, *ai;
- struct sockaddr_storage from;
+ union
+ {
+ struct sockaddr sa;
+ struct sockaddr_storage ss;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ } from;
struct pollfd pfd[2];
int32_t oldmask;
pid_t pid;
@@ -274,14 +280,13 @@
(void)__close(s2);
goto bad;
}
- s3 = TEMP_FAILURE_RETRY (accept(s2, (struct sockaddr *)&from,
- &len));
- switch (from.ss_family) {
+ s3 = TEMP_FAILURE_RETRY (accept(s2, &from.sa, &len));
+ switch (from.sa.sa_family) {
case AF_INET:
- rport = ntohs(((struct sockaddr_in *)&from)->sin_port);
+ rport = ntohs(from.sin.sin_port);
break;
case AF_INET6:
- rport = ntohs(((struct sockaddr_in6 *)&from)->sin6_port);
+ rport = ntohs(from.sin6.sin6_port);
break;
default:
rport = 0;
@@ -605,13 +610,13 @@
memset (&ra, '\0', sizeof(ra));
switch (af){
case AF_INET:
- ((struct sockaddr_in *)&ra)->sin_family = AF_INET;
+ ra.ss_family = AF_INET;
memcpy (&(((struct sockaddr_in *)&ra)->sin_addr), raddr,
sizeof(struct in_addr));
ralen = sizeof(struct sockaddr_in);
break;
case AF_INET6:
- ((struct sockaddr_in6 *)&ra)->sin6_family = AF_INET6;
+ ra.ss_family = AF_INET6;
memcpy (&(((struct sockaddr_in6 *)&ra)->sin6_addr), raddr,
sizeof(struct in6_addr));
ralen = sizeof(struct sockaddr_in6);
Modified: fsf/trunk/libc/inet/rexec.c
==============================================================================
--- fsf/trunk/libc/inet/rexec.c (original)
+++ fsf/trunk/libc/inet/rexec.c Mon Apr 27 00:05:44 2009
@@ -56,7 +56,7 @@
int *fd2p;
sa_family_t af;
{
- struct sockaddr_storage sa2, from;
+ struct sockaddr_storage from;
struct addrinfo hints, *res0;
const char *orig_name = name;
const char *orig_pass = pass;
@@ -115,6 +115,11 @@
} else {
char num[32];
int s2;
+ union
+ {
+ struct sockaddr_storage ss;
+ struct sockaddr sa;
+ } sa2;
socklen_t sa2len;
s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
@@ -124,17 +129,17 @@
}
__listen(s2, 1);
sa2len = sizeof (sa2);
- if (__getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
+ if (__getsockname(s2, &sa2.sa, &sa2len) < 0) {
perror("getsockname");
(void) __close(s2);
goto bad;
- } else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
+ } else if (sa2len != SA_LEN(&sa2.sa)) {
__set_errno(EINVAL);
(void) __close(s2);
goto bad;
}
port = 0;
- if (!getnameinfo((struct sockaddr *)&sa2, sa2len,
+ if (!getnameinfo(&sa2.sa, sa2len,
NULL, 0, servbuff, sizeof(servbuff),
NI_NUMERICSERV))
port = atoi(servbuff);
Modified: fsf/trunk/libc/libio/iovsprintf.c
==============================================================================
--- fsf/trunk/libc/libio/iovsprintf.c (original)
+++ fsf/trunk/libc/libio/iovsprintf.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2006, 2009 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
@@ -38,10 +38,10 @@
sf._sbf._f._lock = NULL;
#endif
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+ _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, -1, string);
- ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf._sbf, format, args);
- _IO_putc_unlocked ('\0', (_IO_FILE *) &sf._sbf);
+ ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
+ _IO_putc_unlocked ('\0', &sf._sbf._f);
return ret;
}
INTDEF2(__IO_vsprintf, _IO_vsprintf)
Modified: fsf/trunk/libc/libio/iovsscanf.c
==============================================================================
--- fsf/trunk/libc/libio/iovsscanf.c (original)
+++ fsf/trunk/libc/libio/iovsscanf.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2006, 2009 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
@@ -40,9 +40,9 @@
sf._sbf._f._lock = NULL;
#endif
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+ _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
- ret = INTUSE(_IO_vfscanf) ((_IO_FILE *) &sf._sbf, format, args, NULL);
+ ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL);
return ret;
}
ldbl_weak_alias (_IO_vsscanf, __vsscanf)
Modified: fsf/trunk/libc/libio/strfile.h
==============================================================================
--- fsf/trunk/libc/libio/strfile.h (original)
+++ fsf/trunk/libc/libio/strfile.h Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997,1998,1999,2005,2009 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
@@ -47,7 +47,7 @@
struct _IO_streambuf
{
struct _IO_FILE _f;
- const void *_vtable;
+ const struct _IO_jump_t *vtable;
};
typedef struct _IO_strfile_
Modified: fsf/trunk/libc/libio/vasprintf.c
==============================================================================
--- fsf/trunk/libc/libio/vasprintf.c (original)
+++ fsf/trunk/libc/libio/vasprintf.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1997,1999-2002,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1997,1999-2002,2004,2006,2009
+ 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
@@ -54,8 +55,8 @@
#ifdef _IO_MTSAFE_IO
sf._sbf._f._lock = NULL;
#endif
- _IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+ _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, init_string_size, string);
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
Modified: fsf/trunk/libc/libio/vsnprintf.c
==============================================================================
--- fsf/trunk/libc/libio/vsnprintf.c (original)
+++ fsf/trunk/libc/libio/vsnprintf.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1997,1999-2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1997,1999-2004,2006,2009 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
@@ -114,10 +114,10 @@
}
_IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
+ _IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
string[0] = '\0';
_IO_str_init_static_internal (&sf.f, string, maxlen - 1, string);
- ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &sf.f._sbf, format, args);
+ ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Mon Apr 27 00:05:44 2009
@@ -1,3 +1,11 @@
+2009-04-26 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * sem_open.c (sem_open): Rewrite initialization of initsem to
+ avoid warnings.
+
+ * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
+ Avoid warning by using may_alias attribute on ptrhack.
+
2009-04-22 Ulrich Drepper <drepper@xxxxxxxxxx>
[BZ #10090]
Modified: fsf/trunk/libc/nptl/sem_open.c
==============================================================================
--- fsf/trunk/libc/nptl/sem_open.c (original)
+++ fsf/trunk/libc/nptl/sem_open.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -302,15 +302,18 @@
}
/* Create the initial file content. */
- sem_t initsem;
-
- struct new_sem *iinitsem = (struct new_sem *) &initsem;
- iinitsem->value = value;
- iinitsem->private = 0;
- iinitsem->nwaiters = 0;
+ union
+ {
+ sem_t initsem;
+ struct new_sem newsem;
+ } sem;
+
+ sem.newsem.value = value;
+ sem.newsem.private = 0;
+ sem.newsem.nwaiters = 0;
/* Initialize the remaining bytes as well. */
- memset ((char *) &initsem + sizeof (struct new_sem), '\0',
+ memset ((char *) &sem.initsem + sizeof (struct new_sem), '\0',
sizeof (sem_t) - sizeof (struct new_sem));
tmpfname = (char *) alloca (mountpoint.dirlen + 6 + 1);
@@ -349,7 +352,7 @@
break;
}
- if (TEMP_FAILURE_RETRY (__libc_write (fd, &initsem, sizeof (sem_t)))
+ if (TEMP_FAILURE_RETRY (__libc_write (fd, &sem.initsem, sizeof (sem_t)))
== sizeof (sem_t)
/* Map the sem_t structure from the file. */
&& (result = (sem_t *) mmap (NULL, sizeof (sem_t),
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -56,10 +56,10 @@
union ptrhack
{
struct pthread_functions pf;
- void *parr[1];
- } const *src;
+# define NPTRS (sizeof (struct pthread_functions) / sizeof (void *))
+ void *parr[NPTRS];
+ } __attribute__ ((may_alias)) const *src;
union ptrhack *dest;
-# define NPTRS (sizeof (struct pthread_functions) / sizeof (void *))
src = (const void *) functions;
dest = (void *) &__libc_pthread_functions;
Modified: fsf/trunk/libc/nscd/connections.c
==============================================================================
--- fsf/trunk/libc/nscd/connections.c (original)
+++ fsf/trunk/libc/nscd/connections.c Mon Apr 27 00:05:44 2009
@@ -1023,7 +1023,8 @@
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN (sizeof (int));
- *(int *) CMSG_DATA (cmsg) = db->ro_fd;
+ int *ip = (int *) CMSG_DATA (cmsg);
+ *ip = db->ro_fd;
msg.msg_controllen = cmsg->cmsg_len;
@@ -1719,6 +1720,7 @@
/* One more thread available. */
++nready;
}
+ /* NOTREACHED */
}
Modified: fsf/trunk/libc/nscd/nscd_helper.c
==============================================================================
--- fsf/trunk/libc/nscd/nscd_helper.c (original)
+++ fsf/trunk/libc/nscd/nscd_helper.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -318,7 +318,7 @@
/* This access is well-aligned since BUF is correctly aligned for an
int and CMSG_DATA preserves this alignment. */
- *(int *) CMSG_DATA (cmsg) = -1;
+ memset (CMSG_DATA (cmsg), '\xff', sizeof (int));
msg.msg_controllen = cmsg->cmsg_len;
@@ -335,7 +335,8 @@
!= CMSG_LEN (sizeof (int))), 0))
goto out_close2;
- mapfd = *(int *) CMSG_DATA (cmsg);
+ int *ip = (void *) CMSG_DATA (cmsg);
+ mapfd = *ip;
if (__builtin_expect (n != keylen && n != keylen + sizeof (mapsize), 0))
goto out_close;
Modified: fsf/trunk/libc/nss/nsswitch.c
==============================================================================
--- fsf/trunk/libc/nss/nsswitch.c (original)
+++ fsf/trunk/libc/nss/nsswitch.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999, 2001-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
@@ -300,8 +300,11 @@
found = __tsearch (&fct_name, &ni->known, &known_compare);
if (*found != &fct_name)
- /* The search found an existing structure in the tree. */
- result = ((known_function *) *found)->fct_ptr;
+ {
+ /* The search found an existing structure in the tree. */
+ result = ((known_function *) *found)->fct_ptr;
+ PTR_DEMANGLE (result);
+ }
else
{
/* This name was not known before. Now we have a node in the tree
@@ -424,6 +427,7 @@
/* Remember function pointer for later calls. Even if null, we
record it so a second try needn't search the library again. */
known->fct_ptr = result;
+ PTR_MANGLE (known->fct_ptr);
}
}
Modified: fsf/trunk/libc/stdio-common/isoc99_vsscanf.c
==============================================================================
--- fsf/trunk/libc/stdio-common/isoc99_vsscanf.c (original)
+++ fsf/trunk/libc/stdio-common/isoc99_vsscanf.c Mon Apr 27 00:05:44 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997-2003,2006,2007,2009 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
@@ -38,10 +38,10 @@
sf._sbf._f._lock = NULL;
#endif
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
- _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+ _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD;
- ret = INTUSE(_IO_vfscanf) ((_IO_FILE *) &sf._sbf, format, args, NULL);
+ ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL);
return ret;
}
libc_hidden_def (__isoc99_vsscanf)
Modified: fsf/trunk/libc/stdlib/strfmon_l.c
==============================================================================
--- fsf/trunk/libc/stdlib/strfmon_l.c (original)
+++ fsf/trunk/libc/stdlib/strfmon_l.c Mon Apr 27 00:05:44 2009
@@ -90,9 +90,6 @@
{
struct locale_data *current = loc->__locales[LC_MONETARY];
_IO_strfile f;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
struct printf_info info;
char *dest; /* Pointer so copy the output. */
const char *fmt; /* Pointer that walks through format. */
@@ -517,11 +514,11 @@
/* Print the number. */
#ifdef _IO_MTSAFE_IO
- f._sbf._f._lock = &lock;
+ f._sbf._f._lock = NULL;
#endif
- INTUSE(_IO_init) ((_IO_FILE *) &f, 0);
- _IO_JUMPS ((struct _IO_FILE_plus *) &f) = &_IO_str_jumps;
- INTUSE(_IO_str_init_static) ((_IO_strfile *) &f, dest,
+ INTUSE(_IO_init) (&f._sbf._f, 0);
+ _IO_JUMPS (&f._sbf) = &_IO_str_jumps;
+ INTUSE(_IO_str_init_static) (&f, dest,
(s + maxsize) - dest, dest);
/* We clear the last available byte so we can find out whether
the numeric representation is too long. */
@@ -537,7 +534,7 @@
info.extra = 1; /* This means use values from LC_MONETARY. */
ptr = &fpnum;
- done = __printf_fp ((FILE *) &f, &info, &ptr);
+ done = __printf_fp (&f._sbf._f, &info, &ptr);
if (done < 0)
return -1;
Modified: fsf/trunk/libc/sunrpc/clnt_raw.c
==============================================================================
--- fsf/trunk/libc/sunrpc/clnt_raw.c (original)
+++ fsf/trunk/libc/sunrpc/clnt_raw.c Mon Apr 27 00:05:44 2009
@@ -57,7 +57,11 @@
CLIENT client_object;
XDR xdr_stream;
char _raw_buf[UDPMSGSIZE];
- char mashl_callmsg[MCALL_MSG_SIZE];
+ union
+ {
+ char msg[MCALL_MSG_SIZE];
+ u_long rm_xid;
+ } mashl_callmsg;
u_int mcnt;
};
#ifdef _RPC_THREAD_SAFE_
@@ -111,7 +115,8 @@
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
call_msg.rm_call.cb_prog = prog;
call_msg.rm_call.cb_vers = vers;
- INTUSE(xdrmem_create) (xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
+ INTUSE(xdrmem_create) (xdrs, clp->mashl_callmsg.msg, MCALL_MSG_SIZE,
+ XDR_ENCODE);
if (!INTUSE(xdr_callhdr) (xdrs, &call_msg))
{
perror (_ ("clnt_raw.c: fatal header serialization error"));
@@ -156,8 +161,11 @@
*/
xdrs->x_op = XDR_ENCODE;
XDR_SETPOS (xdrs, 0);
- ((struct rpc_msg *) clp->mashl_callmsg)->rm_xid++;
- if ((!XDR_PUTBYTES (xdrs, clp->mashl_callmsg, clp->mcnt)) ||
+ /* Just checking the union definition to access rm_xid is correct. */
+ if (offsetof (struct rpc_msg, rm_xid) != 0)
+ abort ();
+ clp->mashl_callmsg.rm_xid++;
+ if ((!XDR_PUTBYTES (xdrs, clp->mashl_callmsg.msg, clp->mcnt)) ||
(!XDR_PUTLONG (xdrs, (long *) &proc)) ||
(!AUTH_MARSHALL (h->cl_auth, xdrs)) ||
(!(*xargs) (xdrs, argsp)))
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c Mon Apr 27 00:05:44 2009
@@ -112,6 +112,7 @@
* to produce the hexadecimal values shown.
*/
+#include <errno.h>
#include "math.h"
#include "math_private.h"
#define one Q[0]
@@ -159,7 +160,10 @@
return x+x; /* NaN */
else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
}
- if(x > o_threshold) return huge*huge; /* overflow */
+ if(x > o_threshold) {
+ __set_errno (ERANGE);
+ return huge*huge; /* overflow */
+ }
}
if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */
if(x+tiny<0.0) /* raise inexact */
Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c Mon Apr 27 00:05:44 2009
@@ -114,7 +114,8 @@
fi = xfg[i][1].d; gi = xfg[i][2].d; t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) return (s*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua3.d+t3*ub3.d)))==fi+(t2+t4)) return (s*y);
+ t4 = fi*ua3.d+t3*ub3.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (s*y);
/* Second stage */
ffi = xfg[i][3].d;
@@ -222,13 +223,15 @@
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua10.d+t3*ub10.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua10.d+t3*ub10.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua9.d+t3*ub9.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua9.d+t3*ub9.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
@@ -333,13 +336,15 @@
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua18.d+t3*ub18.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua18.d+t3*ub18.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua17.d+t3*ub17.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua17.d+t3*ub17.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
@@ -437,13 +442,15 @@
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua26.d+t3*ub26.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua26.d+t3*ub26.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua25.d+t3*ub25.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua25.d+t3*ub25.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_expm1f.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_expm1f.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_expm1f.c Mon Apr 27 00:05:44 2009
@@ -17,6 +17,7 @@
static char rcsid[] = "$NetBSD: s_expm1f.c,v 1.5 1995/05/10 20:47:11 jtc Exp $";
#endif
+#include <errno.h>
#include "math.h"
#include "math_private.h"
@@ -63,7 +64,10 @@
return x+x; /* NaN */
if(hx==0x7f800000)
return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
- if(x > o_threshold) return huge*huge; /* overflow */
+ if(x > o_threshold) {
+ __set_errno (ERANGE);
+ return huge*huge; /* overflow */
+ }
}
if(xsb!=0) { /* x < -27*ln2, return -1.0 with inexact */
if(x+tiny<(float)0.0) /* raise inexact */
Modified: fsf/trunk/libc/sysdeps/ieee754/k_standard.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/k_standard.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/k_standard.c Mon Apr 27 00:05:44 2009
@@ -692,7 +692,7 @@
? "atanhf" : "atanhl");
exc.retval = x/zero; /* sign(x)*inf */
if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
+ __set_errno (ERANGE);
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("atanh: SING error\n", 18);
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h Mon Apr 27 00:05:44 2009
@@ -29,7 +29,7 @@
#ifdef SHARED
/* This is the function used in the dynamic linker to print the fatal error
message. */
-static inline void
+static void
__attribute__ ((__noreturn__))
dl_fatal (const char *str)
{
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/readv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/readv.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/readv.c Mon Apr 27 00:05:44 2009
@@ -27,8 +27,10 @@
#include <bp-checks.h>
#include <kernel-features.h>
+#ifndef __ASSUME_COMPLETE_READV_WRITEV
static ssize_t __atomic_readv_replacement (int, __const struct iovec *,
int) internal_function;
+#endif
/* Not all versions of the kernel support the large number of records. */
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/writev.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/writev.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/writev.c Mon Apr 27 00:05:44 2009
@@ -27,8 +27,10 @@
#include <bp-checks.h>
#include <kernel-features.h>
+#ifndef __ASSUME_COMPLETE_READV_WRITEV
static ssize_t __atomic_writev_replacement (int, const struct iovec *,
int) internal_function;
+#endif
/* Not all versions of the kernel support the large number of records. */
Modified: fsf/trunk/libc/sysdeps/x86_64/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/dl-machine.h Mon Apr 27 00:05:44 2009
@@ -403,7 +403,9 @@
fmt = "\
%s: Symbol `%s' causes overflow in R_X86_64_32 relocation\n";
+# ifndef RESOLVE_CONFLICT_FIND_MAP
print_err:
+# endif
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
_dl_error_printf (fmt,
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/s_expm1l.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/s_expm1l.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/s_expm1l.S Mon Apr 27 00:05:44 2009
@@ -1,5 +1,5 @@
/* ix87 specific implementation of exp(x)-1.
- Copyright (C) 1996, 1997, 2001, 2002, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,2001,2002,2008,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
Based on code by John C. Bowman <bowman@xxxxxxxxxxxxxxxxxxx>.
@@ -51,7 +51,7 @@
movzwl 8+8(%rsp), %eax // load sign bit and 15-bit exponent
xorb $0x80, %ah // invert sign bit (now 1 is "positive")
cmpl $0xc006, %eax // is num positive and exp >= 6 (number is >= 128.0)?
- jae __ieee754_expl // (if num is denormal, it is at least >= 64.0)
+ jae __expl // (if num is denormal, it is at least >= 64.0)
fldt 8(%rsp) // x
fxam // Is NaN or +-Inf?
@@ -76,7 +76,7 @@
fscale // 2^int(log2(e)*x) : int(log2(e)*x) : 2^(log2(e)*x)-2^int(log2(e)*x)
fsubrl MO(one) // 1-2^int(log2(e)*x) : int(log2(e)*x) : 2^(log2(e)*x)-2^int(log2(e)*x)
fstp %st(1) // 1-2^int(log2(e)*x) : 2^(log2(e)*x)-2^int(log2(e)*x)
- fsubrp %st, %st(1) // 2^(log2(e)*x)
+ fsubrp %st, %st(1) // 2^(log2(e)*x)-1
ret
2: testl $0x200, %eax // Test sign.