+2001-06-08 H.J. Lu <hjl@gnu.org>
+
+ * config/tc-mips.c (md_apply_fix): Don't adjust common
+ extern/weak symbols for ELF.
+ (md_estimate_size_before_relax): Treat weak like extern for
+ ELF.
+ (mips_fix_adjustable): Don't adjust extern/weak symbols for
+ ELF.
+
2001-06-08 Alan Modra <amodra@bigpond.net.au>
* Makefile.am: 'som' is not wrongly spelled 'some'.
if (fixP->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour)
{
if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16
- || S_IS_WEAK (fixP->fx_addsy)
+ || ((S_IS_WEAK (fixP->fx_addsy)
+ || S_IS_EXTERN (fixP->fx_addsy))
+ && !S_IS_COMMON (fixP->fx_addsy))
|| (symbol_used_in_reloc_p (fixP->fx_addsy)
&& (((bfd_get_section_flags (stdoutput,
S_GET_SEGMENT (fixP->fx_addsy))
&& ! bfd_is_com_section (symsec)
&& !linkonce
#ifdef OBJ_ELF
- /* A weak symbol is treated as external. */
- && ! S_IS_WEAK (sym)
+ /* A global or weak symbol is treated as external. */
+ && ! (S_IS_EXTERN (sym) || S_IS_WEAK (sym))
#endif
);
}
mips_fix_adjustable (fixp)
fixS *fixp;
{
+#ifdef OBJ_ELF
+ /* Prevent all adjustments to global symbols. */
+ if (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
+ return 0;
+#endif
if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP)
return 0;
if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT