public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ppc64_elf_get_synthetic_symtab fix
@ 2004-09-02  4:44 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2004-09-02  4:44 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-02  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-02  4:44 ppc64_elf_get_synthetic_symtab fix Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).