This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

ppc64 synthetic syms


This removes an optimization that has caused some difficulty with
oprofile (now fixed another way).  In testing against a section
pointer I was assuming only one .opd section of interest, but that
isn't true if eg. symbols were from different bfds.  There are other
conceivable ways we could have more than one .opd section, so..

	* elf64-ppc.c (synthetic_opd): Delete.
	(compare_symbols): Look for .opd name rather than section match.
	(ppc64_elf_get_synthetic_symtab): Likewise.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.292
diff -u -p -r1.292 elf64-ppc.c
--- bfd/elf64-ppc.c	4 Mar 2009 05:50:49 -0000	1.292
+++ bfd/elf64-ppc.c	21 Mar 2009 04:37:10 -0000
@@ -2689,7 +2689,6 @@ get_opd_info (asection * sec)
 }
 
 /* Parameters for the qsort hook.  */
-static asection *synthetic_opd;
 static bfd_boolean synthetic_relocatable;
 
 /* qsort comparison function for ppc64_elf_get_synthetic_symtab.  */
@@ -2707,9 +2706,11 @@ compare_symbols (const void *ap, const v
     return 1;
 
   /* then .opd symbols.  */
-  if (a->section == synthetic_opd && b->section != synthetic_opd)
+  if (strcmp (a->section->name, ".opd") == 0
+      && strcmp (b->section->name, ".opd") != 0)
     return -1;
-  if (a->section != synthetic_opd && b->section == synthetic_opd)
+  if (strcmp (a->section->name, ".opd") != 0
+      && strcmp (b->section->name, ".opd") == 0)
     return 1;
 
   /* then other code symbols.  */
@@ -2863,7 +2864,6 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
   else
     memcpy (syms, static_syms, (symcount + 1) * sizeof (*syms));
 
-  synthetic_opd = opd;
   synthetic_relocatable = relocatable;
   qsort (syms, symcount, sizeof (*syms), compare_symbols);
 
@@ -2881,7 +2881,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
     }
 
   i = 0;
-  if (syms[i]->section == opd)
+  if (strcmp (syms[i]->section->name, ".opd") == 0)
     ++i;
   codesecsym = i;
 
@@ -2898,7 +2898,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
   secsymend = i;
 
   for (; i < symcount; ++i)
-    if (syms[i]->section != opd)
+    if (strcmp (syms[i]->section->name, ".opd") != 0)
       break;
   opdsymend = i;
 

-- 
Alan Modra
Australia Development Lab, IBM


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