Fix undefined reference to _dl_prof_resolve in profiled libc
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 16 May 2012 20:05:58 +0000 (22:05 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 18 May 2012 09:59:44 +0000 (11:59 +0200)
ChangeLog
sysdeps/powerpc/powerpc32/dl-machine.c

index d364639..6c9bc16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-18  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * sysdeps/powerpc/powerpc32/dl-machine.c
+       (__elf_machine_runtime_setup) [PROF]: Don't reference
+       _dl_prof_resolve.
+
 2012-05-18  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/x86_64/fpu/bits/mathinline.h (lrintf): Make inline
index e535480..26c38fd 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation functions.  PowerPC version.
-   Copyright (C) 1995-2006, 2008, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 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
@@ -235,16 +235,21 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
       if (lazy)
        {
          Elf32_Word *tramp = plt + PLT_TRAMPOLINE_ENTRY_WORDS;
-         Elf32_Word dlrr = (Elf32_Word)(profile
-                                        ? _dl_prof_resolve
-                                        : _dl_runtime_resolve);
+         Elf32_Word dlrr;
          Elf32_Word offset;
 
+#ifndef PROF
+         dlrr = (Elf32_Word) (profile
+                              ? _dl_prof_resolve
+                              : _dl_runtime_resolve);
          if (profile && GLRO(dl_profile) != NULL
              && _dl_name_match_p (GLRO(dl_profile), map))
            /* This is the object we are looking for.  Say that we really
               want profiling and the timers are started.  */
            GL(dl_profile_map) = map;
+#else
+         dlrr = (Elf32_Word) _dl_runtime_resolve;
+#endif
 
          /* For the long entries, subtract off data_words.  */
          tramp[0] = OPCODE_ADDIS_HI (11, 11, -data_words);