+Mon May 2 17:09:24 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * subsegs.h (segment_info_type): Use fix_tail field even if
+ BFD_ASSEMBLER.
+ * subsegs.c (subseg_change): Initialize fix_tail field.
+ (subseg_get): Likewise.
+ * write.c (frags_chained): New static variable.
+ (fix_new_internal): If frags_chained is set, use fix_root and
+ fix_tail from seg_info (now_seg), rather than frchain_now.
+ (chain_frchains_together_1): Set fix_tail field.
+ (chain_frchains_together): Set frags_chained.
+
Thu Apr 28 01:39:15 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
* config/tc-mips.c (s_option): Only refer to g_switch_* variables
int symbol_table_frozen;
+#ifdef BFD_ASSEMBLER
+/* We generally attach relocs to frag chains. However, after we have
+ chained these all together into a segment, any relocs we add after
+ that must be attached to a segment. This will include relocs added
+ in md_estimate_size_for_relax, for example. */
+static int frags_chained = 0;
+#endif
+
#ifndef BFD_ASSEMBLER
#ifndef MANY_SEGMENTS
{
#ifdef BFD_ASSEMBLER
- fixS **seg_fix_rootP = &frchain_now->fix_root;
- fixS **seg_fix_tailP = &frchain_now->fix_tail;
+ fixS **seg_fix_rootP = (frags_chained
+ ? &seg_info (now_seg)->fix_root
+ : &frchain_now->fix_root);
+ fixS **seg_fix_tailP = (frags_chained
+ ? &seg_info (now_seg)->fix_tail
+ : &frchain_now->fix_tail);
#endif
#ifdef REVERSE_SORT_RELOCS
if (seg_info (section)->fix_root == (fixS *) NULL)
seg_info (section)->fix_root = frchp->fix_root;
prev_fix->fx_next = frchp->fix_root;
+ seg_info (section)->fix_tail = frchp->fix_tail;
prev_fix = frchp->fix_tail;
}
#endif
if (info != (segment_info_type *) NULL)
info->frchainP->frch_last
= chain_frchains_together_1 (section, info->frchainP);
+
+ /* Now that we've chained the frags together, we must add new fixups
+ to the segment, not to the frag chain. */
+ frags_chained = 1;
}
#endif
#if defined (BFD_ASSEMBLER) || !defined (BFD)
+#ifdef BFD_ASSEMBLER
static void
set_symtab ()
{
assert (result == true);
symbol_table_frozen = 1;
}
+#endif
void
write_object_file ()