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]

[PATCH] MIPS BFD: Fix handling of forced local symbols


This patch tests for forced local symbols via forced_local instead
of dynindx == -1. For the case in mips_elf_create_dynamic_relocation
this makes a difference because the info->shared test was missing as
well, the mips_elf_calculate_relocation case probably doesn't change
its behaviour. I'm not entirely sure about the latter, though.

Comments?


Thiemo


2005-11-01  Thiemo Seufer  <ths@networkno.de>

	* elfxx-mips.c (mips_elf_calculate_relocation): Handle only
	forced local symbols here.
	(mips_elf_create_dynamic_relocation): Likewise.
	(_bfd_mips_elf_finish_dynamic_symbol): Fix typo in comment.


Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.152
diff -u -p -r1.152 elfxx-mips.c
--- bfd/elfxx-mips.c	25 Oct 2005 16:19:08 -0000	1.152
+++ bfd/elfxx-mips.c	1 Nov 2005 02:12:36 -0000
@@ -3918,7 +3918,7 @@ mips_elf_calculate_relocation (bfd *abfd
 	  if (h->tls_type == GOT_NORMAL
 	      && (! elf_hash_table(info)->dynamic_sections_created
 		  || (info->shared
-		      && (info->symbolic || h->root.dynindx == -1)
+		      && (info->symbolic || h->root.forced_local)
 		      && h->root.def_regular)))
 	    {
 	      /* This is a static link or a -Bsymbolic link.  The
@@ -4483,10 +4483,8 @@ mips_elf_create_dynamic_relocation (bfd 
   /* We must now calculate the dynamic symbol table index to use
      in the relocation.  */
   if (h != NULL
-      && (! info->symbolic || !h->root.def_regular)
-      /* h->root.dynindx may be -1 if this symbol was marked to
-	 become local.  */
-      && h->root.dynindx != -1)
+      && (!h->root.def_regular
+	  || (info->shared && !info->symbolic && !h->root.forced_local)))
     {
       indx = h->root.dynindx;
       if (SGI_COMPAT (output_bfd))
@@ -7379,7 +7377,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd
 				   MIPS_ELF_STUB_SECTION_NAME (dynobj));
       BFD_ASSERT (s != NULL);
 
-      /* FIXME: Can h->dynindex be more than 64K?  */
+      /* FIXME: Can h->dynindx be more than 64K?  */
       if (h->dynindx & 0xffff0000)
 	return FALSE;
 


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