This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: [patch]: Make sure that $ characters are prefixed by backslash


Kai Tietz wrote:
>
> Thanks for catching this.
> Updated patch ok for apply?

  Also, I think you don't need to escape the ones inside single-quotes:

@@ -1636,7 +1636,7 @@ gld_${EMULATION_NAME}_place_orphan (asec

   /* Look through the script to see where to place this section.  */
   if (!link_info.relocatable
-      && (dollar = strchr (secname, '$')) != NULL)
+      && (dollar = strchr (secname, '\$')) != NULL)
     {
       size_t len = dollar - secname;
       char *newname = xmalloc (len + 1);
@@ -1745,7 +1745,7 @@ gld_${EMULATION_NAME}_place_orphan (asec
       {
 	bfd_boolean found_dollar;

-	/* The section name has a '$'.  Sort it with the other '$'
+	/* The section name has a '\$'.  Sort it with the other '\$'
 	   sections.  */
 	found_dollar = FALSE;
 	for ( ; *pl != NULL; pl = &(*pl)->header.next)
@@ -1759,7 +1759,7 @@ gld_${EMULATION_NAME}_place_orphan (asec
 	    ls = &(*pl)->input_section;

 	    lname = bfd_get_section_name (ls->section->owner, ls->section);
-	    if (strchr (lname, '$') == NULL)
+	    if (strchr (lname, '\$') == NULL)
 	      {
 		if (found_dollar)
 		  break;

  AFAICT, these ones are superfluous.  The $ comes out fine in the generated
ei386pe.c - have you verified your patch by diffing the generated files from
before and after your patch to the source .em file?

    cheers,
      DaveK


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