mips weak symbol fix

Ulf Carlsson ulfc@calypso.engr.sgi.com
Thu May 4 21:57:00 GMT 2000


Hi,

Here is a patch that will fix the failure of testcase I just sent.

Ulf

2000-05-04  Ulf Carlsson  <ulfc@engr.sgi.com>

	* config/tc-mips.c (md_estimate_size_before_relax): Use the external
	version of the relocation instead of the local one for weak symbols.

Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.14
diff -u -p -r1.14 tc-mips.c
--- tc-mips.c	2000/04/25 10:02:20	1.14
+++ tc-mips.c	2000/05/05 04:23:46
@@ -11022,6 +11022,10 @@ md_estimate_size_before_relax (fragp, se
       change = (symsec != &bfd_und_section
 		&& symsec != &bfd_abs_section
 		&& ! bfd_is_com_section (symsec));
+#ifdef OBJ_ELF
+      /* A weak symbol is treated as external.  */
+      change = change ? !(S_IS_WEAK (sym)) : 0;
+#endif
     }
   else
     abort ();




More information about the Binutils mailing list