diff options
author | Nick Clifton <nickc@redhat.com> | 2006-09-28 12:59:25 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2006-09-28 12:59:25 +0000 |
commit | ea9986ff0085095cd23ec95dc0e42177c062e117 (patch) | |
tree | 82db9fd23cc38c85fa029aaf30bbf5196b9ed5e1 /binutils | |
parent | 2642de2a6c63f6a5710395e0ab502d6929d2ffd6 (diff) | |
download | gdb-ea9986ff0085095cd23ec95dc0e42177c062e117.zip gdb-ea9986ff0085095cd23ec95dc0e42177c062e117.tar.gz gdb-ea9986ff0085095cd23ec95dc0e42177c062e117.tar.bz2 |
* bfd-in.h (CONST_STRNCPY) : Delete.
(LITSTRCPY) : New.
(LITMEMCPY) : New.
* bfd-in2.h : Regenerate.
* elflink.c (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually calculate string lengths.
* nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY.
* nlmconv.c (main) : Use LITMEMCPY.
* prdbg.c (tg_class_static_member) : Use LITSTRCPY.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 5 | ||||
-rw-r--r-- | binutils/nlmconv.c | 18 | ||||
-rw-r--r-- | binutils/prdbg.c | 10 |
3 files changed, 18 insertions, 15 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f336b57..812afc2 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2006-09-25 Pedro Alves <pedro_alves@portugalmail.pt> + + * nlmconv.c (main) : Use LITMEMCPY. + * prdbg.c (tg_class_static_member) : Use LITSTRCPY. + 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3257 diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c index 6159dc9..6b8db6d 100644 --- a/binutils/nlmconv.c +++ b/binutils/nlmconv.c @@ -737,7 +737,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, help_section, SEC_HAS_CONTENTS)) bfd_fatal (_("help section")); - CONST_STRNCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (message_file != NULL) @@ -759,7 +759,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, message_section, SEC_HAS_CONTENTS)) bfd_fatal (_("message section")); - CONST_STRNCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (modules != NULL) @@ -795,7 +795,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, rpc_section, SEC_HAS_CONTENTS)) bfd_fatal (_("rpc section")); - CONST_STRNCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } if (sharelib_file != NULL) @@ -852,7 +852,7 @@ main (int argc, char **argv) || ! bfd_set_section_flags (outbfd, shared_section, SEC_HAS_CONTENTS)) bfd_fatal (_("shared section")); - CONST_STRNCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); } } } @@ -863,9 +863,9 @@ main (int argc, char **argv) /* At least for now, always create an extended header, because that is what NLMLINK does. */ - CONST_STRNCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); + LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs"); - CONST_STRNCPY (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx"); + LITMEMCPY (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx"); /* If the date was not given, force it in. */ if (nlm_version_header (outbfd)->month == 0 @@ -880,7 +880,7 @@ main (int argc, char **argv) nlm_version_header (outbfd)->month = ptm->tm_mon + 1; nlm_version_header (outbfd)->day = ptm->tm_mday; nlm_version_header (outbfd)->year = ptm->tm_year + 1900; - CONST_STRNCPY (version_hdr->stamp, "VeRsIoN#"); + LITMEMCPY (version_hdr->stamp, "VeRsIoN#"); } #ifdef NLMCONV_POWERPC @@ -1747,9 +1747,9 @@ powerpc_build_stubs (bfd *inbfd, bfd *outbfd ATTRIBUTE_UNUSED, /* Make a new undefined symbol with the same name but without the leading `.'. */ - newsym = (asymbol *) xmalloc (sizeof (asymbol)); + newsym = xmalloc (sizeof (asymbol)); *newsym = *sym; - newname = (char *) xmalloc (strlen (bfd_asymbol_name (sym))); + newname = xmalloc (strlen (bfd_asymbol_name (sym))); strcpy (newname, bfd_asymbol_name (sym) + 1); newsym->name = newname; diff --git a/binutils/prdbg.c b/binutils/prdbg.c index 5b89595..7a0af83 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -724,8 +724,8 @@ pr_function_type (void *p, int argcount, bfd_boolean varargs) /* Now the return type is on the top of the stack. */ - s = (char *) xmalloc (len); - strcpy (s, "(|) ("); + s = xmalloc (len); + LITSTRCPY (s, "(|) ("); if (argcount < 0) strcat (s, "/* unknown */"); @@ -2153,12 +2153,10 @@ tg_class_static_member (void *p, const char *name, len_var = strlen (name); len_class = strlen (info->stack->next->type); - full_name = (char *) xmalloc (len_var + len_class + 3); + full_name = xmalloc (len_var + len_class + 3); if (! full_name) return FALSE; - memcpy (full_name, info->stack->next->type, len_class); - memcpy (full_name + len_class, STRING_COMMA_LEN ("::")); - memcpy (full_name + len_class + 2, name, len_var + 1); + sprintf (full_name, "%s::%s", info->stack->next->type, name); if (! substitute_type (info, full_name)) return FALSE; |