]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
libc part of prelink IFUNC support.
authorJakub Jelinek <jakub@redhat.com>
Mon, 15 Jun 2009 14:46:53 +0000 (07:46 -0700)
committerUlrich Drepper <drepper@redhat.com>
Mon, 15 Jun 2009 14:46:53 +0000 (07:46 -0700)
The dl-lookup.c changes are needed for prelink (support in prelink
checked into SVN, tested for both i?86 and x86-64), dl-irel.h just
something I discovered by code inspection.

ChangeLog
elf/dl-lookup.c
sysdeps/i386/dl-irel.h

index 673493886bbc5a890dc5f8528d2c33c604831c84..95b13e00f94fbf07a337ce79e0b223293c8c51af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/dl-lookup.c (_dl_debug_bindings): When resolving to
+       STT_GNU_IFUNC symbol or in 8 into type_class.
+
+       * sysdeps/i386/dl-irel.h (elf_irel): Use Elf32_Addr type
+       instead of Elf64_Addr.
+
 2009-06-14  Ulrich Drepper  <drepper@redhat.com>
 
        * po/sv.po: Update from translation team.
index 92dc7b226aaaf00139a9843646903bf4d5bce178..707d650719e2dd62c74be93483d7978fa3c8375a 100644 (file)
@@ -1,5 +1,5 @@
 /* Look up a symbol in the loaded objects.
-   Copyright (C) 1995-2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-2005, 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
@@ -542,15 +542,20 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
            conflict = 1;
        }
 
-      if (value->s
-         && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
-                               == STT_TLS, 0)))
-       type_class = 4;
+      if (value->s)
+       {
+         if (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
+                               == STT_TLS, 0))
+           type_class = 4;
+         else if (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
+                                    == STT_GNU_IFUNC, 0))
+           type_class |= 8;
+       }
 
       if (conflict
          || GLRO(dl_trace_prelink_map) == undef_map
          || GLRO(dl_trace_prelink_map) == NULL
-         || type_class == 4)
+         || type_class >= 4)
        {
          _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ",
                      conflict ? "conflict" : "lookup",
index 810a35050b9abb6d6f4e7b95a4f65eac9fbdec5d..30385a1ef88906c8997bd0f88d088d3c023d6b7f 100644 (file)
@@ -35,7 +35,7 @@ elf_irel (const Elf32_Rel *reloc)
 
   if (__builtin_expect (r_type == R_386_IRELATIVE, 1))
     {
-      Elf64_Addr value = ((Elf32_Addr (*) (void)) (*reloc_addr)) ();
+      Elf32_Addr value = ((Elf32_Addr (*) (void)) (*reloc_addr)) ();
       *reloc_addr = value;
     }
   else