]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 7 Feb 2004 06:37:42 +0000 (06:37 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 7 Feb 2004 06:37:42 +0000 (06:37 +0000)
2004-02-06  Steven Munroe  <sjmunroe@us.ibm.com>

* sysdeps/powerpc/powerpc32/dl-machine.c: Declare __cache_line_size as
weak extern.
(__elf_machine_runtime_setup): Invalidate the instruction cache over
the whole range of the PLT.

ChangeLog
sysdeps/powerpc/powerpc32/dl-machine.c

index 58a114cfc3b135c0e3545e4301e05a81fb0b95de..87d92e3c4e9f578985b3abfbd7b6dcf7caf02f4f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-06  Steven Munroe  <sjmunroe@us.ibm.com>
+
+       * sysdeps/powerpc/powerpc32/dl-machine.c: Declare __cache_line_size as
+       weak extern.
+       (__elf_machine_runtime_setup): Invalidate the instruction cache over
+       the whole range of the PLT.
+
 2004-02-06  Andreas Schwab  <schwab@suse.de>
 
        * posix/regcomp.c (build_range_exp): Fix off-by-one.
index cf22fc707c7ebf1f507c4b2e0d2fa2ad39dff833..642cad48a28acdf34d2d9860c5e57d7625fa10aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation functions.  PowerPC version.
-   Copyright (C) 1995-2001,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1995-2003, 2004 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
 #include <dl-machine.h>
 #include <stdio-common/_itoa.h>
 
+/* The value __cache_line_size is defined in memset.S and is initialised
+   by _dl_sysdep_start via DL_PLATFORM_INIT.  */
+extern int __cache_line_size;
+weak_extern (__cache_line_size)
+
 /* Because ld.so is now versioned, these functions can be in their own file;
    no relocations need to be done to call them.
    Of course, if ld.so is not versioned...  */
@@ -304,14 +309,30 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
         there may be a little overlap at the start and the end.
 
         Assumes that dcbst and icbi apply to lines of 16 bytes or
-        more.  Current known line sizes are 16, 32, and 128 bytes.  */
+        more.  Current known line sizes are 16, 32, and 128 bytes.
+        The following gets the __cache_line_size, when available.  */
+
+      /* Default minimum 4 words per cache line.  */
+      int line_size_words = 4;
+
+      /* Don't try this until ld.so has relocated itself!  */
+      int *line_size_ptr = &__cache_line_size;
+      if (lazy && line_size_ptr != NULL)
+       {
+         /*  Verify that __cache_line_size is defined and set.  */
+         if (*line_size_ptr != 0)
+           /* Convert bytes to words.  */
+           line_size_words = *line_size_ptr / 4;
+       }
 
       size_modified = lazy ? rel_offset_words : 6;
-      for (i = 0; i < size_modified; i += 4)
-       PPC_DCBST (plt + i);
+      for (i = 0; i < size_modified; i += line_size_words)
+        PPC_DCBST (plt + i);
       PPC_DCBST (plt + size_modified - 1);
       PPC_SYNC;
-      PPC_ICBI (plt);
+
+      for (i = 0; i < size_modified; i += line_size_words)
+        PPC_ICBI (plt + i);
       PPC_ICBI (plt + size_modified - 1);
       PPC_ISYNC;
     }
This page took 0.054075 seconds and 5 git commands to generate.