This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch]: Make sure that $ characters are prefixed by backslash
- From: "Kai Tietz" <ktietz70 at googlemail dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Sun, 4 Jan 2009 13:57:47 +0100
- Subject: [patch]: Make sure that $ characters are prefixed by backslash
Hi,
in pe.em and pep.em some dollar characters necessary for comments or
to be interpreted by C aren't prefix by a backslash.
ChangeLog
2009-01-04 Kai Tietz <kai.tietz@onevision.com>
* emultempl/pe.em: Prefix dollar characters to be outputed in
generated C file.
* emultempl/pep.em: Likewise.
Is this patch ok for apply?
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: src/ld/emultempl/pe.em
===================================================================
--- src.orig/ld/emultempl/pe.em
+++ src/ld/emultempl/pe.em
@@ -1291,14 +1291,14 @@ gld_${EMULATION_NAME}_after_open (void)
import libraries which are dead code and eliminates them
from the final link. For each exported symbol <sym>, there
is a object file in the import library with a .text section
- and several .idata$* sections. The .text section contains the
+ and several .idata\$* sections. The .text section contains the
symbol definition for <sym> which is a jump stub of the form
- jmp *__imp_<sym>. The .idata$5 contains the symbol definition
+ jmp *__imp_<sym>. The .idata\$5 contains the symbol definition
for __imp_<sym> which is the address of the slot for <sym> in
the import address table. When a symbol is imported explicitly
using __declspec(dllimport) declaration, the compiler generates
a reference to __imp_<sym> which directly resolves to the
- symbol in .idata$5, in which case the jump stub code is not
+ symbol in .idata\$5, in which case the jump stub code is not
needed. The following code tries to identify jump stub sections
in import libraries which are not referred to by anyone and
marks them for exclusion from the final link. */
@@ -1616,7 +1616,7 @@ gld_${EMULATION_NAME}_finish (void)
We use this to put sections in a reasonable place in the file, and
to ensure that they are aligned as required.
- We handle grouped sections here as well. A section named .foo$nn
+ We handle grouped sections here as well. A section named .foo\$nn
goes into the output section .foo. All grouped sections are sorted
by name.
@@ -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;
Index: src/ld/emultempl/pep.em
===================================================================
--- src.orig/ld/emultempl/pep.em
+++ src/ld/emultempl/pep.em
@@ -1411,7 +1411,7 @@ gld_${EMULATION_NAME}_finish (void)
We use this to put sections in a reasonable place in the file, and
to ensure that they are aligned as required.
- We handle grouped sections here as well. A section named .foo$nn
+ We handle grouped sections here as well. A section named .foo\$nn
goes into the output section .foo. All grouped sections are sorted
by name.
@@ -1431,7 +1431,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);
@@ -1540,7 +1540,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)
@@ -1554,7 +1554,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;