diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2001-06-09 03:28:04 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2001-06-09 03:28:04 +0000 |
commit | ea4ff978a21b6fbc649e9e50454e8aad41fdf471 (patch) | |
tree | 1da9bffbaf0fe4488e06e04ac5608a907f49e4f4 /gas | |
parent | 09ad7db3529ad726a5664d15016e71f7c522cf2b (diff) | |
download | gdb-ea4ff978a21b6fbc649e9e50454e8aad41fdf471.zip gdb-ea4ff978a21b6fbc649e9e50454e8aad41fdf471.tar.gz gdb-ea4ff978a21b6fbc649e9e50454e8aad41fdf471.tar.bz2 |
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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 13 |
2 files changed, 19 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index bc7cb62..5247678 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +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'. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 2576899..6ffe65b 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -9538,7 +9538,9 @@ md_apply_fix (fixP, valueP) 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)) @@ -11024,8 +11026,8 @@ md_estimate_size_before_relax (fragp, segtype) && ! 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 ); } @@ -11063,6 +11065,11 @@ int 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 |