X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gas%2Fecoff.c;h=40b129b877f55b7d7079be52a900c43787e82dde;hb=0d18235fb6cefd77bcb3645f3d334802452e693f;hp=d9984ed98c1a4d4e0eee3c53a3d645b2104058f5;hpb=0e389e770d54185d8107db1972d3ae0576d0fa1d;p=binutils-gdb.git diff --git a/gas/ecoff.c b/gas/ecoff.c index d9984ed98c1..40b129b877f 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -1,5 +1,5 @@ /* ECOFF debugging support. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor . A @@ -37,7 +37,7 @@ #include "coff/symconst.h" #include "aout/stab_gnu.h" -#include +#include "safe-ctype.h" /* Why isn't this in coff/sym.h? */ #define ST_RFDESCAPE 0xfff @@ -2037,8 +2037,7 @@ get_tag (tag, sym, basic_type) { char *perm; - perm = xmalloc ((unsigned long) (strlen (tag) + 1)); - strcpy (perm, tag); + perm = xstrdup (tag); hash_ptr = allocate_shash (); err = hash_insert (tag_hash, perm, (char *) hash_ptr); if (err) @@ -2545,8 +2544,8 @@ ecoff_directive_def (ignore) free (coff_sym_name); if (coff_tag != (char *) NULL) free (coff_tag); - coff_sym_name = (char *) xmalloc ((unsigned long) (strlen (name) + 1)); - strcpy (coff_sym_name, name); + + coff_sym_name = xstrdup (name); coff_type = type_info_init; coff_storage_class = sc_Nil; coff_symbol_typ = st_Nil; @@ -2778,8 +2777,7 @@ ecoff_directive_tag (ignore) name = input_line_pointer; name_end = get_symbol_end (); - coff_tag = (char *) xmalloc ((unsigned long) (strlen (name) + 1)); - strcpy (coff_tag, name); + coff_tag = xstrdup (name); *input_line_pointer = name_end; @@ -3101,7 +3099,7 @@ ecoff_directive_ent (ignore) ++input_line_pointer; SKIP_WHITESPACE (); } - if (isdigit ((unsigned char) *input_line_pointer) + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-') (void) get_absolute_expression (); @@ -3378,7 +3376,7 @@ mark_stabs (ignore) /* For TC_MIPS use the version in tc-mips.c. */ void ecoff_directive_weakext (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { char *name; int c; @@ -3546,7 +3544,7 @@ ecoff_stab (sec, what, string, type, other, desc) listing_source_file (string); #endif - if (isdigit ((unsigned char) *input_line_pointer) + if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-' || *input_line_pointer == '+') { @@ -3616,7 +3614,7 @@ ecoff_frob_symbol (sym) { if (S_IS_COMMON (sym) && S_GET_VALUE (sym) > 0 - && S_GET_VALUE (sym) <= (unsigned) bfd_get_gp_size (stdoutput)) + && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput)) { static asection scom_section; static asymbol scom_symbol; @@ -4081,7 +4079,7 @@ ecoff_build_symbols (backend, buf, bufend, offset) s = symbol_get_obj (as_sym)->ecoff_extern_size; if (s == 0 - || s > (unsigned) bfd_get_gp_size (stdoutput)) + || s > bfd_get_gp_size (stdoutput)) sc = sc_Undefined; else { @@ -4096,7 +4094,7 @@ ecoff_build_symbols (backend, buf, bufend, offset) { if (S_GET_VALUE (as_sym) > 0 && (S_GET_VALUE (as_sym) - <= (unsigned) bfd_get_gp_size (stdoutput))) + <= bfd_get_gp_size (stdoutput))) sc = sc_SCommon; else sc = sc_Common;