[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel vs binutils



On Thu, Aug 30, 2001 at 12:17:08PM -0400, Christopher C. Chimelis wrote:
> 
> On Thu, 30 Aug 2001, Guido Guenther wrote:
> 
> > I think this is what breaks things:
> > 
> > 2001-08-03  Richard Sandiford  <rsandifo@redhat.com>
> > 
> >         * config/tc-mips.c (md_apply_fix): Don't subtract the symbol value from GPREL addends.
> > 
> > When I revert the patch like below things work again.
> 
> Ah, ok.  Does the ELF-native toolchain work ok with that reverted?
I did not try that yet. H.J. Lu told me that he is not seeing any
problems with 2.11.90.0.29 and kernels for little endian boxes... 
Anyway I have attached a more complete patch against .29 (which also
make the Oopses in si_swapinifo go away). I hope some binutils folks can
provide some more input on that...
 -- Guido
diff -u -r1.71 tc-mips.c
--- binutils-2.11.90.0.29/gas/config/tc-mips.c	2001/08/31 21:06:40
+++ binutils-2.11.90.0.29/gas/config/tc-mips.c	2001/09/02 14:03:44
@@ -9593,9 +9593,7 @@
   if (fixP->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour)
     {
       if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16
-	  || ((S_IS_WEAK (fixP->fx_addsy)
-	       || S_IS_EXTERN (fixP->fx_addsy))
-	      && !S_IS_COMMON (fixP->fx_addsy))
+	  || S_IS_WEAK (fixP->fx_addsy)
 	  || (symbol_used_in_reloc_p (fixP->fx_addsy)
 	      && (((bfd_get_section_flags (stdoutput,
 					   S_GET_SEGMENT (fixP->fx_addsy))
@@ -9607,9 +9605,7 @@
 	{
 	  valueT symval = S_GET_VALUE (fixP->fx_addsy);
 	  value -= symval;
-	  if (value != 0
-	      && ! fixP->fx_pcrel
-	      && fixP->fx_r_type != BFD_RELOC_MIPS_GPREL)
+	  if (value != 0 && ! fixP->fx_pcrel)
 	    {
 	      /* In this case, the bfd_install_relocation routine will
 		 incorrectly add the symbol value back in.  We just want
@@ -11111,11 +11107,6 @@
 		&& symsec != &bfd_abs_section
 		&& ! bfd_is_com_section (symsec)
 		&& !linkonce
-#ifdef OBJ_ELF
-		/* A global or weak symbol is treated as external.  */
-	  	&& (OUTPUT_FLAVOR == bfd_target_elf_flavour
-		    && ! (S_IS_EXTERN (sym) || S_IS_WEAK (sym)))
-#endif
 		);
     }
   else
@@ -11152,12 +11143,6 @@
 mips_fix_adjustable (fixp)
      fixS *fixp;
 {
-#ifdef OBJ_ELF
-  /* Prevent all adjustments to global symbols.  */
-  if (OUTPUT_FLAVOR == bfd_target_elf_flavour
-      && (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)))
-    return 0;
-#endif
   if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP)
     return 0;
   if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT

Reply to: