headers->header.a_relaxable = linkrelax;
+#ifdef CROSS_COMPILE
+ md_number_to_chars(*where, headers->header.a_magic, sizeof(headers->header.a_magic));
+ *where += sizeof(headers->header.a_magic);
+ md_number_to_chars(*where, headers->header.a_text, sizeof(headers->header.a_text));
+ *where += sizeof(headers->header.a_text);
+ md_number_to_chars(*where, headers->header.a_data, sizeof(headers->header.a_data));
+ *where += sizeof(headers->header.a_data);
+ md_number_to_chars(*where, headers->header.a_bss, sizeof(headers->header.a_bss));
+ *where += sizeof(headers->header.a_bss);
+ md_number_to_chars(*where, headers->header.a_syms, sizeof(headers->header.a_syms));
+ *where += sizeof(headers->header.a_syms);
+ md_number_to_chars(*where, headers->header.a_entry, sizeof(headers->header.a_entry));
+ *where += sizeof(headers->header.a_entry);
+ md_number_to_chars(*where, headers->header.a_trsize, sizeof(headers->header.a_trsize));
+ *where += sizeof(headers->header.a_trsize);
+ md_number_to_chars(*where, headers->header.a_drsize, sizeof(headers->header.a_drsize));
+ *where += sizeof(headers->header.a_drsize);
+ md_number_to_chars(*where, headers->header.a_tload, sizeof(headers->header.a_tload));
+ *where += sizeof(headers->header.a_tload);
+ md_number_to_chars(*where, headers->header.a_dload, sizeof(headers->header.a_dload));
+ *where += sizeof(headers->header.a_dload);
+ md_number_to_chars(*where, headers->header.a_talign, sizeof(headers->header.a_talign));
+ *where += sizeof(headers->header.a_talign);
+ md_number_to_chars(*where, headers->header.a_dalign, sizeof(headers->header.a_dalign));
+ *where += sizeof(headers->header.a_dalign);
+ md_number_to_chars(*where, headers->header.a_balign, sizeof(headers->header.a_balign));
+ *where += sizeof(headers->header.a_balign);
+ md_number_to_chars(*where, headers->header.a_relaxable, sizeof(headers->header.a_relaxable));
+ *where += sizeof(headers->header.a_relaxable);
+#else /* ! CROSS_COMPILE */
append(where, (char *) &headers->header, sizeof(headers->header));
+#endif /* ! CROSS_COMPILE */
} /* a_header_append() */
void obj_symbol_to_chars(where, symbolP)
char **where;
symbolS *symbolP;
{
- /* leave in host byte order */
+ md_number_to_chars((char *)&(S_GET_OFFSET(symbolP)), S_GET_OFFSET(symbolP), sizeof(S_GET_OFFSET(symbolP)));
+ md_number_to_chars((char *)&(S_GET_DESC(symbolP)), S_GET_DESC(symbolP), sizeof(S_GET_DESC(symbolP)));
+ md_number_to_chars((char *)&(S_GET_VALUE(symbolP)), S_GET_VALUE(symbolP), sizeof(S_GET_VALUE(symbolP)));
+
append(where, (char *)&symbolP->sy_symbol, sizeof(obj_symbol_type));
} /* obj_symbol_to_chars() */
* 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
* 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