summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Demetriou <cgd@broadcom.com>2002-02-26 22:18:51 +0000
committerChris Demetriou <cgd@broadcom.com>2002-02-26 22:18:51 +0000
commite0dc1e15af629321c972853f76af250447ae270b (patch)
treed8ccabcc6ebc7a20ef81449f6c43372c0f56a54c
parent063bb52108e22c2009d1e605c095d2eb663a3c2e (diff)
downloadbinutils-redhat-e0dc1e15af629321c972853f76af250447ae270b.tar.gz
2002-02-26 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (mips_need_elf_addend_fixup): For embedded-PIC only, undo the changes made on 2001-06-08, with the effect being that common or extern symbols are adjusted for embedded-PIC, but weak symbols are not. (md_estimate_size_before_relax: Likewise, with the effect that extern symbols are treated the same as weak symbols only if not embedded-PIC. (mips_fix_adjustable) Likewise, with the effect that weak or extern symbols are not adjusted for embedded-PIC. (md_apply_fix3): Tweak so that the case where value is zero is handled more correctly for embedded-PIC code.
-rw-r--r--gas/ChangeLog14
-rw-r--r--gas/config/tc-mips.c17
2 files changed, 27 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1f5abf7922..19b5deef37 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,17 @@
+2002-02-26 Chris Demetriou <cgd@broadcom.com>
+
+ * config/tc-mips.c (mips_need_elf_addend_fixup): For embedded-PIC
+ only, undo the changes made on 2001-06-08, with the
+ effect being that common or extern symbols are
+ adjusted for embedded-PIC, but weak symbols are not.
+ (md_estimate_size_before_relax: Likewise, with the effect
+ that extern symbols are treated the same as weak symbols
+ only if not embedded-PIC.
+ (mips_fix_adjustable) Likewise, with the effect that
+ weak or extern symbols are not adjusted for embedded-PIC.
+ (md_apply_fix3): Tweak so that the case where value is zero
+ is handled more correctly for embedded-PIC code.
+
2002-02-26 Nick Clifton <nickc@cambridge.redhat.com>
* doc/as.texinfo (Overview): Add missing @ifset IA64
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 048d44529a..b3acb5c183 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -10419,8 +10419,12 @@ mips_need_elf_addend_fixup (fixP)
{
if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16)
return 1;
- if ((S_IS_WEAK (fixP->fx_addsy)
- || S_IS_EXTERN (fixP->fx_addsy))
+ if (mips_pic == EMBEDDED_PIC
+ && S_IS_WEAK (fixP->fx_addsy))
+ return 1;
+ if (mips_pic != EMBEDDED_PIC
+ && (S_IS_WEAK (fixP->fx_addsy)
+ || S_IS_EXTERN (fixP->fx_addsy))
&& !S_IS_COMMON (fixP->fx_addsy))
return 1;
if (symbol_used_in_reloc_p (fixP->fx_addsy)
@@ -10714,7 +10718,10 @@ md_apply_fix3 (fixP, valP, seg)
/* If 'value' is zero, the remaining reloc code won't actually
do the store, so it must be done here. This is probably
a bug somewhere. */
- if (!fixP->fx_done)
+ if (!fixP->fx_done
+ && (fixP->fx_r_type != BFD_RELOC_16_PCREL_S2
+ || fixP->fx_addsy == NULL /* ??? */
+ || ! S_IS_DEFINED (fixP->fx_addsy)))
value -= fixP->fx_frag->fr_address + fixP->fx_where;
value = (offsetT) value >> 2;
@@ -12208,7 +12215,8 @@ md_estimate_size_before_relax (fragp, segtype)
#ifdef OBJ_ELF
/* A global or weak symbol is treated as external. */
&& (OUTPUT_FLAVOR != bfd_target_elf_flavour
- || (! S_IS_EXTERN (sym) && ! S_IS_WEAK (sym)))
+ || (! S_IS_WEAK (sym)
+ && (! S_IS_EXTERN (sym) || mips_pic == EMBEDDED_PIC)))
#endif
);
}
@@ -12249,6 +12257,7 @@ mips_fix_adjustable (fixp)
#ifdef OBJ_ELF
/* Prevent all adjustments to global symbols. */
if (OUTPUT_FLAVOR == bfd_target_elf_flavour
+ && mips_pic != EMBEDDED_PIC
&& (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)))
return 0;
#endif