This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Orphan and --split-by-{file,reloc} section naming


On Thu, 7 Sep 2000, Nick Clifton wrote:

> : Does anyone have any objection to changing the section naming scheme used
> : for orphan sections, and --split-by-{file,reloc}, to include a period
> : before the numeric suffix?  ie. generate foo.1, foo.2 instead of foo1,
> 
> I have no objections.  in fact I like the idea of making these
> sections names follow the same kind of naming scheme as used by other
> "interesting" sections.

OK, here we go.  Committed.

bfd/ChangeLog
	* section.c (bfd_get_unique_section_name): Put a dot before the
	numeric suffix.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.
 

Index: section.c
===================================================================
RCS file: /cvs/src/src/bfd/section.c,v
retrieving revision 1.21
diff -u -p -r1.21 section.c
--- section.c	2000/09/06 00:22:01	1.21
+++ section.c	2000/09/08 01:48:26
@@ -654,10 +654,10 @@ SYNOPSIS
 
 DESCRIPTION
 	Invent a section name that is unique in @var{abfd} by tacking
-	a digit suffix onto the original @var{templat}.  If @var{count}
-	is non-NULL, then it specifies the first number	tried as a
-	suffix to generate a unique name.  The value pointed to by
-	@var{count} will be incremented in this case.
+	a dot and a digit suffix onto the original @var{templat}.  If
+	@var{count} is non-NULL, then it specifies the first number
+	tried as a suffix to generate a unique name.  The value
+	pointed to by @var{count} will be incremented in this case.
 */
 
 char *
@@ -671,7 +671,7 @@ bfd_get_unique_section_name (abfd, templ
   char *sname;
 
   len = strlen (templat);
-  sname = bfd_malloc (len + 7);
+  sname = bfd_malloc (len + 8);
   strcpy (sname, templat);
   num = 1;
   if (count != NULL)
@@ -682,7 +682,7 @@ bfd_get_unique_section_name (abfd, templ
       /* If we have a million sections, something is badly wrong.  */
       if (num > 999999)
 	abort ();
-      sprintf (sname + len, "%d", num++);
+      sprintf (sname + len, ".%d", num++);
     }
   while (bfd_get_section_by_name (abfd, sname) != NULL);
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]