Fix support for PECOFF weak symbols
[deliverable/binutils-gdb.git] / gas / config / tc-i386.c
index 606d16b521348eb686915316bf1a95e67654fb9e..aa2ec54e0471fd457fdf9c9d415b5dc132b58881 100644 (file)
@@ -4801,9 +4801,13 @@ md_apply_fix3 (fixP, valP, seg)
        }
 #endif
 #if defined (OBJ_COFF) && defined (TE_PE)
-      /* For some reason, the PE format does not store a section
-        address offset for a PC relative symbol.  */
-      if (S_GET_SEGMENT (fixP->fx_addsy) != seg)
+      /* For some reason, the PE format does not store a
+        section address offset for a PC relative symbol.  */
+      if (S_GET_SEGMENT (fixP->fx_addsy) != seg
+#if defined(BFD_ASSEMBLER) || defined(S_IS_WEAK)
+         || S_IS_WEAK (fixP->fx_addsy)
+#endif
+         )
        value += md_pcrel_from (fixP);
 #endif
     }
@@ -5378,11 +5382,6 @@ tc_gen_reloc (section, fixp)
 
   rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
 
-#ifdef TE_PE
-  if (S_IS_WEAK (fixp->fx_addsy))
-    rel->addend = rel->address - (*rel->sym_ptr_ptr)->value + 4;
-  else
-#endif
   if (!use_rela_relocations)
     {
       /* HACK: Since i386 ELF uses Rel instead of Rela, encode the
This page took 0.024936 seconds and 4 git commands to generate.