This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-773-g4cf77aa


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, master has been updated
       via  4cf77aa9847aac13bf65c977396b6e8a66337238 (commit)
      from  d260b3b40358aaa9a159681271e7420842015a61 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4cf77aa9847aac13bf65c977396b6e8a66337238

commit 4cf77aa9847aac13bf65c977396b6e8a66337238
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Nov 27 00:01:10 2012 +0000

    Fix strict-aliasing warnings from unwind-dw2-fde.c.

diff --git a/ChangeLog b/ChangeLog
index a6af6e7..6b0d548 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-26  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/generic/unwind-dw2-fde.c (get_pc_begin): New function.
+	(fde_unencoded_compare): Use get_pc_begin instead of type-punning.
+	(add_fdes): Likewise.
+	(linear_search_fdes): Likewise.
+	(binary_search_unencoded_fdes): Likewise.
+
 2012-11-26  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* elf/sotruss.ksh: Correctly locate argument of -F and -T options.
diff --git a/sysdeps/generic/unwind-dw2-fde.c b/sysdeps/generic/unwind-dw2-fde.c
index d47f2b1..6dcca1d 100644
--- a/sysdeps/generic/unwind-dw2-fde.c
+++ b/sysdeps/generic/unwind-dw2-fde.c
@@ -1,6 +1,5 @@
 /* Subroutines needed for unwinding stack frames for exception handling.  */
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    Contributed by Jason Merrill <jason@cygnus.com>.
 
    This file is part of the GNU C Library.
@@ -342,14 +341,24 @@ get_fde_encoding (struct dwarf_fde *f)
    (Ideally we would have the linker sort the FDEs so we don't have to do
    it at run time. But the linkers are not yet prepared for this.)  */
 
+/* Return the Nth pc_begin value from FDE x.  */
+
+static inline _Unwind_Ptr
+get_pc_begin (fde *x, size_t n)
+{
+  _Unwind_Ptr p;
+  memcpy (&p, x->pc_begin + n * sizeof (_Unwind_Ptr), sizeof (_Unwind_Ptr));
+  return p;
+}
+
 /* Comparison routines.  Three variants of increasing complexity.  */
 
 static int
 fde_unencoded_compare (struct object *ob __attribute__((unused)),
 		       fde *x, fde *y)
 {
-  _Unwind_Ptr x_ptr = *(_Unwind_Ptr *) x->pc_begin;
-  _Unwind_Ptr y_ptr = *(_Unwind_Ptr *) y->pc_begin;
+  _Unwind_Ptr x_ptr = get_pc_begin (x, 0);
+  _Unwind_Ptr y_ptr = get_pc_begin (y, 0);
 
   if (x_ptr > y_ptr)
     return 1;
@@ -712,7 +721,7 @@ add_fdes (struct object *ob, struct fde_accumulator *accu, fde *this_fde)
 
       if (encoding == DW_EH_PE_absptr)
 	{
-	  if (*(_Unwind_Ptr *) this_fde->pc_begin == 0)
+	  if (get_pc_begin (this_fde, 0) == 0)
 	    continue;
 	}
       else
@@ -830,8 +839,8 @@ linear_search_fdes (struct object *ob, fde *this_fde, void *pc)
 
       if (encoding == DW_EH_PE_absptr)
 	{
-	  pc_begin = ((_Unwind_Ptr *) this_fde->pc_begin)[0];
-	  pc_range = ((_Unwind_Ptr *) this_fde->pc_begin)[1];
+	  pc_begin = get_pc_begin (this_fde, 0);
+	  pc_range = get_pc_begin (this_fde, 1);
 	  if (pc_begin == 0)
 	    continue;
 	}
@@ -881,8 +890,8 @@ binary_search_unencoded_fdes (struct object *ob, void *pc)
       void *pc_begin;
       uaddr pc_range;
 
-      pc_begin = ((void **) f->pc_begin)[0];
-      pc_range = ((uaddr *) f->pc_begin)[1];
+      pc_begin = (void *) get_pc_begin (f, 0);
+      pc_range = (uaddr) get_pc_begin (f, 1);
 
       if (pc < pc_begin)
 	hi = i;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |    8 ++++++++
 sysdeps/generic/unwind-dw2-fde.c |   27 ++++++++++++++++++---------
 2 files changed, 26 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]