Allow individual targets to decide if string escapes should be allowed. Disable for PPC and Z80.
PR 25311 * as.h (TC_STRING_ESCAPES): Provide a default definition. * app.c (do_scrub_chars): Use TC_STRING_ESCAPES instead of NO_STRING_ESCAPES. * read.c (next_char_of_string): Likewise. * config/tc-ppc.h (TC_STRING_ESCAPES): Define. * config/tc-z80.h (TC_STRING_ESCAPES): Define.
This commit is contained in:
parent
f2a3559d54
commit
16d8767399
|
@ -1,3 +1,13 @@
|
||||||
|
2020-01-03 Sergey Belyashov <sergey.belyashov@gmail.com>
|
||||||
|
|
||||||
|
PR 25311
|
||||||
|
* as.h (TC_STRING_ESCAPES): Provide a default definition.
|
||||||
|
* app.c (do_scrub_chars): Use TC_STRING_ESCAPES instead of
|
||||||
|
NO_STRING_ESCAPES.
|
||||||
|
* read.c (next_char_of_string): Likewise.
|
||||||
|
* config/tc-ppc.h (TC_STRING_ESCAPES): Define.
|
||||||
|
* config/tc-z80.h (TC_STRING_ESCAPES): Define.
|
||||||
|
|
||||||
2020-01-03 Nick Clifton <nickc@redhat.com>
|
2020-01-03 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* po/sv.po: Updated Swedish translation.
|
* po/sv.po: Updated Swedish translation.
|
||||||
|
|
|
@ -602,13 +602,11 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
|
||||||
state = old_state;
|
state = old_state;
|
||||||
PUT (ch);
|
PUT (ch);
|
||||||
}
|
}
|
||||||
#ifndef NO_STRING_ESCAPES
|
else if (TC_STRING_ESCAPES && ch == '\\')
|
||||||
else if (ch == '\\')
|
|
||||||
{
|
{
|
||||||
state = 6;
|
state = 6;
|
||||||
PUT (ch);
|
PUT (ch);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (scrub_m68k_mri && ch == '\n')
|
else if (scrub_m68k_mri && ch == '\n')
|
||||||
{
|
{
|
||||||
/* Just quietly terminate the string. This permits lines like
|
/* Just quietly terminate the string. This permits lines like
|
||||||
|
|
4
gas/as.h
4
gas/as.h
|
@ -588,6 +588,10 @@ COMMON int flag_m68k_mri;
|
||||||
#define flag_m68k_mri 0
|
#define flag_m68k_mri 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TC_STRING_ESCAPES
|
||||||
|
#define TC_STRING_ESCAPES 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WARN_COMMENTS
|
#ifdef WARN_COMMENTS
|
||||||
COMMON int warn_comment;
|
COMMON int warn_comment;
|
||||||
COMMON unsigned int found_comment;
|
COMMON unsigned int found_comment;
|
||||||
|
|
|
@ -61,7 +61,7 @@ extern const char *ppc_target_format (void);
|
||||||
|
|
||||||
/* Strings do not use backslash escapes under COFF. */
|
/* Strings do not use backslash escapes under COFF. */
|
||||||
#ifdef OBJ_COFF
|
#ifdef OBJ_COFF
|
||||||
#define NO_STRING_ESCAPES
|
#define TC_STRING_ESCAPES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OBJ_ELF
|
#ifdef OBJ_ELF
|
||||||
|
|
|
@ -96,6 +96,7 @@ extern void z80_cons_fix_new (fragS *, int, int, expressionS *);
|
||||||
/* We allow single quotes to delimit character constants as
|
/* We allow single quotes to delimit character constants as
|
||||||
well, but it is cleaner to handle that in tc-z80.c. */
|
well, but it is cleaner to handle that in tc-z80.c. */
|
||||||
#define SINGLE_QUOTE_STRINGS
|
#define SINGLE_QUOTE_STRINGS
|
||||||
|
#define TC_STRING_ESCAPES 0
|
||||||
|
|
||||||
/* An `.lcomm' directive with no explicit alignment parameter will
|
/* An `.lcomm' directive with no explicit alignment parameter will
|
||||||
use this macro to set P2VAR to the alignment that a request for
|
use this macro to set P2VAR to the alignment that a request for
|
||||||
|
|
|
@ -5435,8 +5435,9 @@ next_char_of_string (void)
|
||||||
bump_line_counters ();
|
bump_line_counters ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef NO_STRING_ESCAPES
|
|
||||||
case '\\':
|
case '\\':
|
||||||
|
if (!TC_STRING_ESCAPES)
|
||||||
|
break;
|
||||||
switch (c = *input_line_pointer++ & CHAR_MASK)
|
switch (c = *input_line_pointer++ & CHAR_MASK)
|
||||||
{
|
{
|
||||||
case 'b':
|
case 'b':
|
||||||
|
@ -5538,7 +5539,6 @@ next_char_of_string (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* ! defined (NO_STRING_ESCAPES) */
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -8,7 +8,7 @@ Contents of section \.data:
|
||||||
0010 44454642 20746578 745c6e64 38373833.*
|
0010 44454642 20746578 745c6e64 38373833.*
|
||||||
0020 4445464d 20746578 745c6e33 37383537.*
|
0020 4445464d 20746578 745c6e33 37383537.*
|
||||||
0030 44422074 6578745c 6e333837 39383337.*
|
0030 44422074 6578745c 6e333837 39383337.*
|
||||||
0040 2e617363 69692074 6578743a bf0c0a00.*
|
0040 2e617363 69692074 6578745c 37325c32.*
|
||||||
0050 2e617363 697a2074 6578740a 39393900.*
|
0050 37375c66 5c6e5c30 2e617363 697a2074.*
|
||||||
0060 2e737472 696e6720 74657874 0a090000.*
|
0060 6578745c 6e393939 002e7374 72696e67.*
|
||||||
#pass
|
#pass
|
||||||
|
|
Loading…
Reference in New Issue