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.10-219-ge83c1a8


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  e83c1a8a72b3ea3009e18ecb3fc0778e81655d3b (commit)
       via  87cfd82a1fc269635c9b0dd37c47470b5465e775 (commit)
      from  2d0671cbbdade9013d6fd5153d01bd5e1d3f60cb (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=e83c1a8a72b3ea3009e18ecb3fc0778e81655d3b

commit e83c1a8a72b3ea3009e18ecb3fc0778e81655d3b
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Jul 27 13:40:27 2009 -0700

    Refine testing for xmm/ymm register use in x86-64 ld.so.
    
    The test now takes the callgraph into account.  Only code called
    during runtime relocation is affected by the limitation.  We now
    determine the affected object files as closely as possible from
    the outside.  This allowed to remove some the specializations
    for some of the string functions as they are only used in other
    code paths.

diff --git a/ChangeLog b/ChangeLog
index e31b72f..60b7654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/x86_64/tst-xmmymm.sh: Refine testing.  The script now
+	determines which files are used in runtime lookups and only checks
+	those for SSE use.
+	* sysdeps/x86_64/rtld-memchr.c: Removed.  Not needed with refined
+	testing.
+	* sysdeps/x86_64/rtld-rawmemchr.c: Removed.
+	* sysdeps/x86_64/multiarch/rtld-rawmemchr.c: Removed
+	* sysdeps/x86_64/Makefile: Emit warning that tst-xmmymm.sh might
+	take a while.
+
+	* elf/dl-open.c: Move _dl_scope_free to...
+	* elf/dl-scope.c: ...here.  New file.
+	* elf/Makefile (dl-routines): Add scope.
+
 	* resolv/resolv.h (RES_USE_DNSSEC): Define.
 	* resolv/res_debug.c (p_option): Handle RES_USE_EDNS0 and
 	RES_USE_DNSSEC.
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 57cd884..e8d0285 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -22,6 +22,7 @@ sysdep-rtld-routines += tlsdesc dl-tlsdesc
 
 tests: $(objpfx)tst-xmmymm.out
 $(objpfx)tst-xmmymm.out: ../sysdeps/x86_64/tst-xmmymm.sh $(objpfx)ld.so
+	@echo "Checking ld.so for SSE register use.  This will take a few seconds..."
 	$(SHELL) -e $< $(objpfx) > $@
 endif
 
diff --git a/sysdeps/x86_64/multiarch/rtld-rawmemchr.c b/sysdeps/x86_64/multiarch/rtld-rawmemchr.c
deleted file mode 100644
index 53a9067..0000000
--- a/sysdeps/x86_64/multiarch/rtld-rawmemchr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../rtld-rawmemchr.c"
diff --git a/sysdeps/x86_64/rtld-memchr.c b/sysdeps/x86_64/rtld-memchr.c
deleted file mode 100644
index f63fefb..0000000
--- a/sysdeps/x86_64/rtld-memchr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <string/memchr.c>
diff --git a/sysdeps/x86_64/rtld-rawmemchr.c b/sysdeps/x86_64/rtld-rawmemchr.c
deleted file mode 100644
index 2b91893..0000000
--- a/sysdeps/x86_64/rtld-rawmemchr.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <string/rawmemchr.c>
diff --git a/sysdeps/x86_64/tst-xmmymm.sh b/sysdeps/x86_64/tst-xmmymm.sh
index 0735276..a576e7d 100755
--- a/sysdeps/x86_64/tst-xmmymm.sh
+++ b/sysdeps/x86_64/tst-xmmymm.sh
@@ -1,17 +1,79 @@
-#! /bin/sh
+#! /bin/bash
 objpfx="$1"
 
 tmp=$(mktemp ${objpfx}tst-xmmymm.XXXXXX)
 trap 'rm -f "$tmp"' 1 2 3 15
 
-objdump -d "${objpfx}ld.so" |
-awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xy]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' |
-tee "$tmp"
+# List of object files we have to test
+rtldobjs=$(readelf -W -wi ${objpfx}dl-allobjs.os |
+    awk '/^ </ { if ($5 == "(DW_TAG_compile_unit)") c=1; else c=0 } $2 == "DW_AT_name" { if (c == 1) print $NF }' |
+    sed 's,\(.*/\|\)\([_[:alnum:]-]*[.]\).$,\2os,')
+rtldobjs="$rtldobjs $(ar t ${objpfx}rtld-libc.a)"
 
