* 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.
This commit is contained in:
Daniel Jacobowitz 2003-05-06 00:16:12 +00:00
parent b9e8e7f802
commit 9204e615fb
2 changed files with 26 additions and 11 deletions

View file

@ -1,3 +1,9 @@
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-03 H.J. Lu <hjl@gnu.org> 2003-05-03 H.J. Lu <hjl@gnu.org>
* config/obj-elf.c (obj_elf_parse_section_letters): Make it a * config/obj-elf.c (obj_elf_parse_section_letters): Make it a

View file

@ -11592,13 +11592,12 @@ mips_need_elf_addend_fixup (fixP)
|| S_IS_EXTERNAL (fixP->fx_addsy)) || S_IS_EXTERNAL (fixP->fx_addsy))
&& !S_IS_COMMON (fixP->fx_addsy)) && !S_IS_COMMON (fixP->fx_addsy))
return 1; return 1;
if (symbol_used_in_reloc_p (fixP->fx_addsy) if (((bfd_get_section_flags (stdoutput,
&& (((bfd_get_section_flags (stdoutput,
S_GET_SEGMENT (fixP->fx_addsy)) S_GET_SEGMENT (fixP->fx_addsy))
& (SEC_LINK_ONCE | SEC_MERGE)) != 0) & (SEC_LINK_ONCE | SEC_MERGE)) != 0)
|| !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
".gnu.linkonce", ".gnu.linkonce",
sizeof (".gnu.linkonce") - 1))) sizeof (".gnu.linkonce") - 1))
return 1; return 1;
return 0; return 0;
} }
@ -11658,15 +11657,25 @@ md_apply_fix3 (fixP, valP, seg)
value -= symval; value -= symval;
howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
if (value != 0 && howto && howto->partial_inplace if (value != 0 && howto && howto->partial_inplace)
&& (! fixP->fx_pcrel || howto->pcrel_offset))
{ {
/* In this case, the bfd_install_relocation routine will /* In this case, the bfd_install_relocation routine will
incorrectly add the symbol value back in. We just want incorrectly add the symbol value back in. We just want
the addend to appear in the object file. the addend to appear in the object file.
howto->pcrel_offset is added for R_MIPS_PC16, which is The condition above used to include
generated for code like "&& (! 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 globl g1 .text
.text .text