This is the mail archive of the binutils@sources.redhat.com 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_elf_get_synthetic_symtab fix


I made a silly mistake in my last change, and used the wrong symbols when
reading relocs.

	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Use static_syms passed
	in when reading relocs, not our sorted syms.  Remove unnecessary
	var.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.170
diff -u -p -r1.170 elf64-ppc.c
--- bfd/elf64-ppc.c	28 Aug 2004 08:54:34 -0000	1.170
+++ bfd/elf64-ppc.c	2 Sep 2004 04:39:39 -0000
@@ -2688,7 +2688,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
 
   synthetic_opd = opd;
   synthetic_relocatable = relocatable;
-  qsort (syms, symcount, sizeof (asymbol *), compare_symbols);
+  qsort (syms, symcount, sizeof (*syms), compare_symbols);
 
   if (!relocatable && symcount > 1)
     {
@@ -2741,26 +2741,24 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
       arelent *r;
       size_t size;
       long relcount;
-      asection *relopd;
 
       slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
-      relopd = opd;
       relcount = (opd->flags & SEC_RELOC) ? opd->reloc_count : 0;
 
       if (! relcount
-	  || ! (*slurp_relocs) (abfd, relopd, syms, FALSE))
+	  || ! (*slurp_relocs) (abfd, opd, static_syms, FALSE))
 	goto done;
 
       size = 0;
-      for (i = secsymend, r = relopd->relocation; i < opdsymend; ++i)
+      for (i = secsymend, r = opd->relocation; i < opdsymend; ++i)
 	{
 	  asymbol *sym;
 
-	  while (r < relopd->relocation + relcount
+	  while (r < opd->relocation + relcount
 		 && r->address < syms[i]->value + opd->vma)
 	    ++r;
 
-	  if (r == relopd->relocation + relcount)
+	  if (r == opd->relocation + relcount)
 	    break;
 
 	  if (r->address != syms[i]->value + opd->vma)
@@ -2788,15 +2786,15 @@ ppc64_elf_get_synthetic_symtab (bfd *abf
 
       names = (char *) (s + count);
 
-      for (i = secsymend, r = relopd->relocation; i < opdsymend; ++i)
+      for (i = secsymend, r = opd->relocation; i < opdsymend; ++i)
 	{
 	  asymbol *sym;
 
-	  while (r < relopd->relocation + relcount
+	  while (r < opd->relocation + relcount
 		 && r->address < syms[i]->value + opd->vma)
 	    ++r;
 
-	  if (r == relopd->relocation + relcount)
+	  if (r == opd->relocation + relcount)
 	    break;
 
 	  if (r->address != syms[i]->value + opd->vma)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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