PARAMS ((int));
static symbolS *xtensa_create_literal_symbol
PARAMS ((segT, fragS *));
-static symbolS *xtensa_create_local_symbol
- PARAMS ((bfd *, const char *, segT, valueT, fragS *));
static bfd_boolean get_is_linkonce_section
PARAMS ((bfd *, segT));
static bfd_boolean xg_emit_insn
static bfd_boolean is_next_frag_target
PARAMS ((const fragS *, const fragS *));
static void xtensa_mark_literal_pool_location
- PARAMS ((bfd_boolean));
+ PARAMS ((void));
static void xtensa_move_labels
PARAMS ((fragS *, valueT, fragS *, valueT));
static void assemble_nop
if (inside_directive (directive_literal))
as_warn (_(".literal_position inside literal directive; ignoring"));
else if (!use_literal_section)
- xtensa_mark_literal_pool_location (FALSE);
+ xtensa_mark_literal_pool_location ();
demand_empty_rest_of_line ();
}
|| !strncmp (input_line_pointer, plt_suffix,
strlen (plt_suffix) - 1)))
{
- tok->X_add_symbol->sy_tc.plt = 1;
+ symbol_get_tc (tok->X_add_symbol)->plt = 1;
input_line_pointer += strlen (plt_suffix);
}
}
{
static int lit_num = 0;
static char name[256];
- symbolS *fragSym;
+ symbolS *symbolP;
sprintf (name, ".L_lit_sym%d", lit_num);
- fragSym = xtensa_create_local_symbol (stdoutput, name, sec, 0, frag_now);
-
- frag->tc_frag_data.is_literal = TRUE;
- lit_num++;
- return fragSym;
-}
-
-
-/* Create a local symbol. If it is in a linkonce section, we have to
- be careful to make sure that if it is used in a relocation that the
- symbol will be in the output file. */
-
-symbolS *
-xtensa_create_local_symbol (abfd, name, sec, value, frag)
- bfd *abfd;
- const char *name;
- segT sec;
- valueT value;
- fragS *frag;
-{
- symbolS *symbolP;
- if (get_is_linkonce_section (abfd, sec))
+ /* Create a local symbol. If it is in a linkonce section, we have to
+ be careful to make sure that if it is used in a relocation that the
+ symbol will be in the output file. */
+ if (get_is_linkonce_section (stdoutput, sec))
{
- symbolP = symbol_new (name, sec, value, frag);
+ symbolP = symbol_new (name, sec, 0, frag);
S_CLEAR_EXTERNAL (symbolP);
/* symbolP->local = 1; */
}
else
- symbolP = symbol_new (name, sec, value, frag);
+ symbolP = symbol_new (name, sec, 0, frag);
+ frag->tc_frag_data.is_literal = TRUE;
+ lit_num++;
return symbolP;
}
placed nearest to their use. */
static void
-xtensa_mark_literal_pool_location (move_labels)
- bfd_boolean move_labels;
+xtensa_mark_literal_pool_location ()
{
/* Any labels pointing to the current location need
to be adjusted to after the literal pool. */
emit_state s;
- fragS *label_target = frag_now;
fragS *pool_location;
- offsetT label_offset = frag_now_fix ();
frag_align (2, 0, 0);
frag_now->tc_frag_data.literal_frag = pool_location;
frag_variant (rs_fill, 0, 0, 0, NULL, 0, NULL);
xtensa_restore_emit_state (&s);
- if (move_labels)
- xtensa_move_labels (label_target, label_offset, frag_now, 0);
}
as_bad (_("invalid last instruction for a zero-overhead loop"));
/* No target aligning in the absolute section. */
- if (now_seg != absolute_section && align_targets
- && !is_unaligned_label (sym))
+ if (now_seg != absolute_section
+ && align_targets
+ && !is_unaligned_label (sym)
+ && !frag_now->tc_frag_data.is_literal)
{
fragS *old_frag = frag_now;
offsetT old_offset = frag_now_fix ();
- if (frag_now->tc_frag_data.is_literal)
- return;
/* frag_now->tc_frag_data.is_insn = TRUE; */
frag_var (rs_machine_dependent, 4, 4,
RELAX_DESIRE_ALIGN_IF_TARGET,
}
}
- /* Special count for "entry" instruction. */
+ /* Special-case for "entry" instruction. */
if (is_entry_opcode (orig_insn.opcode))
{
/* Check that the second opcode (#1) is >= 16. */
as_warn (_("entry instruction with non-constant decrement"));
}
}
- }
- if (!orig_insn.is_specific_opcode && is_entry_opcode (orig_insn.opcode))
- {
- xtensa_mark_literal_pool_location (TRUE);
+ if (!orig_insn.is_specific_opcode)
+ {
+ fragS *label_target = frag_now;
+ offsetT label_offset = frag_now_fix ();
+
+ xtensa_mark_literal_pool_location ();
- /* Automatically align ENTRY instructions. */
- frag_align (2, 0, 0);
+ /* Automatically align ENTRY instructions. */
+ xtensa_move_labels (label_target, label_offset, frag_now, 0);
+ frag_align (2, 0, 0);
+ }
}
if (software_a0_b_retw_interlock)
xtensa_symbol_new_hook (symbolP)
symbolS *symbolP;
{
- symbolP->sy_tc.plt = 0;
+ symbol_get_tc (symbolP)->plt = 0;
}
if (r_type == BFD_RELOC_32
&& exp->X_add_symbol
- && exp->X_add_symbol->sy_tc.plt == 1)
+ && symbol_get_tc (exp->X_add_symbol)->plt == 1)
{
r_type = BFD_RELOC_XTENSA_PLT;
}
as_warn (_("inlining literal pool; "
"specify location with .literal_position."));
recursive = TRUE;
- xtensa_mark_literal_pool_location (FALSE);
+ xtensa_mark_literal_pool_location ();
recursive = FALSE;
}