aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i960.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1992-08-29 00:16:47 +0000
committerIan Lance Taylor <ian@airs.com>1992-08-29 00:16:47 +0000
commit8ae35e59193c5677ad779f1d4468b7946df2bf01 (patch)
tree04fcdf22a940efd7ae0bc2461b3c91bebc25e6dc /gas/config/tc-i960.c
parente41a1546e10d7d4794abed2df54cc25101dc2c18 (diff)
downloadgdb-8ae35e59193c5677ad779f1d4468b7946df2bf01.zip
gdb-8ae35e59193c5677ad779f1d4468b7946df2bf01.tar.gz
gdb-8ae35e59193c5677ad779f1d4468b7946df2bf01.tar.bz2
Fri Aug 28 16:25:22 1992 Ian Lance Taylor (ian@cygnus.com)
* obj-bout.h, obj-bout.c (obj_header_append, obj_symbol_to_chars), tc-i960.c (md_ri_to_chars): Always output bout object file in little endian byte order (used to use endianness of host).
Diffstat (limited to 'gas/config/tc-i960.c')
-rw-r--r--gas/config/tc-i960.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 6e173fc1..dc8d4c2 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -29,6 +29,10 @@
* the downloader converts the file format and corrects the byte-ordering
* of the relevant fields while doing so.)
*
+ * ==> THIS IS NO LONGER TRUE USING BFD. WE CAN GENERATE ANY BYTE ORDER
+ * FOR THE HEADER, AND READ ANY BYTE ORDER. PREFERENCE WOULD BE TO
+ * USE LITTLE-ENDIAN BYTE ORDER THROUGHOUT, REGARDLESS OF HOST. <==
+ *
***************************************************************************** */
/* There are 4 different lengths of (potentially) symbol-based displacements
@@ -955,12 +959,25 @@ register segT 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).
+ *
**************************************************************************** */
void md_ri_to_chars(where, ri)
char *where;
struct relocation_info *ri;
{
- *((struct relocation_info *) where) = *ri; /* structure assignment */
+ 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));
} /* md_ri_to_chars() */
#ifndef WORKING_DOT_WORD