diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2000-10-30 20:26:42 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2000-10-30 20:26:42 +0000 |
commit | 1308f14c9723e587a736812b15fa1421675bc534 (patch) | |
tree | a8ad4aea067c8abb7c37c27cb2a11a4e8d550de8 /gas | |
parent | d8374dcd8a7b20b0c54a7fbc255609d488348fb5 (diff) | |
download | gdb-1308f14c9723e587a736812b15fa1421675bc534.zip gdb-1308f14c9723e587a736812b15fa1421675bc534.tar.gz gdb-1308f14c9723e587a736812b15fa1421675bc534.tar.bz2 |
* config/tc-sh.c (md_apply_fix): For ELF, do not "adjust back" VAL
for weak symbols.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 3 | ||||
-rw-r--r-- | gas/config/tc-sh.c | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 7bf1d20..efe6c49 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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. diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 65ae551..645397e 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -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 |