* config/tc-sh.c (md_apply_fix): For ELF, do not "adjust back" VAL

for weak symbols.
This commit is contained in:
Hans-Peter Nilsson 2000-10-30 20:26:42 +00:00
parent d8374dcd8a
commit 1308f14c97
2 changed files with 14 additions and 2 deletions

View File

@ -4,6 +4,9 @@
* as.c (parse_args) <std_longopts>: Add comment about the need to
check OPTION_MD_BASE in as.h.
* config/tc-sh.c (md_apply_fix): For ELF, do not "adjust back" VAL
for weak symbols.
2000-10-27 Nick Clifton <nickc@redhat.com>
* configure.in (emulations): Add m68hc12.

View File

@ -2767,8 +2767,17 @@ md_apply_fix (fixP, val)
/* The function adjust_reloc_syms won't convert a reloc against a weak
symbol into a reloc against a section, but bfd_install_relocation
will screw up if the symbol is defined, so we have to adjust val here
to avoid the screw up later. */
if (fixP->fx_addsy != NULL
to avoid the screw up later.
For ordinary relocs, this does not happen for ELF, since for ELF,
bfd_install_relocation uses the "special function" field of the
howto, and does not execute the code that needs to be undone, as long
as the special function does not return bfd_reloc_continue.
It can happen for GOT- and PLT-type relocs the way they are
described in elf32-sh.c as they use bfd_elf_generic_reloc, but it
doesn't matter here since those relocs don't use VAL; see below. */
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
&& fixP->fx_addsy != NULL
&& S_IS_WEAK (fixP->fx_addsy))
val -= S_GET_VALUE (fixP->fx_addsy);
#endif