Index: gas/config/tc-i386.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-i386.c,v retrieving revision 1.368 diff -p -u -r1.368 tc-i386.c --- gas/config/tc-i386.c 25 Feb 2009 18:59:52 -0000 1.368 +++ gas/config/tc-i386.c 17 Mar 2009 04:54:49 -0000 @@ -7658,6 +7658,13 @@ md_apply_fix (fixP, valP, seg) value += md_pcrel_from (fixP); #endif } +#if defined (OBJ_COFF) && defined (TE_PE) + else if (fixP->fx_addsy != NULL && S_IS_WEAK (fixP->fx_addsy)) + { + value = 0; + S_SET_VALUE (fixP->fx_addsy, 0); + } +#endif /* Fix a few things - the dynamic linker expects certain values here, and we must not disappoint it. */ @@ -7721,6 +7728,13 @@ md_apply_fix (fixP, valP, seg) /* Are we finished with this relocation now? */ if (fixP->fx_addsy == NULL) fixP->fx_done = 1; +#if defined (OBJ_COFF) && defined (TE_PE) + else if (fixP->fx_addsy != NULL && S_IS_WEAK (fixP->fx_addsy)) + { + fixP->fx_done = 0; + return; + } +#endif else if (use_rela_relocations) { fixP->fx_no_overflow = 1;