Update .comm error messages to assume an unsigned value.

Update relaxing code to work in 64-bit address spaces.
This commit is contained in:
Nick Clifton 2003-06-24 11:10:47 +00:00
parent e98d298cda
commit 685736be24
7 changed files with 28 additions and 15 deletions

View file

@ -1,3 +1,15 @@
2003-06-24 Nick Clifton <nickc@redhat.com>
* read.c (s_comm): Change error message to assume an unsigned size
has been passed to .comm.
* config/tc-sparc.c (s_common): Likewise.
* write.c (write_contents): Replace 'unsigned long' with
'addressT' and 'long' with offsetT in order to allow computations
with very large values to work for 64-bit addressed targets.
(relax_and_size_all_segments): Likewise.
(relax_frag): Likewise.
(relax_segment): Likewise.
2003-06-23 Mark Mitchell <mark@codesourcery.com> 2003-06-23 Mark Mitchell <mark@codesourcery.com>
* config/tc-ppc.c (ppc_cleanup): Use bytes to count APUinfo slots. * config/tc-ppc.c (ppc_cleanup): Use bytes to count APUinfo slots.

View file

@ -610,7 +610,6 @@ e-criself.o: $(srcdir)/config/e-criself.c
xtensa-relax.o: $(srcdir)/config/xtensa-relax.c xtensa-relax.o: $(srcdir)/config/xtensa-relax.c
$(COMPILE) -c $(srcdir)/config/xtensa-relax.c $(COMPILE) -c $(srcdir)/config/xtensa-relax.c
# The m68k operand parser. # The m68k operand parser.
EXTRA_as_new_SOURCES = config/m68k-parse.y EXTRA_as_new_SOURCES = config/m68k-parse.y

View file

@ -3279,7 +3279,7 @@ macro_build_jalr (icnt, ep)
int icnt; int icnt;
expressionS *ep; expressionS *ep;
{ {
char *f = NULL;; char *f = NULL;
if (HAVE_NEWABI) if (HAVE_NEWABI)
{ {

View file

@ -3764,7 +3764,7 @@ s_common (ignore)
char *name; char *name;
char c; char c;
char *p; char *p;
int temp, size; offsetT temp, size;
symbolS *symbolP; symbolS *symbolP;
name = input_line_pointer; name = input_line_pointer;
@ -3785,7 +3785,8 @@ s_common (ignore)
if ((temp = get_absolute_expression ()) < 0) if ((temp = get_absolute_expression ()) < 0)
{ {
as_bad (_(".COMMon length (%d.) <0! Ignored."), temp); as_bad (_(".COMMon length (%lu) out of range ignored"),
(unsigned long) temp);
ignore_rest_of_line (); ignore_rest_of_line ();
return; return;
} }

View file

@ -1389,7 +1389,8 @@ s_comm (ignore)
if ((temp = get_absolute_expression ()) < 0) if ((temp = get_absolute_expression ()) < 0)
{ {
as_warn (_(".COMMon length (%ld) < 0 ignored"), (long) temp); as_warn (_(".COMMon length (%lu) out of range ignored"),
(unsigned long) temp);
ignore_rest_of_line (); ignore_rest_of_line ();
if (flag_mri) if (flag_mri)
mri_comment_end (stop, stopc); mri_comment_end (stop, stopc);

View file

@ -1135,7 +1135,7 @@ write_contents (abfd, sec, xxx)
PTR xxx ATTRIBUTE_UNUSED; PTR xxx ATTRIBUTE_UNUSED;
{ {
segment_info_type *seginfo = seg_info (sec); segment_info_type *seginfo = seg_info (sec);
unsigned long offset = 0; addressT offset = 0;
fragS *f; fragS *f;
/* Write out the frags. */ /* Write out the frags. */
@ -1148,9 +1148,9 @@ write_contents (abfd, sec, xxx)
f = f->fr_next) f = f->fr_next)
{ {
int x; int x;
unsigned long fill_size; addressT fill_size;
char *fill_literal; char *fill_literal;
long count; offsetT count;
assert (f->fr_type == rs_fill); assert (f->fr_type == rs_fill);
if (f->fr_fix) if (f->fr_fix)
@ -1310,7 +1310,7 @@ relax_and_size_all_segments ()
#ifdef OBJ_BOUT #ifdef OBJ_BOUT
/* See above comments on b.out data section address. */ /* See above comments on b.out data section address. */
{ {
long bss_vma; addressT bss_vma;
if (data_last_frag == 0) if (data_last_frag == 0)
bss_vma = H_GET_TEXT_SIZE (&headers); bss_vma = H_GET_TEXT_SIZE (&headers);
else else
@ -2070,7 +2070,7 @@ relax_frag (segment, fragP, stretch)
const relax_typeS *start_type; const relax_typeS *start_type;
relax_substateT next_state; relax_substateT next_state;
relax_substateT this_state; relax_substateT this_state;
long growth; offsetT growth;
offsetT aim; offsetT aim;
addressT target; addressT target;
addressT address; addressT address;
@ -2293,7 +2293,7 @@ relax_segment (segment_frag_root, segment)
/* Do relax(). */ /* Do relax(). */
{ {
long stretch; /* May be any size, 0 or negative. */ offsetT stretch; /* May be any size, 0 or negative. */
/* Cumulative number of addresses we have relaxed this pass. /* Cumulative number of addresses we have relaxed this pass.
We may have relaxed more than one address. */ We may have relaxed more than one address. */
int stretched; /* Have we stretched on this pass? */ int stretched; /* Have we stretched on this pass? */
@ -2308,7 +2308,7 @@ relax_segment (segment_frag_root, segment)
for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next) for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next)
{ {
long growth = 0; offsetT growth = 0;
addressT was_address; addressT was_address;
offsetT offset; offsetT offset;
symbolS *symbolP; symbolS *symbolP;
@ -2443,7 +2443,7 @@ relax_segment (segment_frag_root, segment)
cannot have fewer than 0 chars. That is, we can't cannot have fewer than 0 chars. That is, we can't
.org backwards. */ .org backwards. */
as_bad_where (fragP->fr_file, fragP->fr_line, as_bad_where (fragP->fr_file, fragP->fr_line,
_("attempt to .org backwards")); _("attempt to move .org backwards"));
/* We've issued an error message. Change the /* We've issued an error message. Change the
frag to avoid cascading errors. */ frag to avoid cascading errors. */
@ -2502,7 +2502,7 @@ relax_segment (segment_frag_root, segment)
case rs_leb128: case rs_leb128:
{ {
valueT value; valueT value;
int size; offsetT size;
value = resolve_symbol_value (fragP->fr_symbol); value = resolve_symbol_value (fragP->fr_symbol);
size = sizeof_leb128 (value, fragP->fr_subtype); size = sizeof_leb128 (value, fragP->fr_subtype);