-echo "Functions which incorrectly modify xmm/ymm registers:"
-err=1
-egrep -vs '^_dl_runtime_profile$' "$tmp" || err=0
-if test $err -eq 0; then echo "None"; fi
+# OBJECT symbols can be ignored.
+readelf -sW ${objpfx}dl-allobjs.os ${objpfx}rtld-libc.a |
+egrep " OBJECT  *GLOBAL " |
+awk '{if ($7 != "ABS") print $8 }' |
+sort -u > "$tmp"
+declare -a objects
+objects=($(cat "$tmp"))
+
+objs="dl-runtime.os"
+tocheck="dl-runtime.os"
+
+while test -n "$objs"; do
+  this="$objs"
+  objs=""
+
+  for f in $this; do
+    undef=$(nm -u "$objpfx"../*/"$f" | awk '{print $2}')
+    if test -n "$undef"; then
+      for s in $undef; do
+	for obj in ${objects[*]} "_GLOBAL_OFFSET_TABLE_"; do
+	  if test "$obj" = "$s"; then
+	    continue 2
+	  fi
+	done
+        for o in $rtldobjs; do
+	  ro=$(echo "$objpfx"../*/"$o")
+	  if nm -g --defined-only "$ro" | egrep -qs " $s\$"; then
+	    if ! (echo "$tocheck $objs" | fgrep -qs "$o"); then
+	      echo "$o needed for $s"
+	      objs="$objs $o"
+	    fi
+	    break;
+	  fi
+	done
+      done
+    fi
+  done
+  tocheck="$tocheck$objs"
+done
+
+echo
+echo
+echo "object files needed: $tocheck"
+
+cp /dev/null "$tmp"
+for f in $tocheck; do
+  objdump -d "$objpfx"../*/"$f" |
+  awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xy]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' |
+  while read fct; do
+    if test "$fct" != "_dl_runtime_profile"; then
+      echo "function $fct in $f modifies xmm/ymm" >> "$tmp"
+      result=1
+    fi
+  done
+done
+
+if test -s "$tmp"; then
+  echo
+  echo
+  cat "$tmp"
+  result=1
+else
+  result=0
+fi
 
 rm "$tmp"
-exit $err
+exit $result

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=87cfd82a1fc269635c9b0dd37c47470b5465e775

commit 87cfd82a1fc269635c9b0dd37c47470b5465e775
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Jul 27 13:23:00 2009 -0700

    Break out _dl_scope_free into its own file.
    
    This reduces the coarse static callgraph that can be discovered by
    looking at the object files.

diff --git a/elf/Makefile b/elf/Makefile
index 21d131e..3baad96 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -29,7 +29,7 @@ routines	= $(dl-routines) dl-support dl-iteratephdr \
 # profiled libraries.
 dl-routines	= $(addprefix dl-,load cache lookup object reloc deps \
 			          runtime error init fini debug misc \
-				  version profile conflict tls origin \
+				  version profile conflict tls origin scope \
 				  execstack caller open close trampoline)
 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
 # But they are absent from the shared libc, because that code is in ld.so.
diff --git a/elf/dl-open.c b/elf/dl-open.c
index b8ebfe0..e920c77 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -165,41 +165,6 @@ add_to_global (struct link_map *new)
   return 0;
 }
 
-int
-_dl_scope_free (void *old)
-{
-  struct dl_scope_free_list *fsl;
-#define DL_SCOPE_FREE_LIST_SIZE (sizeof (fsl->list) / sizeof (fsl->list[0]))
-
-  if (RTLD_SINGLE_THREAD_P)
-    free (old);
-  else if ((fsl = GL(dl_scope_free_list)) == NULL)
-    {
-      GL(dl_scope_free_list) = fsl = malloc (sizeof (*fsl));
-      if (fsl == NULL)
-	{
-	  THREAD_GSCOPE_WAIT ();
-	  free (old);
-	  return 1;
-	}
-      else
-	{
-	  fsl->list[0] = old;
-	  fsl->count = 1;
-	}
-    }
-  else if (fsl->count < DL_SCOPE_FREE_LIST_SIZE)
-    fsl->list[fsl->count++] = old;
-  else
-    {
-      THREAD_GSCOPE_WAIT ();
-      while (fsl->count > 0)
-	free (fsl->list[--fsl->count]);
-      return 1;
-    }
-  return 0;
-}
-
 static void
 dl_open_worker (void *a)
 {
diff --git a/elf/dl-scope.c b/elf/dl-scope.c
new file mode 100644
index 0000000..229177e
--- /dev/null
+++ b/elf/dl-scope.c
@@ -0,0 +1,58 @@
+/* Memory handling for the scope data structures.
+   Copyright (C) 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
+   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.
+
+   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.  */
+
+#include <stdlib.h>
+#include <ldsodefs.h>
+#include <sysdep-cancel.h>
+
+
+int
+_dl_scope_free (void *old)
+{
+  struct dl_scope_free_list *fsl;
+#define DL_SCOPE_FREE_LIST_SIZE (sizeof (fsl->list) / sizeof (fsl->list[0]))
+
+  if (RTLD_SINGLE_THREAD_P)
+    free (old);
+  else if ((fsl = GL(dl_scope_free_list)) == NULL)
+    {
+      GL(dl_scope_free_list) = fsl = malloc (sizeof (*fsl));
+      if (fsl == NULL)
+	{
+	  THREAD_GSCOPE_WAIT ();
+	  free (old);
+	  return 1;
+	}
+      else
+	{
+	  fsl->list[0] = old;
+	  fsl->count = 1;
+	}
+    }
+  else if (fsl->count < DL_SCOPE_FREE_LIST_SIZE)
+    fsl->list[fsl->count++] = old;
+  else
+    {
+      THREAD_GSCOPE_WAIT ();
+      while (fsl->count > 0)
+	free (fsl->list[--fsl->count]);
+      return 1;
+    }
+  return 0;
+}

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

Summary of changes:
 ChangeLog                                 |   14 +++++
 elf/Makefile                              |    2 +-
 elf/dl-open.c                             |   35 -------------
 stdio-common/tstgetln.c => elf/dl-scope.c |   44 ++++++++++------
 sysdeps/x86_64/Makefile                   |    1 +
 sysdeps/x86_64/multiarch/rtld-rawmemchr.c |    1 -
 sysdeps/x86_64/rtld-memchr.c              |    1 -
 sysdeps/x86_64/rtld-rawmemchr.c           |    1 -
 sysdeps/x86_64/tst-xmmymm.sh              |   80 +++++++++++++++++++++++++---
 9 files changed, 114 insertions(+), 65 deletions(-)
 copy stdio-common/tstgetln.c => elf/dl-scope.c (53%)
 delete mode 100644 sysdeps/x86_64/multiarch/rtld-rawmemchr.c
 delete mode 100644 sysdeps/x86_64/rtld-memchr.c
 delete mode 100644 sysdeps/x86_64/rtld-rawmemchr.c


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]