aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/obj-aout.c22
-rw-r--r--gas/config/obj-coffbfd.c202
-rw-r--r--gas/config/obj-coffbfd.h40
-rw-r--r--gas/config/obj-elf.c83
-rw-r--r--gas/config/obj-ieee.c10
-rw-r--r--gas/config/obj-vms.c2
-rw-r--r--gas/config/tc-a29k.c31
-rw-r--r--gas/config/tc-i960.c7
-rw-r--r--gas/config/tc-m88k.c4
-rw-r--r--gas/config/tc-mips.c40
10 files changed, 255 insertions, 186 deletions
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c
index b43826f..2d7d2ca 100644
--- a/gas/config/obj-aout.c
+++ b/gas/config/obj-aout.c
@@ -19,7 +19,9 @@ to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "as.h"
#include "aout/stab_gnu.h"
+#ifdef BFD_ASSEMBLER
#include "aout/aout64.h"
+#endif
#include "obstack.h"
#ifndef BFD_ASSEMBLER
@@ -60,8 +62,8 @@ const segT N_TYPE_seg[N_TYPE + 2] =
#endif
static void obj_aout_stab PARAMS ((int what));
-static void obj_aout_line PARAMS ((void));
-static void obj_aout_desc PARAMS ((void));
+static void obj_aout_line PARAMS ((int));
+static void obj_aout_desc PARAMS ((int));
const pseudo_typeS obj_pseudo_table[] =
{
@@ -242,7 +244,8 @@ obj_emit_symbols (where, symbol_rootP)
#endif /* ! BFD_ASSEMBLER */
static void
-obj_aout_line ()
+obj_aout_line (ignore)
+ int ignore;
{
/* Assume delimiter is part of expression.
BSD4.2 as fails with delightful bug, so we
@@ -313,7 +316,7 @@ obj_aout_stab (what)
{
case 'd':
S_SET_NAME (symbolP, NULL); /* .stabd feature. */
- S_SET_VALUE (symbolP, (char*) obstack_next_free (&frags) - frag_now->fr_literal);
+ S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
symbolP->sy_frag = frag_now;
break;
@@ -382,7 +385,7 @@ obj_aout_stab (what)
{
if (S_GET_TYPE (symbolP) == N_SLINE)
{
- listing_source_line (S_GET_DESC (symbolP));
+ listing_source_line ((unsigned int) S_GET_DESC (symbolP));
}
else if (S_GET_TYPE (symbolP) == N_SO || S_GET_TYPE (symbolP) == N_SOL)
{
@@ -398,7 +401,8 @@ obj_aout_stab (what)
} /* obj_aout_stab() */
static void
-obj_aout_desc ()
+obj_aout_desc (ignore)
+ int ignore;
{
register char *name;
register char c;
@@ -603,15 +607,15 @@ DEFUN_VOID (s_sect)
if (strcmp (section_name, ".text") == 0)
{
- subseg_new (SEG_TEXT, (subsegT) exp);
+ subseg_set (SEG_TEXT, (subsegT) exp);
}
if (strcmp (section_name, ".data") == 0)
{
if (flagseen['R'])
- subseg_new (SEG_TEXT, (subsegT) exp + 1000);
+ subseg_set (SEG_TEXT, (subsegT) exp + 1000);
else
- subseg_new (SEG_DATA, (subsegT) exp);
+ subseg_set (SEG_DATA, (subsegT) exp);
}
*section_name_end = c;
diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c
index 85414ca..b224f05 100644
--- a/gas/config/obj-coffbfd.c
+++ b/gas/config/obj-coffbfd.c
@@ -134,30 +134,39 @@ static void EXFUN (w_symbols,
char *where,
symbolS * symbol_rootP));
+static char *stack_pop PARAMS ((stack * st));
+static char *stack_push PARAMS ((stack * st, char *element));
+#if 0
+static char *stack_top PARAMS ((stack * st));
+#endif
+static stack *stack_init PARAMS ((unsigned long chunk_size,
+ unsigned long element_size));
-static void EXFUN (obj_coff_def, (int what));
-static void EXFUN (obj_coff_lcomm, (void));
-static void EXFUN (obj_coff_dim, (void));
-static void EXFUN (obj_coff_text, (void));
-static void EXFUN (obj_coff_data, (void));
-static void EXFUN( obj_coff_bss,(void));
-static void EXFUN( obj_coff_ident,(void));
-static void EXFUN (obj_coff_endef, (void));
-static void EXFUN (obj_coff_line, (void));
-static void EXFUN (obj_coff_ln, (int));
-static void EXFUN (obj_coff_scl, (void));
-static void EXFUN (obj_coff_size, (void));
-static void EXFUN (obj_coff_tag, (void));
-static void EXFUN (obj_coff_type, (void));
-static void EXFUN (obj_coff_val, (void));
-void EXFUN (obj_coff_section, (void));
-static void EXFUN (tag_init, (void));
-static void EXFUN (tag_insert, (char *name, symbolS * symbolP));
+static void tag_init PARAMS ((void));
+static void tag_insert PARAMS ((char *name, symbolS * symbolP));
static struct hash_control *tag_hash;
+
static symbolS *def_symbol_in_progress = NULL;
+static void obj_coff_def PARAMS ((int));
+static void obj_coff_lcomm PARAMS ((int));
+static void obj_coff_dim PARAMS ((int));
+static void obj_coff_text PARAMS ((int));
+static void obj_coff_data PARAMS ((int));
+static void obj_coff_bss PARAMS ((int));
+static void obj_coff_ident PARAMS ((int));
+static void obj_coff_endef PARAMS ((int));
+static void obj_coff_line PARAMS ((int));
+static void obj_coff_ln PARAMS ((int));
+static void obj_coff_scl PARAMS ((int));
+static void obj_coff_size PARAMS ((int));
+static void obj_coff_tag PARAMS ((int));
+static void obj_coff_type PARAMS ((int));
+static void obj_coff_val PARAMS ((int));
+void obj_coff_section PARAMS ((int));
+
const pseudo_typeS obj_pseudo_table[] =
{
{"def", obj_coff_def, 0},
@@ -309,6 +318,10 @@ DEFUN (size_section, (abfd, idx),
case rs_align:
size += frag->fr_fix;
size += relax_align (size, frag->fr_offset);
+ break;
+ default:
+ BAD_CASE (frag->fr_type);
+ break;
}
frag = frag->fr_next;
}
@@ -696,7 +709,7 @@ obj_symbol_new_hook (symbolP)
/* Additional information */
symbolP->sy_symbol.ost_flags = 0;
/* Auxiliary entries */
- bzero ((char *) &symbolP->sy_symbol.ost_auxent[0], AUXESZ);
+ memset ((char *) &symbolP->sy_symbol.ost_auxent[0], 0, AUXESZ);
#ifdef STRIP_UNDERSCORE
/* Remove leading underscore at the beginning of the symbol.
@@ -718,7 +731,7 @@ obj_symbol_new_hook (symbolP)
} /* obj_symbol_new_hook() */
/* stack stuff */
-stack *
+static stack *
stack_init (chunk_size, element_size)
unsigned long chunk_size;
unsigned long element_size;
@@ -747,7 +760,7 @@ stack_delete (st)
free (st);
}
-char *
+static char *
stack_push (st, element)
stack *st;
char *element;
@@ -763,26 +776,28 @@ stack_push (st, element)
return st->data + st->pointer;
} /* stack_push() */
-char *
+static char *
stack_pop (st)
stack *st;
{
- if ((st->pointer -= st->element_size) < 0)
+ if (st->pointer < st->element_size)
{
st->pointer = 0;
return (char *) 0;
}
-
+ st->pointer -= st->element_size;
return st->data + st->pointer;
}
-char *
+#if 0
+/* Not used. */
+static char *
stack_top (st)
stack *st;
{
return st->data + st->pointer - st->element_size;
}
-
+#endif
/*
* Handle .ln directives.
@@ -863,7 +878,7 @@ DEFUN (obj_coff_def, (what),
SKIP_WHITESPACES ();
def_symbol_in_progress = (symbolS *) obstack_alloc (&notes, sizeof (*def_symbol_in_progress));
- bzero (def_symbol_in_progress, sizeof (*def_symbol_in_progress));
+ memset (def_symbol_in_progress, 0, sizeof (*def_symbol_in_progress));
symbol_name = input_line_pointer;
name_end = get_symbol_end ();
@@ -897,8 +912,10 @@ DEFUN (obj_coff_def, (what),
} /* obj_coff_def() */
unsigned int dim_index;
+
static void
-DEFUN_VOID (obj_coff_endef)
+obj_coff_endef (ignore)
+ int ignore;
{
symbolS *symbolP = 0;
/* DIM BUG FIX sac@cygnus.com */
@@ -1066,7 +1083,8 @@ DEFUN_VOID (obj_coff_endef)
}
static void
-DEFUN_VOID (obj_coff_dim)
+obj_coff_dim (ignore)
+ int ignore;
{
register int dim_index;
@@ -1106,7 +1124,8 @@ DEFUN_VOID (obj_coff_dim)
} /* obj_coff_dim() */
static void
-obj_coff_line ()
+obj_coff_line (ignore)
+ int ignore;
{
int this_base;
@@ -1140,7 +1159,8 @@ obj_coff_line ()
} /* obj_coff_line() */
static void
-obj_coff_size ()
+obj_coff_size (ignore)
+ int ignore;
{
if (def_symbol_in_progress == NULL)
{
@@ -1156,7 +1176,8 @@ obj_coff_size ()
} /* obj_coff_size() */
static void
-obj_coff_scl ()
+obj_coff_scl (ignore)
+ int ignore;
{
if (def_symbol_in_progress == NULL)
{
@@ -1171,7 +1192,8 @@ obj_coff_scl ()
} /* obj_coff_scl() */
static void
-obj_coff_tag ()
+obj_coff_tag (ignore)
+ int ignore;
{
char *symbol_name;
char name_end;
@@ -1203,7 +1225,8 @@ obj_coff_tag ()
} /* obj_coff_tag() */
static void
-obj_coff_type ()
+obj_coff_type (ignore)
+ int ignore;
{
if (def_symbol_in_progress == NULL)
{
@@ -1225,7 +1248,8 @@ obj_coff_type ()
} /* obj_coff_type() */
static void
-obj_coff_val ()
+obj_coff_val (ignore)
+ int ignore;
{
if (def_symbol_in_progress == NULL)
{
@@ -1271,7 +1295,7 @@ obj_coff_val ()
/* FIXME: this is to avoid an error message in the
FIXME case mentioned just above. */
- while (! is_end_of_line[*input_line_pointer])
+ while (! is_end_of_line[(unsigned char) *input_line_pointer])
++input_line_pointer;
}
else
@@ -1299,7 +1323,7 @@ tag_insert (name, symbolP)
char *name;
symbolS *symbolP;
{
- register char *error_string;
+ register const char *error_string;
if (*(error_string = hash_jam (tag_hash, name, (char *) symbolP)))
{
@@ -1617,9 +1641,7 @@ DEFUN (crawl_symbols, (h, abfd),
object_headers *h AND
bfd * abfd)
{
-
unsigned int i;
- symbolS *symbolP;
/* Initialize the stack used to keep track of the matching .bb .be */
@@ -1823,7 +1845,7 @@ DEFUN_VOID (write_object_file)
that any .align's size can be worked by looking at the next
frag */
- subseg_new (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
+ subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
#ifndef SUB_SEGMENT_ALIGN
#define SUB_SEGMENT_ALIGN(SEG) 1
#endif
@@ -1917,7 +1939,7 @@ DEFUN_VOID (write_object_file)
{
unsigned int symtable_size = H_GET_SYMBOL_TABLE_SIZE (&headers);
char *buffer1 = xmalloc (symtable_size + string_byte_count + 1);
- char *ptr = buffer1;
+
H_SET_SYMBOL_TABLE_POINTER (&headers, bfd_tell (abfd));
w_symbols (abfd, buffer1, symbol_rootP);
if (string_byte_count > 0)
@@ -1933,27 +1955,40 @@ DEFUN_VOID (write_object_file)
bfd_errmsg (bfd_error));
}
+/* Add a new segment. This is called from subseg_new via the
+ obj_new_segment macro. */
-static void
-DEFUN (change_to_section, (name, len, exp),
- char *name AND
- unsigned int len AND
- unsigned int exp)
+segT
+obj_coff_add_segment (name)
+ const char *name;
{
+ unsigned int len;
unsigned int i;
- /* Find out if we've already got a section of this name etc */
+
+ /* Find out if we've already got a section of this name. */
+ len = strlen (name);
+ if (len < sizeof (segment_info[i].scnhdr.s_name))
+ ++len;
+ else
+ len = sizeof (segment_info[i].scnhdr.s_name);
for (i = SEG_E0; i < SEG_E9 && segment_info[i].scnhdr.s_name[0]; i++)
+ if (strncmp (segment_info[i].scnhdr.s_name, name, len) == 0
+ && (len == sizeof (segment_info[i].scnhdr.s_name)
+ || segment_info[i].scnhdr.s_name[len] == '\0'))
+ return (segT) i;
+
+ if (i == SEG_E9)
{
- if (strncmp (segment_info[i].scnhdr.s_name, name, len) == 0)
- {
- subseg_new (i, exp);
- return;
- }
+ as_bad ("Too many new sections; can't add \"%s\"", name);
+ return now_seg;
}
- /* No section, add one */
- strncpy (segment_info[i].scnhdr.s_name, name, 8);
+
+ /* Add a new section. */
+ strncpy (segment_info[i].scnhdr.s_name, name,
+ sizeof (segment_info[i].scnhdr.s_name));
segment_info[i].scnhdr.s_flags = STYP_REG;
- subseg_new (i, exp);
+
+ return (segT) i;
}
/*
@@ -1973,7 +2008,8 @@ DEFUN (change_to_section, (name, len, exp),
*/
void
-DEFUN_VOID (obj_coff_section)
+obj_coff_section (ignore)
+ int ignore;
{
/* Strip out the section name */
char *section_name;
@@ -2012,7 +2048,7 @@ DEFUN_VOID (obj_coff_section)
{
++input_line_pointer;
while (*input_line_pointer != '"'
- && ! is_end_of_line[*input_line_pointer])
+ && ! is_end_of_line[(unsigned char) *input_line_pointer])
{
switch (*input_line_pointer)
{
@@ -2036,7 +2072,7 @@ DEFUN_VOID (obj_coff_section)
}
}
- change_to_section (section_name, len, exp);
+ subseg_new (section_name, exp);
segment_info[now_seg].scnhdr.s_flags |= flags;
@@ -2045,38 +2081,42 @@ DEFUN_VOID (obj_coff_section)
static void
-obj_coff_text ()
+obj_coff_text (ignore)
+ int ignore;
{
- change_to_section (".text", 5, get_absolute_expression ());
+ subseg_new (".text", get_absolute_expression ());
}
static void
-obj_coff_data ()
+obj_coff_data (ignore)
+ int ignore;
{
if (flagseen['R'])
- change_to_section (".text", 5, get_absolute_expression () + 1000);
+ subseg_new (".text", get_absolute_expression () + 1000);
else
- change_to_section (".data", 5, get_absolute_expression ());
+ subseg_new (".data", get_absolute_expression ());
}
static void
-obj_coff_bss()
+obj_coff_bss (ignore)
+ int ignore;
{
if (*input_line_pointer == '\n') /* .bss */
- change_to_section(".bss",4, get_absolute_expression());
+ subseg_new(".bss", get_absolute_expression());
else /* .bss id,expr */
- obj_coff_lcomm();
+ obj_coff_lcomm(0);
}
static void
-obj_coff_ident()
+obj_coff_ident (ignore)
+ int ignore;
{
segT current_seg = now_seg; /* save current seg */
subsegT current_subseg = now_subseg;
- change_to_section (".comment", 8, 0); /* .comment seg */
+ subseg_new (".comment", 0); /* .comment seg */
stringer (1); /* read string */
- subseg_new (current_seg, current_subseg); /* restore current seg */
+ subseg_set (current_seg, current_subseg); /* restore current seg */
}
void
@@ -2250,7 +2290,7 @@ DEFUN (w_symbols, (abfd, where, symbol_rootP),
}
else
{
- bzero (symbolP->sy_symbol.ost_entry.n_name, SYMNMLEN);
+ memset (symbolP->sy_symbol.ost_entry.n_name, 0, SYMNMLEN);
strncpy (symbolP->sy_symbol.ost_entry.n_name, temp, SYMNMLEN);
}
where = symbol_to_chars (abfd, where, symbolP);
@@ -2260,7 +2300,8 @@ DEFUN (w_symbols, (abfd, where, symbol_rootP),
} /* w_symbols() */
static void
-DEFUN_VOID (obj_coff_lcomm)
+obj_coff_lcomm (ignore)
+ int ignore;
{
char *name;
char c;
@@ -2305,12 +2346,12 @@ DEFUN_VOID (obj_coff_lcomm)
segT current_seg = now_seg; /* save current seg */
subsegT current_subseg = now_subseg;
- subseg_new (SEG_E2, 1);
+ subseg_set (SEG_E2, 1);
symbolP->sy_frag = frag_now;
p = frag_var(rs_org, 1, 1, (relax_substateT)0, symbolP,
temp, (char *)0);
*p = 0;
- subseg_new (current_seg, current_subseg); /* restore current seg */
+ subseg_set (current_seg, current_subseg); /* restore current seg */
S_SET_SEGMENT(symbolP, SEG_E2);
S_SET_STORAGE_CLASS(symbolP, C_STAT);
}
@@ -2448,9 +2489,10 @@ DEFUN (fixup_segment, (segP, this_segment_type),
}
else
{
- as_bad ("Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %d.",
+ as_bad ("Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld.",
segment_name (S_GET_SEGMENT (sub_symbolP)),
- S_GET_NAME (sub_symbolP), fragP->fr_address + where);
+ S_GET_NAME (sub_symbolP),
+ (long) (fragP->fr_address + where));
} /* if absolute */
}
} /* if sub_symbolP */
@@ -2565,8 +2607,9 @@ DEFUN (fixup_segment, (segP, this_segment_type),
(size == 2 &&
(add_number & ~0xFFFF) && ((add_number & ~0xFFFF) != (-1 & ~0xFFFF))))
{
- as_bad ("Value of %d too large for field of %d bytes at 0x%x",
- add_number, size, fragP->fr_address + where);
+ as_bad ("Value of %ld too large for field of %d bytes at 0x%lx",
+ (long) add_number, size,
+ (unsigned long) (fragP->fr_address + where));
} /* generic error checking */
#endif
#ifdef WARN_SIGNED_OVERFLOW_WORD
@@ -2577,8 +2620,9 @@ DEFUN (fixup_segment, (segP, this_segment_type),
if (!flagseen['J']
&& size == 2
&& add_number > 0x7fff)
- as_bad ("Signed .word overflow; switch may be too large; %d at 0x%x",
- add_number, fragP->fr_address + where);
+ as_bad ("Signed .word overflow; switch may be too large; %ld at 0x%lx",
+ (long) add_number,
+ (unsigned long) (fragP->fr_address + where));
#endif
} /* not a bit fix */
/* once this fix has been applied, we don't have to output anything
diff --git a/gas/config/obj-coffbfd.h b/gas/config/obj-coffbfd.h
index 9e75f7c..0968767 100644
--- a/gas/config/obj-coffbfd.h
+++ b/gas/config/obj-coffbfd.h
@@ -183,7 +183,7 @@ obj_symbol_type;
#define S_IS_LOCAL(s) \
((s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION \
|| (S_LOCAL_NAME(s) && !flagseen['L']) \
- || (strchr (s, '\001') != NULL))
+ || (strchr (S_GET_NAME (s), '\001') != NULL))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) == 0)
@@ -500,30 +500,30 @@ typedef struct
stack;
+#define obj_segment_name(i) (segment_info[(int) (i)].scnhdr.s_name)
+#define obj_add_segment(s) obj_coff_add_segment (s)
-char *EXFUN (stack_pop, (stack * st));
-char *EXFUN (stack_push, (stack * st, char *element));
-char *EXFUN (stack_top, (stack * st));
-stack *EXFUN (stack_init, (unsigned long chunk_size, unsigned long element_size));
-void EXFUN (c_dot_file_symbol, (char *filename));
-void EXFUN (obj_extra_stuff, (object_headers * headers));
-void EXFUN (stack_delete, (stack * st));
+extern segT obj_coff_add_segment PARAMS ((const char *));
-segT EXFUN (s_get_segment,(struct symbol * ptr));
+extern void obj_coff_section PARAMS ((int));
-void EXFUN (c_section_header, (
+extern void c_dot_file_symbol PARAMS ((char *filename));
+extern void obj_extra_stuff PARAMS ((object_headers * headers));
+extern void stack_delete PARAMS ((stack * st));
- struct internal_scnhdr * header,
- char *name,
- long core_address,
- long size,
- long data_ptr,
- long reloc_ptr,
- long lineno_ptr,
- long reloc_number,
- long lineno_number,
- long alignment));
+extern segT s_get_segment PARAMS ((struct symbol * ptr));
+
+extern void c_section_header PARAMS ((struct internal_scnhdr * header,
+ char *name,
+ long core_address,
+ long size,
+ long data_ptr,
+ long reloc_ptr,
+ long lineno_ptr,
+ long reloc_number,
+ long lineno_number,
+ long alignment));
/* sanity check */
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 5ccf21d..9acca92 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -22,17 +22,19 @@
#include "aout/stab_gnu.h"
#include "obstack.h"
+static int obj_elf_write_symbol_p PARAMS ((symbolS *sym));
+
static void obj_elf_stab PARAMS ((int what));
static void obj_elf_xstab PARAMS ((int what));
-static void obj_elf_line PARAMS ((void));
-void obj_elf_desc PARAMS ((void));
-void obj_elf_version PARAMS ((void));
-static void obj_elf_size PARAMS ((void));
-static void obj_elf_type PARAMS ((void));
-static void obj_elf_ident PARAMS ((void));
-static void obj_elf_weak PARAMS ((void));
-static void obj_elf_local PARAMS ((void));
-static void obj_elf_common PARAMS ((void));
+static void obj_elf_line PARAMS ((int));
+void obj_elf_desc PARAMS ((int));
+void obj_elf_version PARAMS ((int));
+static void obj_elf_size PARAMS ((int));
+static void obj_elf_type PARAMS ((int));
+static void obj_elf_ident PARAMS ((int));
+static void obj_elf_weak PARAMS ((int));
+static void obj_elf_local PARAMS ((int));
+static void obj_elf_common PARAMS ((int));
const pseudo_typeS obj_pseudo_table[] =
{
@@ -87,7 +89,8 @@ elf_file_symbol (s)
}
static void
-obj_elf_common ()
+obj_elf_common (ignore)
+ int ignore;
{
char *name;
char c;
@@ -153,7 +156,7 @@ obj_elf_common ()
{
segT old_sec;
int old_subsec;
- char *p;
+ char *pfrag;
int align;
/* allocate_bss: */
@@ -167,9 +170,9 @@ obj_elf_common ()
if (S_GET_SEGMENT (symbolP) == bss_section)
symbolP->sy_frag->fr_symbol = 0;
symbolP->sy_frag = frag_now;
- p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
- (char *) 0);
- *p = 0;
+ pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
+ (char *) 0);
+ *pfrag = 0;
S_SET_SEGMENT (symbolP, bss_section);
S_CLEAR_EXTERNAL (symbolP);
subseg_set (old_sec, old_subsec);
@@ -177,7 +180,7 @@ obj_elf_common ()
else
{
allocate_common:
- S_SET_VALUE (symbolP, size);
+ S_SET_VALUE (symbolP, (valueT) size);
S_SET_EXTERNAL (symbolP);
/* should be common, but this is how gas does it for now */
S_SET_SEGMENT (symbolP, &bfd_und_section);
@@ -221,7 +224,8 @@ obj_elf_common ()
}
static void
-obj_elf_local ()
+obj_elf_local (ignore)
+ int ignore;
{
char *name;
int c;
@@ -249,7 +253,8 @@ obj_elf_local ()
}
static void
-obj_elf_weak ()
+obj_elf_weak (ignore)
+ int ignore;
{
char *name;
int c;
@@ -307,7 +312,7 @@ obj_elf_section (xxx)
p++;
c = *p;
*p = 0;
- string = xmalloc (p - input_line_pointer + 1);
+ string = xmalloc ((unsigned long) (p - input_line_pointer + 1));
strcpy (string, input_line_pointer);
*p = c;
input_line_pointer = p;
@@ -324,7 +329,8 @@ obj_elf_section (xxx)
while (*input_line_pointer == ',')
{
flagword bit;
- int len, inv;
+ unsigned int len;
+ int inv;
char *p, oldp;
input_line_pointer++;
@@ -393,7 +399,8 @@ obj_elf_section (xxx)
}
void
-obj_elf_previous ()
+obj_elf_previous (ignore)
+ int ignore;
{
if (previous_section == 0)
{
@@ -404,7 +411,7 @@ obj_elf_previous ()
previous_section = 0;
}
-int
+static int
obj_elf_write_symbol_p (sym)
symbolS *sym;
{
@@ -475,7 +482,8 @@ obj_elf_frob_symbol (sym, punt)
}
static void
-obj_elf_line ()
+obj_elf_line (ignore)
+ int ignore;
{
/* Assume delimiter is part of expression. BSD4.2 as fails with
delightful bug, so we are not being incompatible here. */
@@ -540,7 +548,7 @@ elf_stab_symbol_string (string, secname)
/* Create the stab sections, if they are not already created. */
{
- char *newsecname = xmalloc (strlen (secname) + 4);
+ char *newsecname = xmalloc ((unsigned long) (strlen (secname) + 4));
strcpy (newsecname, secname);
strcat (newsecname, "str");
seg = bfd_get_section_by_name (stdoutput, newsecname);
@@ -737,7 +745,7 @@ obj_elf_stab_generic (what, secname)
return;
}
- subseg_new ((char *) seg->name, subseg);
+ subseg_set (seg, subseg);
if (seg_is_new)
/* allocate and discard -- filled in later */
@@ -757,7 +765,7 @@ obj_elf_stab_generic (what, secname)
md_number_to_chars (p, 0, 4);
}
- subseg_new ((char *) saved_seg->name, subseg);
+ subseg_set (saved_seg, subseg);
if ((what == 's' || what == 'n')
&& symbolP->sy_value.X_op == O_constant)
@@ -783,7 +791,7 @@ obj_elf_stab_generic (what, secname)
switch (S_GET_TYPE (symbolP))
{
case N_SLINE:
- listing_source_line (S_GET_DESC (symbolP));
+ listing_source_line ((unsigned int) S_GET_DESC (symbolP));
break;
case N_SO:
case N_SOL:
@@ -822,7 +830,8 @@ obj_elf_xstab (what)
}
void
-obj_elf_desc ()
+obj_elf_desc (ignore)
+ int ignore;
{
char *name;
char c;
@@ -877,7 +886,8 @@ obj_symbol_new_hook (symbolP)
}
void
-obj_elf_version ()
+obj_elf_version (ignore)
+ int ignore;
{
char *name;
unsigned int c;
@@ -916,7 +926,7 @@ obj_elf_version ()
/* process the version string */
- subseg_new ((char *) note_secp->name, 0);
+ subseg_set (note_secp, 0);
len = strlen (name);
i_note.namesz = ((len + 1) + 3) & ~3; /* round this to word boundary */
@@ -938,7 +948,7 @@ obj_elf_version ()
}
frag_align (2, 0);
- subseg_new ((char *) seg->name, subseg);
+ subseg_set (seg, subseg);
}
else
{
@@ -948,7 +958,8 @@ obj_elf_version ()
}
static void
-obj_elf_size ()
+obj_elf_size (ignore)
+ int ignore;
{
char *name = input_line_pointer;
char c = get_symbol_end ();
@@ -995,7 +1006,8 @@ obj_elf_size ()
}
static void
-obj_elf_type ()
+obj_elf_type (ignore)
+ int ignore;
{
char *name = input_line_pointer;
char c = get_symbol_end ();
@@ -1042,7 +1054,8 @@ obj_elf_type ()
}
static void
-obj_elf_ident ()
+obj_elf_ident (ignore)
+ int ignore;
{
static segT comment_section;
segT old_section = now_seg;
@@ -1096,8 +1109,8 @@ adjust_stab_sections (abfd, sec, xxx)
assert (fragp->fr_type == rs_fill);
assert (fragp->fr_address == 0 && fragp->fr_fix >= 12);
- bfd_h_put_16 (abfd, nsyms, fragp->fr_literal + 6);
- bfd_h_put_32 (abfd, strsz, fragp->fr_literal + 8);
+ bfd_h_put_16 (abfd, (bfd_vma) nsyms, fragp->fr_literal + 6);
+ bfd_h_put_32 (abfd, (bfd_vma) strsz, fragp->fr_literal + 8);
}
void
diff --git a/gas/config/obj-ieee.c b/gas/config/obj-ieee.c
index 61fff02..7d70f48 100644
--- a/gas/config/obj-ieee.c
+++ b/gas/config/obj-ieee.c
@@ -457,7 +457,7 @@ obj_ieee_section (ignore)
memcpy (segment_info[i].name, s, p - s);
segment_info[i].name[p - s] = 0;
ok:
- subseg_new (i, 0);
+ subseg_set (i, 0);
while (!is_end_of_line[*p])
p++;
input_line_pointer = p;
@@ -515,9 +515,9 @@ DEFUN_VOID (write_object_file)
}
bfd_set_format (abfd, bfd_object);
bfd_set_arch_mach (abfd, bfd_arch_h8300, 0);
- subseg_new (1, 0);
- subseg_new (2, 0);
- subseg_new (3, 0);
+ subseg_set (1, 0);
+ subseg_set (2, 0);
+ subseg_set (3, 0);
for (frchain_ptr = frchain_root;
frchain_ptr != (struct frchain *) NULL;
frchain_ptr = frchain_ptr->frch_next)
@@ -527,7 +527,7 @@ DEFUN_VOID (write_object_file)
that any .align's size can be worked by looking at the next
frag. */
- subseg_new (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
+ subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg);
#ifndef SUB_SEGMENT_ALIGN
#define SUB_SEGMENT_ALIGN(SEG) 2
#endif
diff --git a/gas/config/obj-vms.c b/gas/config/obj-vms.c
index b8c75e2..2ea43f5 100644
--- a/gas/config/obj-vms.c
+++ b/gas/config/obj-vms.c
@@ -327,7 +327,7 @@ s_const ()
register int temp;
temp = get_absolute_expression ();
- subseg_new (SEG_DATA, (subsegT) temp);
+ subseg_set (SEG_DATA, (subsegT) temp);
const_flag = 1;
demand_empty_rest_of_line ();
}
diff --git a/gas/config/tc-a29k.c b/gas/config/tc-a29k.c
index 78e8d10..11a5793 100644
--- a/gas/config/tc-a29k.c
+++ b/gas/config/tc-a29k.c
@@ -33,7 +33,9 @@
#define machine_it a29k_it
const relax_typeS md_relax_table[] =
-{0};
+{
+ { 0, 0, 0, 0 }
+};
#define IMMEDIATE_BIT 0x01000000 /* Turns RB into Immediate */
#define ABSOLUTE_BIT 0x01000000 /* Turns PC-relative to Absolute */
@@ -61,8 +63,10 @@ the_insn;
static void machine_ip PARAMS ((char *str));
/* static void print_insn PARAMS ((struct machine_it *insn)); */
+#ifndef OBJ_COFF
static void s_data1 PARAMS ((void));
-static void s_use PARAMS ((void));
+static void s_use PARAMS ((int));
+#endif
const pseudo_typeS
md_pseudo_table[] =
@@ -132,8 +136,11 @@ static unsigned char toHex[256];
*/
#define ANNUL (1 << 29)
+#ifndef OBJ_COFF
+
static void
-s_use ()
+s_use (ignore)
+ int ignore;
{
if (strncmp (input_line_pointer, ".text", 5) == 0)
@@ -159,7 +166,7 @@ s_use ()
if (strncmp (input_line_pointer, ".lit", 4) == 0)
{
input_line_pointer += 4;
- subseg_new (SEG_DATA, 200);
+ subseg_set (SEG_DATA, 200);
demand_empty_rest_of_line ();
return;
}
@@ -172,11 +179,13 @@ s_use ()
static void
s_data1 ()
{
- subseg_new (SEG_DATA, 1);
+ subseg_set (SEG_DATA, 1);
demand_empty_rest_of_line ();
return;
}
+#endif /* OBJ_COFF */
+
/* Install symbol definition that maps REGNAME to REGNO.
FIXME-SOON: These are not recognized in mixed case. */
@@ -260,7 +269,7 @@ define_some_regs ()
void
md_begin ()
{
- register char *retval = NULL;
+ register const char *retval = NULL;
int lose = 0;
register int skipnext = 0;
register unsigned int i;
@@ -322,7 +331,7 @@ md_begin ()
skipnext = 1;
}
- retval = hash_insert (op_hash, name, &machine_opcodes[i]);
+ retval = hash_insert (op_hash, name, (PTR) &machine_opcodes[i]);
if (retval != NULL && *retval != '\0')
{
fprintf (stderr, "internal error: can't hash `%s': %s\n",
@@ -491,8 +500,8 @@ machine_ip (str)
}
else
{
- as_bad ("Immediate value of %d is too large",
- operand->X_add_number);
+ as_bad ("Immediate value of %ld is too large",
+ (long) operand->X_add_number);
continue;
}
}
@@ -518,8 +527,8 @@ machine_ip (str)
}
else
{
- as_bad ("Immediate value of %d is too large",
- operand->X_add_number);
+ as_bad ("Immediate value of %ld is too large",
+ (long) operand->X_add_number);
continue;
}
}
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index e2ed93d..be54da4 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1219,7 +1219,7 @@ brtab_emit ()
return;
}
- subseg_new (SEG_DATA, 0); /* .data */
+ subseg_set (SEG_DATA, 0); /* .data */
frag_align (2, 0); /* .align 2 */
record_alignment (now_seg, 2);
colon (BR_TAB_NAME); /* BR_TAB_NAME: */
@@ -1839,14 +1839,14 @@ parse_expr (textP, expP)
/* Treat empty string as absolute 0 */
expP->X_add_symbol = expP->X_op_symbol = NULL;
expP->X_add_number = 0;
- exp->X_op = O_constant;
+ expP->X_op = O_constant;
}
else
{
save_in = input_line_pointer; /* Save global */
input_line_pointer = textP; /* Make parser work for us */
- seg = expression (expP);
+ (void) expression (expP);
if (input_line_pointer - textP != strlen (textP))
{
/* Did not consume all of the input */
@@ -1862,7 +1862,6 @@ parse_expr (textP, expP)
input_line_pointer = save_in; /* Restore global */
}
- return seg;
}
diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c
index ea5635f..e064003 100644
--- a/gas/config/tc-m88k.c
+++ b/gas/config/tc-m88k.c
@@ -1269,7 +1269,7 @@ s_bss ()
segT current_seg = now_seg;
subsegT current_subseg = now_subseg;
- subseg_new (SEG_BSS, 1); /* switch to bss */
+ subseg_set (SEG_BSS, 1); /* switch to bss */
if (bss_align)
frag_align (bss_align, 0);
@@ -1284,7 +1284,7 @@ s_bss ()
*p = 0;
S_SET_SEGMENT (symbolP, SEG_BSS);
- subseg_new (current_seg, current_subseg);
+ subseg_set (current_seg, current_subseg);
}
}
else
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 9bf0dcc..30ef6c4 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -155,7 +155,7 @@ static int prev_prev_insn_unreordered;
#endif
static int insn_uses_reg PARAMS ((struct mips_cl_insn *ip,
- int reg, int fpr));
+ unsigned int reg, int fpr));
static void append_insn PARAMS ((struct mips_cl_insn * ip,
expressionS * p,
bfd_reloc_code_real_type r));
@@ -286,7 +286,7 @@ static bfd_reloc_code_real_type offset_reloc;
void
md_begin ()
{
- register char *retval = NULL;
+ register const char *retval = NULL;
register unsigned int i = 0;
if (mips_isa == -1)
@@ -312,7 +312,7 @@ md_begin ()
{
const char *name = mips_opcodes[i].name;
- retval = hash_insert (op_hash, name, &mips_opcodes[i]);
+ retval = hash_insert (op_hash, name, (PTR) &mips_opcodes[i]);
if (retval != NULL && *retval != '\0')
{
fprintf (stderr, "internal error: can't hash `%s': %s\n",
@@ -392,7 +392,7 @@ md_assemble (str)
static int
insn_uses_reg (ip, reg, fpr)
struct mips_cl_insn *ip;
- int reg;
+ unsigned int reg;
int fpr;
{
/* Don't report on general register 0, since it never changes. */
@@ -409,10 +409,12 @@ insn_uses_reg (ip, reg, fpr)
because there is no instruction that sets both $f0 and $f1
and requires a delay. */
if ((ip->insn_mo->pinfo & INSN_READ_FPR_S)
- && ((ip->insn_opcode >> OP_SH_FS) & OP_MASK_FS) == (reg &~ 1))
+ && (((ip->insn_opcode >> OP_SH_FS) & OP_MASK_FS)
+ == (reg &~ (unsigned) 1)))
return 1;
if ((ip->insn_mo->pinfo & INSN_READ_FPR_T)
- && ((ip->insn_opcode >> OP_SH_FT) & OP_MASK_FT) == (reg &~ 1))
+ && (((ip->insn_opcode >> OP_SH_FT) & OP_MASK_FT)
+ == (reg &~ (unsigned) 1)))
return 1;
}
else
@@ -598,7 +600,7 @@ append_insn (ip, address_expr, reloc_type)
{
assert (S_GET_SEGMENT (insn_label) == now_seg);
insn_label->sy_frag = frag_now;
- S_SET_VALUE (insn_label, frag_now_fix ());
+ S_SET_VALUE (insn_label, (valueT) frag_now_fix ());
}
}
}
@@ -914,7 +916,7 @@ mips_emit_delays ()
{
assert (S_GET_SEGMENT (insn_label) == now_seg);
insn_label->sy_frag = frag_now;
- S_SET_VALUE (insn_label, frag_now_fix ());
+ S_SET_VALUE (insn_label, (valueT) frag_now_fix ());
}
}
mips_no_prev_insn ();
@@ -3196,7 +3198,8 @@ mips_ip (str, ip)
char *save_in;
char *err;
unsigned char temp[8];
- int length;
+ int len;
+ unsigned int length;
segT seg;
subsegT subseg;
char *p;
@@ -3222,7 +3225,8 @@ mips_ip (str, ip)
save_in = input_line_pointer;
input_line_pointer = s;
- err = md_atof (f64 ? 'd' : 'f', (char *) temp, &length);
+ err = md_atof (f64 ? 'd' : 'f', (char *) temp, &len);
+ length = len;
s = input_line_pointer;
input_line_pointer = save_in;
if (err != NULL && *err != '\0')
@@ -3279,7 +3283,7 @@ mips_ip (str, ip)
offset_expr.X_add_number = 0;
/* Put the floating point number into the section. */
- p = frag_more (length);
+ p = frag_more ((int) length);
memcpy (p, temp, length);
/* Switch back to the original section. */
@@ -3835,7 +3839,7 @@ md_apply_fix (fixP, valueP)
return 0;
}
insn |= value & 0xFFFF;
- md_number_to_chars ((char *) buf, insn, 4);
+ md_number_to_chars ((char *) buf, (valueT) insn, 4);
break;
default:
@@ -3956,7 +3960,7 @@ mips_align (to, fill)
{
assert (S_GET_SEGMENT (insn_label) == now_seg);
insn_label->sy_frag = frag_now;
- S_SET_VALUE (insn_label, frag_now_fix ());
+ S_SET_VALUE (insn_label, (valueT) frag_now_fix ());
insn_label = NULL;
}
}
@@ -4035,7 +4039,7 @@ s_change_sec (sec)
switch (sec)
{
case 't':
- s_text ();
+ s_text (0);
break;
case 'r':
#ifdef OBJ_ECOFF
@@ -4046,14 +4050,10 @@ s_change_sec (sec)
/* Fall through. */
#endif
case 'd':
- s_data ();
+ s_data (0);
break;
case 'b':
-#ifdef BFD_ASSEMBLER
subseg_set (bss_section, (subsegT) get_absolute_expression ());
-#else
- subseg_new (bss_section, (subsegT) get_absolute_expression ());
-#endif
demand_empty_rest_of_line ();
break;
case 's':
@@ -4092,7 +4092,7 @@ static void
s_extern (x)
int x;
{
- long size;
+ valueT size;
symbolS *symbolP;
symbolP = get_symbol ();