+2019-04-16 Alan Modra <amodra@gmail.com>
+
+ * frags.h (struct frag <fr_fix>): Use unsigned type.
+ * frags.c (frag_new): Assert that current size exceeds
+ old_frags_var_max_size.
+ * ehopt.c (get_cie_info): Adjust for unsigned fr_fix.
+ * listing.c (calc_hex): Likewise.
+ * write.c (cvt_frag_to_fill, write_relocs): Likewise.
+ * config/tc-arc.c (md_convert_frag): Likewise.
+ * config/tc-avr.c (avr_patch_gccisr_frag): Likewise.
+ * config/tc-mips.c (md_convert_frag): Likewise.
+ * config/tc-rl78.c (md_convert_frag): Likewise.
+ * config/tc-rx.c (md_convert_frag): Likewise.
+ * config/tc-sparc.c (md_apply_fix): Likewise.
+ * config/tc-xtensa.c (next_instrs_are_b_retw): Likewise.
+ (unrelaxed_frag_min_insn_count, unrelaxed_frag_has_b_j): Likewise.
+
2019-04-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
* config/tc-arm.c (parse_sys_vldr_vstr): New function.
int size, fix;
struct arc_relax_type *relax_arg = &fragP->tc_frag_data;
- fix = (fragP->fr_fix < 0 ? 0 : fragP->fr_fix);
+ fix = fragP->fr_fix;
dest = fragP->fr_literal + fix;
table_entry = TC_GENERIC_RELAX_TABLE + fragP->fr_subtype;
/* Turn frag into ordinary code frag of now known size. */
fr->fr_var = 0;
- fr->fr_fix = (offsetT) (where - fr->fr_literal);
- gas_assert (fr->fr_fix <= fr->fr_offset);
+ fr->fr_fix = where - fr->fr_literal;
+ gas_assert (fr->fr_fix <= (valueT) fr->fr_offset);
fr->fr_offset = 0;
fr->fr_type = rs_fill;
fr->fr_subtype = 0;
relax_substateT subtype = fragp->fr_subtype;
bfd_boolean second_longer = (subtype & RELAX_SECOND_LONGER) != 0;
bfd_boolean use_second = (subtype & RELAX_USE_SECOND) != 0;
- int first, second;
+ unsigned int first, second;
fixS *fixp;
first = RELAX_FIRST (subtype);
sequence instead. */
while (fixp
&& fixp->fx_frag == fragp
- && fixp->fx_where < fragp->fr_fix - second)
+ && (valueT) fixp->fx_where + second < fragp->fr_fix)
{
if (subtype & RELAX_USE_SECOND)
fixp->fx_done = 1;
fragP->fr_next);
if (fragP->fr_next != NULL
- && ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
- != fragP->fr_fix))
+ && fragP->fr_next->fr_address - fragP->fr_address != fragP->fr_fix)
as_bad (_("bad frag at %p : fix %ld addr %ld %ld \n"), fragP,
(long) fragP->fr_fix,
(long) fragP->fr_address, (long) fragP->fr_next->fr_address);
fragP->fr_var = 0;
if (fragP->fr_next != NULL
- && ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
- != fragP->fr_fix))
+ && fragP->fr_next->fr_address - fragP->fr_address != fragP->fr_fix)
as_bad (_("bad frag at %p : fix %ld addr %ld %ld \n"), fragP,
(long) fragP->fr_fix,
(long) fragP->fr_address, (long) fragP->fr_next->fr_address);
can be completely resolved here, i.e. if no undefined
symbol is associated with it. */
if (sparc_relax && fixP->fx_addsy == NULL
- && fixP->fx_where + 8 <= fixP->fx_frag->fr_fix)
+ && (valueT) fixP->fx_where + 8 <= fixP->fx_frag->fr_fix)
{
#define G0 0
#define O7 15
static xtensa_insnbuf insnbuf = NULL;
static xtensa_insnbuf slotbuf = NULL;
xtensa_isa isa = xtensa_default_isa;
- int offset = 0;
+ unsigned int offset = 0;
int slot;
bfd_boolean branch_seen = FALSE;
xtensa_isa isa = xtensa_default_isa;
static xtensa_insnbuf insnbuf = NULL;
int insn_count = 0;
- int offset = 0;
+ unsigned int offset = 0;
if (!fragP->tc_frag_data.is_insn)
return insn_count;
{
static xtensa_insnbuf insnbuf = NULL;
xtensa_isa isa = xtensa_default_isa;
- int offset = 0;
+ unsigned int offset = 0;
if (!fragP->tc_frag_data.is_insn)
return FALSE;
{
fragS *f;
fixS *fix;
- int offset;
+ unsigned int offset;
char CIE_id;
char augmentation[10];
int iaug;
gas_assert (frchain_now->frch_last == frag_now);
/* Fix up old frag's fr_fix. */
- frag_now->fr_fix = frag_now_fix_octets () - old_frags_var_max_size;
+ frag_now->fr_fix = frag_now_fix_octets ();
+ gas_assert (frag_now->fr_fix >= old_frags_var_max_size);
+ frag_now->fr_fix -= old_frags_var_max_size;
/* Make sure its type is valid. */
gas_assert (frag_now->fr_type != 0);
addressT last_fr_address;
/* (Fixed) number of octets we know we have. May be 0. */
- offsetT fr_fix;
+ valueT fr_fix;
/* May be used for (Variable) number of octets after above.
The generic frag handling code no longer makes any use of fr_var. */
offsetT fr_var;
{
/* Print as many bytes from the fixed part as is sensible. */
octet_in_frag = 0;
- while ((offsetT) octet_in_frag < frag_ptr->fr_fix
+ while (octet_in_frag < frag_ptr->fr_fix
&& data_buffer_size < MAX_BYTES - 3)
{
if (address == ~(unsigned int) 0)
unsigned int var_rep_idx = octet_in_frag;
/* Print as many bytes from the variable part as is sensible. */
- while (((offsetT) octet_in_frag
- < (frag_ptr->fr_fix + frag_ptr->fr_var * frag_ptr->fr_offset))
+ while ((octet_in_frag
+ < frag_ptr->fr_fix + frag_ptr->fr_var * frag_ptr->fr_offset)
&& data_buffer_size < MAX_BYTES - 3)
{
if (address == ~(unsigned int) 0)
var_rep_idx++;
octet_in_frag++;
- if ((offsetT) var_rep_idx >= frag_ptr->fr_fix + frag_ptr->fr_var)
+ if (var_rep_idx >= frag_ptr->fr_fix + frag_ptr->fr_var)
var_rep_idx = var_rep_max;
}
}
md_convert_frag (stdoutput, sec, fragP);
gas_assert (fragP->fr_next == NULL
- || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
- == fragP->fr_fix));
+ || (fragP->fr_next->fr_address - fragP->fr_address
+ == fragP->fr_fix));
/* After md_convert_frag, we make the frag into a ".space 0".
md_convert_frag() should set up any fixSs and constants
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
{
int fx_size, slack;
- offsetT loc;
+ valueT loc;
arelent **reloc;
#ifndef RELOC_EXPANSION_POSSIBLE
arelent *rel;