(bfd_get_unique_section_name): Put a dot before the numeric suffix.

This commit is contained in:
Alan Modra 2000-09-08 02:11:34 +00:00
parent 6221ac1b93
commit 77cb06e9d4
2 changed files with 156 additions and 151 deletions

View file

@ -1,3 +1,8 @@
2000-09-08 Alan Modra <alan@linuxcare.com.au>
* section.c (bfd_get_unique_section_name): Put a dot before the
numeric suffix.
2000-09-07 Kazu Hirata <kazu@hxi.com> 2000-09-07 Kazu Hirata <kazu@hxi.com>
* doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID.

View file

@ -654,10 +654,10 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
Invent a section name that is unique in @var{abfd} by tacking Invent a section name that is unique in @var{abfd} by tacking
a digit suffix onto the original @var{templat}. If @var{count} a dot and a digit suffix onto the original @var{templat}. If
is non-NULL, then it specifies the first number tried as a @var{count} is non-NULL, then it specifies the first number
suffix to generate a unique name. The value pointed to by tried as a suffix to generate a unique name. The value
@var{count} will be incremented in this case. pointed to by @var{count} will be incremented in this case.
*/ */
char * char *
@ -671,7 +671,7 @@ bfd_get_unique_section_name (abfd, templat, count)
char *sname; char *sname;
len = strlen (templat); len = strlen (templat);
sname = bfd_malloc (len + 7); sname = bfd_malloc (len + 8);
strcpy (sname, templat); strcpy (sname, templat);
num = 1; num = 1;
if (count != NULL) if (count != NULL)
@ -682,7 +682,7 @@ bfd_get_unique_section_name (abfd, templat, count)
/* If we have a million sections, something is badly wrong. */ /* If we have a million sections, something is badly wrong. */
if (num > 999999) if (num > 999999)
abort (); abort ();
sprintf (sname + len, "%d", num++); sprintf (sname + len, ".%d", num++);
} }
while (bfd_get_section_by_name (abfd, sname) != NULL); while (bfd_get_section_by_name (abfd, sname) != NULL);