aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2002-02-26 22:18:51 +0000
committerChris Demetriou <cgd@google.com>2002-02-26 22:18:51 +0000
commitb25a253ca8d997616d22ad33c212ed478a8c7dc7 (patch)
tree3d6b6b84874ebed01f0c76acb733767c8355e542 /gas
parentd65d31a6a1316ee5a75741fdd3d0f337db926578 (diff)
downloadgdb-b25a253ca8d997616d22ad33c212ed478a8c7dc7.zip
gdb-b25a253ca8d997616d22ad33c212ed478a8c7dc7.tar.gz
gdb-b25a253ca8d997616d22ad33c212ed478a8c7dc7.tar.bz2
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.
Diffstat (limited to 'gas')
-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 1f5abf7..19b5dee 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 048d445..b3acb5c 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