aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i960.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-03-01 00:43:58 +0000
committerAlan Modra <amodra@gmail.com>2005-03-01 00:43:58 +0000
commit44f2f9d2a3fca1612061a377f6c6f512be635fff (patch)
treefc0679a0cb8eb8a0b0e7d08982fc5ef527ec9cf2 /gas/config/tc-i960.c
parent70bfececf5f88eb75203859f69a5382bad663f9b (diff)
downloadgdb-44f2f9d2a3fca1612061a377f6c6f512be635fff.zip
gdb-44f2f9d2a3fca1612061a377f6c6f512be635fff.tar.gz
gdb-44f2f9d2a3fca1612061a377f6c6f512be635fff.tar.bz2
* configure.in (AC_C_BIGENDIAN): Invoke.
* configure: Regenerate. * write.c (write_object_file <!BFD_ASSEMBLER>): Don't use sizeof host variable to set string header size. * config/obj-aout.c (obj_header_append): Don't use host structs. (obj_symbol_to_chars): Likewise. (obj_emit_strings): Likewise. Use the passed in output pointer. * config/obj-aout.h (H_GET_FILE_SIZE): Include H_GET_LINENO_SIZE. * config/obj-bout.c (obj_emit_relocations): Use md_reloc_size, not sizeof host struct. (obj_header_append, obj_symbol_to_chars): Don't use host structs. (obj_emit_strings): Likewise. * config/obj-bout.h (EXEC_BYTES_SIZE): Define. (N_TXTOFF, H_GET_FILE_SIZE, H_GET_HEADER_SIZE): Use instead of sizeof host struct. (H_SET_SYMBOL_TABLE_SIZE): Hard code sym size rather than using sizeof host struct. (host_number_to_chars): Define. * config/obj-hp300.c (hp300_header_append): Don't use sizeof host internal struct to set header sizes. * config/tc-i960.c (md_number_to_field): Warning fix. (md_ri_to_chars): Use host byte order. (get_cdisp, md_apply_fix3): Warning fix.
Diffstat (limited to 'gas/config/tc-i960.c')
-rw-r--r--gas/config/tc-i960.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 8b0a538..1786afe 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -859,7 +859,7 @@ md_number_to_field (instrP, val, bfixP)
/* Surprise! -- we stored the number of bits to be modified rather
than a pointer to a structure. */
- numbits = (int) bfixP;
+ numbits = (int) (size_t) bfixP;
if (numbits == 1)
{
/* This is a no-op, stuck here by reloc_callj() */
@@ -1116,9 +1116,6 @@ md_estimate_size_before_relax (fragP, segment_type)
executable code is actually downloaded to the i80960). Therefore,
we leave it in host byte order.
- The above comment is no longer true. This routine now really
- does do the reordering (Ian Taylor 28 Aug 92).
-
*************************************************************************** */
static void md_ri_to_chars PARAMS ((char *, struct relocation_info *));
@@ -1127,17 +1124,25 @@ md_ri_to_chars (where, ri)
char *where;
struct relocation_info *ri;
{
- md_number_to_chars (where, ri->r_address,
- sizeof (ri->r_address));
- where[4] = ri->r_index & 0x0ff;
- where[5] = (ri->r_index >> 8) & 0x0ff;
- where[6] = (ri->r_index >> 16) & 0x0ff;
- where[7] = ((ri->r_pcrel << 0)
- | (ri->r_length << 1)
- | (ri->r_extern << 3)
- | (ri->r_bsr << 4)
- | (ri->r_disp << 5)
- | (ri->r_callj << 6));
+ host_number_to_chars (where, ri->r_address, 4);
+ host_number_to_chars (where + 4, ri->r_index, 3);
+#if WORDS_BIGENDIAN
+ where[7] = (ri->r_pcrel << 7
+ | ri->r_length << 5
+ | ri->r_extern << 4
+ | ri->r_bsr << 3
+ | ri->r_disp << 2
+ | ri->r_callj << 1
+ | ri->nuthin << 0);
+#else
+ where[7] = (ri->r_pcrel << 0
+ | ri->r_length << 1
+ | ri->r_extern << 3
+ | ri->r_bsr << 4
+ | ri->r_disp << 5
+ | ri->r_callj << 6
+ | ri->nuthin << 7);
+#endif
}
#endif /* defined(OBJ_AOUT) | defined(OBJ_BOUT) */
@@ -1508,7 +1513,7 @@ get_cdisp (dispP, ifmtP, instr, numbits, var_frag, callj)
* bit_fix structure. So we're going to lie and store
* the number of bits affected instead of a pointer.
*/
- fixP->fx_bit_fixP = (bit_fixS *) numbits;
+ fixP->fx_bit_fixP = (bit_fixS *) (size_t) numbits;
}
}
else
@@ -2832,7 +2837,7 @@ md_apply_fix3 (fixP, valP, seg)
md_number_to_imm (place, val, fixP->fx_size);
}
- else if ((int) fixP->fx_bit_fixP == 13
+ else if ((int) (size_t) fixP->fx_bit_fixP == 13
&& fixP->fx_addsy != NULL
&& S_GET_SEGMENT (fixP->fx_addsy) == undefined_section)
{