aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-05-06 01:16:15 +0000
committerDaniel Jacobowitz <drow@false.org>2003-05-06 01:16:15 +0000
commitb8e28ff3e46d86f680f49ae0c7b7bd040c44bc88 (patch)
tree0c6ff09b56439e31cfeb4702e6b27f56de017168 /gas
parent13d634d68106c394c6a5cb9adad811e1382fc338 (diff)
downloadgdb-b8e28ff3e46d86f680f49ae0c7b7bd040c44bc88.zip
gdb-b8e28ff3e46d86f680f49ae0c7b7bd040c44bc88.tar.gz
gdb-b8e28ff3e46d86f680f49ae0c7b7bd040c44bc88.tar.bz2
* config/tc-mips.c (mips_need_elf_addend_fixup): Remove
symbol_used_in_reloc_p check. (md_apply_fix3): Remove check for howto->pcrel_offset.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-mips.c31
2 files changed, 27 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1982812..c494ad2 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,4 +1,10 @@
-2003-05-21 Christian Groessler <chris@groessler.org>
+2003-05-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/tc-mips.c (mips_need_elf_addend_fixup): Remove
+ symbol_used_in_reloc_p check.
+ (md_apply_fix3): Remove check for howto->pcrel_offset.
+
+2003-05-01 Christian Groessler <chris@groessler.org>
* expr.h: Fix comments in operatorT typedef.
* config/tc-z8k.c: Add 2003 to copyright message.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 26c54cf..59f0b3d 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -11592,13 +11592,12 @@ mips_need_elf_addend_fixup (fixP)
|| S_IS_EXTERNAL (fixP->fx_addsy))
&& !S_IS_COMMON (fixP->fx_addsy))
return 1;
- if (symbol_used_in_reloc_p (fixP->fx_addsy)
- && (((bfd_get_section_flags (stdoutput,
- S_GET_SEGMENT (fixP->fx_addsy))
- & (SEC_LINK_ONCE | SEC_MERGE)) != 0)
- || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
- ".gnu.linkonce",
- sizeof (".gnu.linkonce") - 1)))
+ if (((bfd_get_section_flags (stdoutput,
+ S_GET_SEGMENT (fixP->fx_addsy))
+ & (SEC_LINK_ONCE | SEC_MERGE)) != 0)
+ || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
+ ".gnu.linkonce",
+ sizeof (".gnu.linkonce") - 1))
return 1;
return 0;
}
@@ -11658,15 +11657,25 @@ md_apply_fix3 (fixP, valP, seg)
value -= symval;
howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
- if (value != 0 && howto && howto->partial_inplace
- && (! fixP->fx_pcrel || howto->pcrel_offset))
+ if (value != 0 && howto && howto->partial_inplace)
{
/* In this case, the bfd_install_relocation routine will
incorrectly add the symbol value back in. We just want
the addend to appear in the object file.
- howto->pcrel_offset is added for R_MIPS_PC16, which is
- generated for code like
+ The condition above used to include
+ "&& (! fixP->fx_pcrel || howto->pcrel_offset)".
+
+ However, howto can't be trusted here, because we
+ might change the reloc type in tc_gen_reloc. We can
+ check howto->partial_inplace because that conversion
+ happens to preserve howto->partial_inplace; but it
+ does not preserve howto->pcrel_offset. I've just
+ eliminated the check, because all MIPS PC-relative
+ relocations are marked howto->pcrel_offset.
+
+ howto->pcrel_offset was originally added for
+ R_MIPS_PC16, which is generated for code like
globl g1 .text
.text