summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2005-05-27 07:11:45 +0000
committerZack Weinberg <zackw@panix.com>2005-05-27 07:11:45 +0000
commitd839eba64c10178c96ee976401d9ab9b753cfc25 (patch)
tree22f0812be5d950a0101c53063fd4a7706df5c2ff
parent2b793e8e74c575a933ce2628c1937e87cf56397f (diff)
downloadbinutils-redhat-d839eba64c10178c96ee976401d9ab9b753cfc25.tar.gz
* config/tc-arm.h (TC_FIX_TYPE): Change to int.
(TC_INIT_FIX_DATA): Initialize to 0, not NULL. * config/tc-arm.c (fix_new_arm): Remove now-unnecessary cast. (md_apply_fix3): Delete fix_is_thumb variable; refer to fixP->tc_fix_data directly in the sole place it was used. Explicitly truncate value, *valP, fixP->fx_addnumber, and fixP->fx_offset to 32 bits, for consistent behavior between 32- and 64-bit hosts.
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/tc-arm.c21
-rw-r--r--gas/config/tc-arm.h4
3 files changed, 28 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 155957b61e..ced79a88a3 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,14 @@
+2005-05-26 Zack Weinberg <zack@codesourcery.com>
+
+ * config/tc-arm.h (TC_FIX_TYPE): Change to int.
+ (TC_INIT_FIX_DATA): Initialize to 0, not NULL.
+ * config/tc-arm.c (fix_new_arm): Remove now-unnecessary cast.
+ (md_apply_fix3): Delete fix_is_thumb variable; refer to
+ fixP->tc_fix_data directly in the sole place it was used.
+ Explicitly truncate value, *valP, fixP->fx_addnumber, and
+ fixP->fx_offset to 32 bits, for consistent behavior between 32-
+ and 64-bit hosts.
+
2005-05-27 Jan Beulich <jbeulich@novell.com>
* config/tc-ia64.c (struct proc_pending): New.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index a0804f3a05..00ad3edb44 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7297,7 +7297,7 @@ fix_new_arm (fragS * frag,
/* Mark whether the fix is to a THUMB instruction, or an ARM
instruction. */
- new_fix->tc_fix_data = (PTR) thumb_mode;
+ new_fix->tc_fix_data = thumb_mode;
}
static void
@@ -10077,9 +10077,6 @@ md_apply_fix3 (fixS * fixP,
unsigned long temp;
int sign;
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
- /* The double cast here prevents warnings about converting a pointer
- to an integer of different size. We know the value is 0, 1, or 2. */
- int fix_is_thumb = (int) (size_t) fixP->tc_fix_data;
assert (fixP->fx_r_type <= BFD_RELOC_UNUSED);
@@ -10098,9 +10095,21 @@ md_apply_fix3 (fixS * fixP,
value += md_pcrel_from (fixP);
}
- /* Remember value for emit_reloc. */
+ /* On a 64-bit host, silently truncate 'value' to 32 bits for
+ consistency with the behavior on 32-bit hosts. Remember value
+ for emit_reloc. */
+ value &= 0xffffffff;
+ value ^= 0x80000000;
+ value -= 0x80000000;
+
+ *valP = value;
fixP->fx_addnumber = value;
+ /* Same treatment for fixP->fx_offset. */
+ fixP->fx_offset &= 0xffffffff;
+ fixP->fx_offset ^= 0x80000000;
+ fixP->fx_offset -= 0x80000000;
+
switch (fixP->fx_r_type)
{
case BFD_RELOC_NONE:
@@ -10436,7 +10445,7 @@ md_apply_fix3 (fixS * fixP,
break;
case BFD_RELOC_ARM_SWI:
- if (fix_is_thumb)
+ if (fixP->tc_fix_data != 0)
{
if (((unsigned long) value) > 0xff)
as_bad_where (fixP->fx_file, fixP->fx_line,
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 7660cfcb88..4f52f43274 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -96,8 +96,8 @@ struct fix;
deliberately not been updated to mark assembler created stabs
symbols as Thumb. */
-#define TC_FIX_TYPE PTR
-#define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL)
+#define TC_FIX_TYPE int
+#define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = 0)
/* We need to keep some local information on symbols. */