elf32-cris.c: fix first argument for _bfd_elf_get_dynamic_reloc_section

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Wed Mar 31 22:58:00 GMT 2010


I noticed that in my previous patch, I copied a bug introduced
when targets were changed to use _bfd_elf_get_dynamic_reloc_section;
its bfd argument is supposed to be the dynobj, not the input
bfd.  Code inspection finds no way to trig the erroneous
argument to be used, but better fix this now rather than finding
out the hard way if or when the code is reworked.

Tested cross to cris-elf, committed.

	* elf32-cris.c (cris_elf_relocate_section): Correct first argument
	to _bfd_elf_get_dynamic_reloc_section.
	(elf_cris_discard_excess_dso_dynamics): Ditto.

Index: elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.108
diff -p -u -r1.108 elf32-cris.c
--- elf32-cris.c	31 Mar 2010 03:38:26 -0000	1.108
+++ elf32-cris.c	31 Mar 2010 22:38:13 -0000
@@ -1512,7 +1512,7 @@ cris_elf_relocate_section (bfd *output_b
 	      if (sreloc == NULL)
 		{
 		  sreloc = _bfd_elf_get_dynamic_reloc_section
-		    (input_bfd, input_section, /*rela?*/ TRUE);
+		    (dynobj, input_section, /*rela?*/ TRUE);
 		  /* The section should have been created in cris_elf_check_relocs,
 		     but that function will not be called for objects which fail in
 		     cris_elf_merge_private_bfd_data.  */
@@ -3978,7 +3978,8 @@ elf_cris_discard_excess_dso_dynamics (h,
       for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
 	{
 	  asection *sreloc
-	    = _bfd_elf_get_dynamic_reloc_section (s->section->owner,
+	    = _bfd_elf_get_dynamic_reloc_section (elf_hash_table (info)
+						  ->dynobj,
 						  s->section,
 						  /*rela?*/ TRUE);
 	  sreloc->size -= s->count * sizeof (Elf32_External_Rela);

brgds, H-P



More information about the Binutils mailing list