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]

Re: More problems with MIPS gas relocations


On Wed, Jul 25, 2001 at 11:57:08AM -0700, cgd@broadcom.com wrote:
> (b) is protected more completely, using a check like:
> 
> #ifdef OBJ_ELF 
>   if (OUTPUT_FLAVOR == bfd_target_elf_flavour
>       && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 
>       && fixp->fx_subsy == NULL)
>     return 0;
> #endif    
> 
> looking at obj-*.h, it looks like there's the possibility to have ELF
> support compiled in along with other object format support, used
> presumably based on emulation selected at run time.
> 
> looking at the configury, it appears that at minimum MIPS targets
> matching mips-*-irix5*-*, and possibly others, will invoke that
> support.
> 

I'd like to check this patch under the obvious fix rule.


H.J.
----
2001-07-25  H.J. Lu  <hjl@gnu.org>

	* config/tc-mips.c (md_estimate_size_before_relax): Make sure
	we treat weak like extern only for ELF.
	(mips_fix_adjustable): Make sure we don't adjust extern/weak
	symbols only for ELF.

Index: config/tc-mips.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/tc-mips.c,v
retrieving revision 1.45
diff -u -p -r1.45 tc-mips.c
--- config/tc-mips.c	2001/07/23 22:33:11	1.45
+++ config/tc-mips.c	2001/07/25 19:31:44
@@ -11123,7 +11123,8 @@ md_estimate_size_before_relax (fragp, se
 		&& !linkonce
 #ifdef OBJ_ELF
 		/* A global or weak symbol is treated as external.  */
-		&& ! (S_IS_EXTERN (sym) || S_IS_WEAK (sym))
+	  	&& (OUTPUT_FLAVOR == bfd_target_elf_flavour
+		    && ! (S_IS_EXTERN (sym) || S_IS_WEAK (sym)))
 #endif
 		);
     }
@@ -11163,7 +11164,8 @@ mips_fix_adjustable (fixp)
 {
 #ifdef OBJ_ELF
   /* Prevent all adjustments to global symbols.  */
-  if (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
+  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)


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