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]

Re: Improvements and fixes for mips n32/n64 relocations


On Apr 10, 2003, Eric Christopher <echristo at redhat dot com> wrote:

> Yes with the change I noticed offline and the one that I missed that cgd
> spotted and the changes you noticed :)

Thanks.  After installing the fixed patch, I reverted in my tree the
additional changes I made to the original patch I had posted, and took
the following CVS diff:

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/uberbaum/bfd/elfxx-mips.c,v
retrieving revision 1.49
diff -u -p -r1.49 elfxx-mips.c
--- bfd/elfxx-mips.c 11 Apr 2003 01:56:49 -0000 1.49
+++ bfd/elfxx-mips.c 11 Apr 2003 01:59:35 -0000
@@ -5352,20 +5352,7 @@ _bfd_mips_elf_check_relocs (abfd, info, 
 		  && hmips->root.root.u.def.section
 		  && ! (info->shared && ! info->symbolic
 			&& ! (hmips->root.elf_link_hash_flags
-			      & ELF_LINK_FORCED_LOCAL))
-		  /* If we've encountered any other relocation
-		     referencing the symbol, we'll have marked it as
-		     dynamic, and, even though we might be able to get
-		     rid of the GOT entry should we know for sure all
-		     previous relocations were GOT_PAGE ones, at this
-		     point we can't tell, so just keep using the
-		     symbol as dynamic.  This is very important in the
-		     multi-got case, since we don't decide whether to
-		     decay GOT_PAGE to GOT_DISP on a per-GOT basis: if
-		     the symbol is dynamic, we'll need a GOT entry for
-		     every GOT in which the symbol is referenced with
-		     a GOT_PAGE relocation.  */
-		  && hmips->root.dynindx == -1)
+			      & ELF_LINK_FORCED_LOCAL)))
 		break;
 	    }
 	  /* Fall through.  */
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/uberbaum/gas/config/tc-mips.c,v
retrieving revision 1.203
diff -u -p -r1.203 tc-mips.c
--- gas/config/tc-mips.c 11 Apr 2003 01:56:49 -0000 1.203
+++ gas/config/tc-mips.c 11 Apr 2003 01:59:42 -0000
@@ -5088,7 +5088,7 @@ macro (ip)
 	  expr1.X_add_number = offset_expr.X_add_number;
 	  offset_expr.X_add_number = 0;
 	  frag_grow (32);
-	  if (expr1.X_add_number == 0 && tempreg == PIC_CALL_REG)
+	  if (offset_expr.X_add_number == 0 && tempreg == PIC_CALL_REG)
 	    lw_reloc_type = (int) BFD_RELOC_MIPS_CALL16;
 	  macro_build ((char *) NULL, &icnt, &offset_expr,
 		       HAVE_32BIT_ADDRESSES ? "lw" : "ld",
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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