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]

PATCH: PR 528: .set is broken for weak symbols


On Mon, Nov 08, 2004 at 03:59:40PM -0800, H. J. Lu wrote:
> This patch
> 
> http://sources.redhat.com/ml/binutils/2004-11/msg00098.html
> 
> breaks .set, which should only copy the value, not other flags. See
> 
> http://sources.redhat.com/bugzilla/show_bug.cgi?id=528
> 
> Please fix it now.
> 
> 

This patch fixes the problem for me. I have 2 questions:

1. Should .set change the behavior on weak symbols on any platforms?
Does gcc expect that?
2. The ChangeLog entry has

2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
 
        * symbols.c (any_external_name): Define.
        (resolve_symbol_value): Do not convert weak symbols.
				^^^^^^^

Is this a typo? From the code, it seems that weak symbols are
converted.


H.J.
----
2004-11-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR 528
	* symbols.c (resolve_symbol_value): Convert weak symbols only
	for Windows PECOFF.
	(symbol_equated_reloc_p): Don't equate weaks when relocating
	only for Windows PECOFF.

--- gas/symbols.c.set	2004-11-08 09:43:00.000000000 -0800
+++ gas/symbols.c	2004-11-08 16:18:44.988697868 -0800
@@ -995,7 +995,7 @@ resolve_symbol_value (symbolS *symp)
 	     relocation to be against the symbol to which this symbol
 	     is equated.  */
 	  if (! S_IS_DEFINED (add_symbol)
-#if defined(BFD_ASSEMBLER) || defined(S_IS_WEAK)
+#if defined (OBJ_COFF) && defined (TE_PE) && (defined(BFD_ASSEMBLER) || defined(S_IS_WEAK))
 	      || S_IS_WEAK (add_symbol)
 #endif
 	      || S_IS_COMMON (add_symbol))
@@ -2239,7 +2239,7 @@ symbol_equated_reloc_p (symbolS *s)
      resolve_symbol_value to flag expression syms that have been
      equated.  */
   return (s->sy_value.X_op == O_symbol
-#if defined(BFD_ASSEMBLER) || defined(S_IS_WEAK)
+#if defined (OBJ_COFF) && defined (TE_PE) && (defined(BFD_ASSEMBLER) || defined(S_IS_WEAK))
 	  && ! S_IS_WEAK (s)
 #endif
 	  && ((s->sy_resolved && s->sy_value.X_op_symbol != NULL)


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