aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-05-22 09:01:55 +0000
committerAlan Modra <amodra@gmail.com>2001-05-22 09:01:55 +0000
commitc801568a3aea2906c9134468c7389acab7f54763 (patch)
tree7292b3f34118001f09814dab18c51232ca3e29e7
parent507c8a1a573604258f12065a7c7fc9300ce32c6e (diff)
downloadgdb-c801568a3aea2906c9134468c7389acab7f54763.zip
gdb-c801568a3aea2906c9134468c7389acab7f54763.tar.gz
gdb-c801568a3aea2906c9134468c7389acab7f54763.tar.bz2
* config/tc-m68k.c (relaxable_symbol): Only treat external symbols
as relaxable if embedded system, make weak syms non-relaxable. Move definition.. (tc_m68k_fix_adjustable): ..so it can be used here. (md_apply_fix_2): Sign extend without conditional.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-m68k.c44
2 files changed, 23 insertions, 27 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f408109..5938524 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2001-05-22 Alan Modra <amodra@one.net.au>
+ * config/tc-m68k.c (relaxable_symbol): Only treat external symbols
+ as relaxable if embedded system, make weak syms non-relaxable.
+ Move definition..
+ (tc_m68k_fix_adjustable): ..so it can be used here.
+ (md_apply_fix_2): Sign extend without conditional.
+
* config/tc-v850.c: Update copyright.
2001-05-16 Jeff Johnston <jjohnstn@redhat.com>
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 8451c2f..842510f 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -714,6 +714,19 @@ tc_coff_fix2rtype (fixP)
#ifdef OBJ_ELF
+/* Return zero if the reference to SYMBOL from within the same segment may
+ be relaxed. */
+
+/* On an ELF system, we can't relax an externally visible symbol,
+ because it may be overridden by a shared library. However, if
+ TARGET_OS is "elf", then we presume that we are assembling for an
+ embedded system, in which case we don't have to worry about shared
+ libraries, and we can relax any external sym. */
+
+#define relaxable_symbol(symbol) \
+ (!((S_IS_EXTERNAL (symbol) && strcmp (TARGET_OS, "elf") != 0) \
+ || S_IS_WEAK (symbol)))
+
/* Compute the relocation code for a fixup of SIZE bytes, using pc
relative relocation if PCREL is non-zero. PIC says whether a special
pic relocation was requested. */
@@ -832,8 +845,7 @@ tc_m68k_fix_adjustable (fixP)
fixS *fixP;
{
/* Prevent all adjustments to global symbols. */
- if (S_IS_EXTERNAL (fixP->fx_addsy)
- || S_IS_WEAK (fixP->fx_addsy))
+ if (! relaxable_symbol (fixP->fx_addsy))
return 0;
/* adjust_reloc_syms doesn't know about the GOT */
@@ -866,6 +878,8 @@ tc_m68k_fix_adjustable (fixP)
#define get_reloc_code(SIZE,PCREL,OTHER) NO_RELOC
+#define relaxable_symbol(symbol) 1
+
#endif /* OBJ_ELF */
#ifdef BFD_ASSEMBLER
@@ -983,27 +997,6 @@ tc_gen_reloc (section, fixp)
#endif /* BFD_ASSEMBLER */
-/* Return zero if the reference to SYMBOL from within the same segment may
- be relaxed. */
-#ifdef OBJ_ELF
-
-/* On an ELF system, we can't relax an externally visible symbol,
- because it may be overridden by a shared library. However, if
- TARGET_OS is "elf", then we presume that we are assembling for an
- embedded system, in which case we don't have to worry about shared
- libraries, and we can relax anything. */
-
-#define relaxable_symbol(symbol) \
- (strcmp (TARGET_OS, "elf") == 0 \
- || (! S_IS_EXTERNAL (symbol) \
- && ! S_IS_WEAK (symbol)))
-
-#else
-
-#define relaxable_symbol(symbol) 1
-
-#endif
-
/* Handle of the OPCODE hash table. NULL means any use before
m68k_ip_begin() will crash. */
static struct hash_control *op_hash;
@@ -4226,10 +4219,7 @@ md_apply_fix_2 (fixP, val)
buf += fixP->fx_where;
/* end ibm compiler workaround */
- if (val & 0x80000000)
- val |= ~(addressT)0x7fffffff;
- else
- val &= 0x7fffffff;
+ val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
#ifdef OBJ_ELF
if (fixP->fx_addsy)