Change OBJ_COFF checks to check OBJ_XCOFF instead.
(TARGET_FORMAT): Fully parenthesize.
(LEX_QM): Define if TE_PE.
* config/tc-ppc.c: Replace OBJ_COFF by OBJ_XCOFF throughout.
Remove checks of TE_PE within #ifdef OBJ_XCOFF sections.
(init_regtable): Make i unsigned.
(ppc_set_current_section): Rename from setCurrentSection. Change
all callers.
(ppc_arch): Return after as_fatal to avoid gcc warning.
(md_assemble): Only declare reloc if OBJ_ELF. Add default to
switch on fixups[i].reloc to avoid gcc warning.
(IMAGE_SGN_LNK_OTHER): Fix nested comment.
(ppc_pe_function): Don't call ppc_canonicalize_symbol_name.
(ppc_frob_symbol): Remove TE_PE section checks.
(md_estimate_size_before_relax): Return after abort to avoid gcc
warning.
(md_apply_fix3): Add BFD_RELOC_16_GOT_PCREL to switch.
* read.c (LEX_QM): Define as 0 if not defined.
(lex_type): Use LEX_QM for '?'.
Wed Sep 27 12:53:58 1995 Ian Lance Taylor <ian@cygnus.com>
+ * config/tc-ppc.h (OBJ_XCOFF): Define if OBJ_COFF and not TE_PE.
+ Change OBJ_COFF checks to check OBJ_XCOFF instead.
+ (TARGET_FORMAT): Fully parenthesize.
+ (LEX_QM): Define if TE_PE.
+ * config/tc-ppc.c: Replace OBJ_COFF by OBJ_XCOFF throughout.
+ Remove checks of TE_PE within #ifdef OBJ_XCOFF sections.
+ (init_regtable): Make i unsigned.
+ (ppc_set_current_section): Rename from setCurrentSection. Change
+ all callers.
+ (ppc_arch): Return after as_fatal to avoid gcc warning.
+ (md_assemble): Only declare reloc if OBJ_ELF. Add default to
+ switch on fixups[i].reloc to avoid gcc warning.
+ (IMAGE_SGN_LNK_OTHER): Fix nested comment.
+ (ppc_pe_function): Don't call ppc_canonicalize_symbol_name.
+ (ppc_frob_symbol): Remove TE_PE section checks.
+ (md_estimate_size_before_relax): Return after abort to avoid gcc
+ warning.
+ (md_apply_fix3): Add BFD_RELOC_16_GOT_PCREL to switch.
+ * read.c (LEX_QM): Define as 0 if not defined.
+ (lex_type): Use LEX_QM for '?'.
+
* configure.in: No need to check whether ${cpu_type} is powerpc;
it never will be.
* configure: Rebuild.
static int ppc_is_toc_sym PARAMS ((symbolS *sym));
static void ppc_tc PARAMS ((int));
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
static void ppc_comm PARAMS ((int));
static void ppc_bb PARAMS ((int));
static void ppc_bf PARAMS ((int));
#endif
#ifdef TE_PE
+static void ppc_set_current_section PARAMS ((segT));
static void ppc_previous PARAMS ((int));
static void ppc_pdata PARAMS ((int));
static void ppc_ydata PARAMS ((int));
static void ppc_pe_section PARAMS ((int));
static void ppc_pe_section PARAMS ((int));
static void ppc_pe_function PARAMS ((int));
-
-segT ydata_section, pdata_section, reldata_section, rdata_section;
-
#endif
-
\f
/* Generic assembler global variables which must be defined by all
targets. */
/* Pseudo-ops which must be overridden. */
{ "byte", ppc_byte, 0 },
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* Pseudo-ops specific to the RS/6000 XCOFF format. Some of these
legitimately belong in the obj-*.c file. However, XCOFF is based
on COFF, and is only implemented for the RS/6000. We just use
obj-coff.c, and add what we need here. */
-#ifndef TE_PE
{ "comm", ppc_comm, 0 },
{ "lcomm", ppc_comm, 1 },
- { "function", ppc_function, 0 },
-#endif
-
{ "bb", ppc_bb, 0 },
{ "bf", ppc_bf, 0 },
{ "bi", ppc_biei, 0 },
{ "bs", ppc_bs, 0 },
-
-#ifndef TE_PE
{ "csect", ppc_csect, 0 },
-#endif
-
{ "eb", ppc_eb, 0 },
{ "ef", ppc_ef, 0 },
{ "ei", ppc_biei, 1 },
{ "es", ppc_es, 0 },
{ "extern", ppc_extern, 0 },
+ { "function", ppc_function, 0 },
{ "lglobl", ppc_lglobl, 0 },
{ "rename", ppc_rename, 0 },
{ "stabx", ppc_stabx, 0 },
static void
init_regtable ()
{
- int i;
+ unsigned int i;
+
for (i = 0; i < REG_NAME_CNT && pre_defined_registers[i].name ; ++i)
{
insert_reg (pre_defined_registers[i].name,
static flagword ppc_flags = 0;
#endif
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* The RS/6000 assembler uses the .csect pseudo-op to generate code
using a bunch of different sections. These assembler sections,
/* The current csect. */
static symbolS *ppc_current_csect;
-/* The current csect. */
-static segT ppc_previous_section;
-static segT ppc_current_section;
-
-void setCurrentSection(new)
- segT new;
-{
- ppc_previous_section = ppc_current_section;
- ppc_current_section = new;
-}
-
-
/* The RS/6000 assembler uses a TOC which holds addresses of functions
and variables. Symbols are put in the TOC with the .tc pseudo-op.
A special relocation is used when accessing TOC entries. We handle
/* The size of the .debug section. */
static bfd_size_type ppc_debug_name_section_size;
-#endif /* OBJ_COFF */
+#endif /* OBJ_XCOFF */
+
+#ifdef TE_PE
+
+/* Various sections. */
+
+static segT ydata_section, pdata_section, reldata_section, rdata_section;
+
+/* The current section. */
+static segT ppc_previous_section;
+static segT ppc_current_section;
+
+#endif /* TE_PE */
#ifdef OBJ_ELF
symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE" */
else if ((ppc_cpu & PPC_OPCODE_POWER) != 0)
return bfd_arch_rs6000;
else
- as_fatal ("Neither Power nor PowerPC opcodes were selected.");
+ {
+ as_fatal ("Neither Power nor PowerPC opcodes were selected.");
+ return bfd_arch_unknown;
+ }
}
/* This function is called when the assembler starts up. It is called
target_big_endian = PPC_BIG_ENDIAN;
}
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
ppc_coff_debug_section = coff_section_from_bfd_index (stdoutput, N_DEBUG);
/* Create dummy symbols to serve as initial csects. This forces the
int fc;
char *f;
int i;
+#ifdef OBJ_ELF
bfd_reloc_code_real_type reloc;
+#endif
/* Get the opcode. */
for (s = str; *s != '\0' && ! isspace (*s); s++)
#ifdef OBJ_ELF
/* Allow @HA, @L, @H on constants. */
char *orig_str = str;
+
if ((reloc = ppc_elf_suffix (&str)) != BFD_RELOC_UNUSED)
switch (reloc)
{
case BFD_RELOC_HI16_S:
fixP->fx_no_overflow = 1;
break;
+ default:
+ break;
}
}
else
demand_empty_rest_of_line ();
}
\f
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* XCOFF specific pseudo-op handling. */
demand_empty_rest_of_line ();
}
-#endif /* OBJ_COFF */
+#endif /* OBJ_XCOFF */
\f
/* The .tc pseudo-op. This is used when generating either XCOFF or
ELF. This takes two or more arguments.
ppc_tc (ignore)
int ignore;
{
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* Define the TOC symbol name. */
{
ppc_frob_label (sym);
}
-#else /* ! defined (OBJ_COFF) */
+#else /* ! defined (OBJ_XCOFF) */
/* Skip the TOC symbol name. */
while (is_part_of_name (*input_line_pointer)
frag_align (2, 0);
record_alignment (now_seg, 2);
-#endif /* ! defined (OBJ_COFF) */
+#endif /* ! defined (OBJ_XCOFF) */
if (*input_line_pointer != ',')
demand_empty_rest_of_line ();
cons (4);
}
}
-
\f
#ifdef TE_PE
/* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format */
#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 /* Section contains initialized data. */
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 /* Section contains uninitialized data. */
-#define IMAGE_SCN_LNK_OTHER 0x00000100 /* Reserved.
+#define IMAGE_SCN_LNK_OTHER 0x00000100 /* Reserved. */
#define IMAGE_SCN_LNK_INFO 0x00000200 /* Section contains comments or some other type of information. */
#define IMAGE_SCN_LNK_REMOVE 0x00000800 /* Section contents will not become part of image. */
#define IMAGE_SCN_LNK_COMDAT 0x00001000 /* Section contents comdat. */
#define IMAGE_SCN_MEM_READ 0x40000000 /* Section is readable. */
#define IMAGE_SCN_MEM_WRITE 0x80000000 /* Section is writeable. */
+/* Set the current section. */
+
+static void
+ppc_set_current_section (new)
+ segT new;
+{
+ ppc_previous_section = ppc_current_section;
+ ppc_current_section = new;
+}
/* pseudo-op: .previous
behaviour: toggles the current section with the previous section.
subseg_set(ppc_previous_section, 0);
- setCurrentSection(ppc_previous_section);
+ ppc_set_current_section(ppc_previous_section);
}
/* pseudo-op: .pdata
{
pdata_section = subseg_new(".pdata", 0);
}
- setCurrentSection(pdata_section);
+ ppc_set_current_section(pdata_section);
}
/* pseudo-op: .ydata
{
ydata_section = subseg_new (".ydata", 0);
}
- setCurrentSection(ydata_section);
+ ppc_set_current_section(ydata_section);
}
/* pseudo-op: .reldata
{
reldata_section = subseg_new (".reldata", 0);
}
- setCurrentSection(reldata_section);
+ ppc_set_current_section(reldata_section);
}
/* pseudo-op: .rdata
{
rdata_section = subseg_new (".rdata", 0);
}
- setCurrentSection(rdata_section);
+ ppc_set_current_section(rdata_section);
}
/* pseudo-op: .ualong
sec = subseg_new (name, (subsegT) exp);
- setCurrentSection(sec);
+ ppc_set_current_section(sec);
if (flags != SEC_NO_FLAGS)
{
{
char *name;
char endc;
- char *s;
symbolS *ext_sym;
- symbolS *lab_sym;
name = input_line_pointer;
endc = get_symbol_end ();
- /* Ignore any [PR] suffix. */
- name = ppc_canonicalize_symbol_name (name);
- s = strchr (name, '[');
- if (s != (char *) NULL
- && strcmp (s + 1, "PR]") == 0)
- *s = '\0';
-
ext_sym = symbol_find_or_make (name);
*input_line_pointer = endc;
demand_empty_rest_of_line ();
}
-
#endif
-
-
-
\f
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* XCOFF specific symbol and file handling. */
ppc_frob_label (sym)
symbolS *sym;
{
-#ifndef TE_PE
if (ppc_current_csect != (symbolS *) NULL)
{
if (sym->sy_tc.class == -1)
&symbol_lastP);
ppc_current_csect->sy_tc.within = sym;
}
-#endif
}
/* Change the name of a symbol just before writing it out. Set the
}
}
-#ifndef TE_PE
if (! S_IS_EXTERNAL (sym)
&& (sym->bsym->flags & BSF_SECTION_SYM) == 0
&& S_GET_STORAGE_CLASS (sym) != C_FILE
&& S_GET_STORAGE_CLASS (sym) != C_ESTAT
&& S_GET_SEGMENT (sym) != ppc_coff_debug_section)
S_SET_STORAGE_CLASS (sym, C_HIDEXT);
-#endif
if (S_GET_STORAGE_CLASS (sym) == C_EXT
|| S_GET_STORAGE_CLASS (sym) == C_HIDEXT)
}
a->x_csect.x_smtyp = (2 << 3) | XTY_SD;
}
-
-#ifdef TE_PE
- else if (S_GET_SEGMENT (sym) == pdata_section)
- {
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- S_GET_SEGMENT (sym))
- - S_GET_VALUE (sym));
- }
- else if (S_GET_SEGMENT (sym) == rdata_section)
- {
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- S_GET_SEGMENT (sym))
- - S_GET_VALUE (sym));
- }
- else if (S_GET_SEGMENT (sym) == reldata_section)
- {
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- S_GET_SEGMENT (sym))
- - S_GET_VALUE (sym));
- }
-#endif
else
{
-#ifndef TE_PE
symbolS *csect;
/* This is a normal symbol definition. x_scnlen is the
coffsymbol (sym->bsym)->native[i + 1].fix_scnlen = 1;
}
a->x_csect.x_smtyp = XTY_LD;
-#endif
}
a->x_csect.x_parmhash = 0;
ppc_frob_section (sec)
asection *sec;
{
-#ifndef TE_PE
static bfd_size_type vma = 0;
bfd_set_section_vma (stdoutput, sec, vma);
vma += bfd_section_size (stdoutput, sec);
-#endif
}
/* Adjust the file by adding a .debug section if needed. */
}
}
-#endif /* OBJ_COFF */
+#endif /* OBJ_XCOFF */
\f
/* Turn a string in input_line_pointer into a floating point constant
of type type, and store the appropriate bytes in *litp. The number
asection *seg;
{
abort ();
+ return 0;
}
/* Convert a machine dependent frag. We never generate these. */
return fixp->fx_frag->fr_address + fixp->fx_where;
}
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* This is called to see whether a fixup should be adjusted to use a
section symbol. We take the opportunity to change a fixup against
{
valueT val;
-#ifdef TE_PE
- /* FIXME: Certainly the toc stuff gets us into trouble, and should
- not be executed. Not sure about the reloc adjustments. */
- return 0;
-#endif
-
resolve_symbol_value (fix->fx_addsy);
val = S_GET_VALUE (fix->fx_addsy);
if (ppc_toc_csect != (symbolS *) NULL
ppc_is_toc_sym (sym)
symbolS *sym;
{
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
return sym->sy_tc.class == XMC_TC;
#else
return strcmp (segment_name (S_GET_SEGMENT (sym)), ".got") == 0;
operand = &powerpc_operands[opindex];
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
/* It appears that an instruction like
l 9,LC..1(30)
when LC..1 is not a TOC symbol does not generate a reloc. It
case BFD_RELOC_PPC_TOC16:
case BFD_RELOC_16:
case BFD_RELOC_GPREL16:
+ case BFD_RELOC_16_GOT_PCREL:
if (fixp->fx_pcrel)
abort ();
#error PowerPC support requires BFD_ASSEMBLER
#endif
+/* If OBJ_COFF is defined, and TE_PE is not defined, we are assembling
+ XCOFF for AIX. If TE_PE is defined, we are assembling COFF for
+ Windows NT. */
+
+#ifdef OBJ_COFF
+#ifndef TE_PE
+#define OBJ_XCOFF
+#endif
+#endif
+
/* The target BFD architecture. */
#define TARGET_ARCH (ppc_arch ())
extern enum bfd_architecture ppc_arch PARAMS ((void));
/* The target BFD format. */
#ifdef OBJ_COFF
#ifdef TE_PE
-#define TARGET_FORMAT (target_big_endian) ? "pe-powerpc" : "pe-powerpcle"
-#elif defined(PPC)
-#define TARGET_FORMAT (target_big_endian) ? "coff-powerpc" : "coff-powerpcle"
+#define TARGET_FORMAT (target_big_endian ? "pe-powerpc" : "pe-powerpcle")
#else
#define TARGET_FORMAT "aixcoff-rs6000"
#endif
#endif
#ifdef OBJ_ELF
-#define TARGET_FORMAT (target_big_endian) ? "elf32-powerpc" : "elf32-powerpcle"
+#define TARGET_FORMAT (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle")
#endif
/* Permit temporary numeric labels. */
/* When using COFF, we determine whether or not to output a symbol
based on sy_tc.output, not on the name. */
-#ifdef OBJ_COFF
+#ifdef OBJ_XCOFF
#define LOCAL_LABEL(name) 0
#endif
#ifdef OBJ_ELF
/* We set the fx_done field appropriately in md_apply_fix. */
#define TC_HANDLES_FX_DONE
\f
-#ifdef OBJ_COFF
+#ifdef TE_PE
+
+/* Question marks are permitted in symbol names. */
+#define LEX_QM 1
+
+#endif
+
+#ifdef OBJ_XCOFF
/* Declarations needed when generating XCOFF code. XCOFF is an
extension of COFF, used only on the RS/6000. Rather than create an
#define tc_frob_file() ppc_frob_file ()
extern void ppc_frob_file PARAMS ((void));
-#endif /* OBJ_COFF */
+#endif /* OBJ_XCOFF */
#ifdef OBJ_ELF
/* The name of the global offset table generated by the compiler. Allow
#define LEX_PCT 0
#endif
+#ifndef LEX_QM
+/* The PowerPC Windows NT assemblers permits ? inside label names. */
+#define LEX_QM 0
+#endif
+
/* used by is_... macros. our ctype[] */
char lex_type[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ABCDEFGHIJKLMNO */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ[\]^_ */
0, 0, 0, 0, 3, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 0123456789:;<=>? */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, LEX_QM, /* 0123456789:;<=>? */
LEX_AT, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* @ABCDEFGHIJKLMNO */
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, 0, 3, /* PQRSTUVWXYZ[\]^_ */
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* `abcdefghijklmno */
input_scrub_close (); /* Close the input file */
}
+/* For most MRI pseudo-ops, the line actually ends at the first
+ nonquoted space. This function looks for that point, stuffs a null
+ in, and sets *STOPCP to the character that used to be there, and
+ returns the location. */
+
+char *
+mri_comment_field (stopcp)
+ char *stopcp;
+{
+ char *s;
+ int inquote = 0;
+
+ know (flag_mri);
+
+ for (s = input_line_pointer;
+ ((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
+ || inquote);
+ s++)
+ {
+ if (*s == '\'')
+ inquote = ! inquote;
+ }
+ *stopcp = *s;
+ *s = '\0';
+ return s;
+}
+
+/* Skip to the end of an MRI comment field. */
+
+void
+mri_comment_end (stop, stopc)
+ char *stop;
+ int stopc;
+{
+ know (flag_mri);
+
+ input_line_pointer = stop;
+ *stop = stopc;
+ while (! is_end_of_line[(unsigned char) *input_line_pointer])
+ ++input_line_pointer;
+}
+
void
s_abort (ignore)
int ignore;
char temp_fill;
unsigned int i = 0;
unsigned long max_alignment = 1 << 15;
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
if (is_end_of_line[(unsigned char) *input_line_pointer])
temp = arg; /* Default value from pseudo-op table */
else
do_align (temp, (char *) 0);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
register int temp;
char temp_fill;
long max_alignment = 15;
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
temp = get_absolute_expression ();
if (temp > max_alignment)
else
do_align (temp, (char *) 0);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
register char *p;
offsetT temp;
register symbolS *symbolP;
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
name = input_line_pointer;
c = get_symbol_end ();
if (*input_line_pointer != ',')
{
as_bad ("Expected comma after symbol-name: rest of line ignored.");
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
if ((temp = get_absolute_expression ()) < 0)
{
as_warn (".COMMon length (%ld.) <0! Ignored.", (long) temp);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
{
as_bad ("Ignoring attempt to re-define symbol `%s'.",
S_GET_NAME (symbolP));
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
}
#endif /* not OBJ_VMS */
know (symbolP->sy_frag == &zero_address_frag);
+
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
} /* s_comm() */
char *alc = NULL;
symbolS *sym;
offsetT align;
+ char *stop = NULL;
+ char stopc;
if (! flag_mri)
{
return;
}
+ stop = mri_comment_field (&stopc);
+
SKIP_WHITESPACE ();
name = input_line_pointer;
#endif
{
as_bad ("attempt to re-define symbol `%s'", S_GET_NAME (sym));
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
input_line_pointer += 2;
if (*input_line_pointer == ',')
input_line_pointer += 2;
+
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
/* The MRI assembler permits the start symbol to follow .end,
but we don't support that. */
SKIP_WHITESPACE ();
- if (! is_end_of_line[(unsigned char) *input_line_pointer])
+ if (! is_end_of_line[(unsigned char) *input_line_pointer]
+ && *input_line_pointer != '*'
+ && *input_line_pointer != '!')
as_warn ("start address not supported");
}
}
int ignore;
{
offsetT temp;
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
temp = get_absolute_expression ();
if (temp >= 500)
as_warn (".fail %ld encountered", (long) temp);
else
as_bad (".fail %ld encountered", (long) temp);
+
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
char *name;
int c;
symbolS *symbolP;
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
do
{
}
}
while (c == ',');
+
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
md_flush_pending_output ();
#endif
- /* In MRI mode, the operands end at the first unquoted space. */
if (flag_mri)
- {
- char *s;
- int inquote = 0;
-
- for (s = input_line_pointer;
- ((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
- || inquote);
- s++)
- {
- if (*s == '\'')
- inquote = ! inquote;
- }
- stop = s;
- stopc = *stop;
- *stop = '\0';
- }
+ stop = mri_comment_field (&stopc);
/* Just like .fill, but temp_size = 1 */
expression (&exp);
getout:
if (flag_mri)
- {
- input_line_pointer = stop;
- *stop = stopc;
- while (! is_end_of_line[(unsigned char) *input_line_pointer])
- ++input_line_pointer;
- }
+ mri_comment_end (stop, stopc);
demand_empty_rest_of_line ();
}
offsetT count;
int flen;
char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT];
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
count = get_absolute_expression ();
if (*input_line_pointer != ',')
{
as_bad ("missing value");
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
flen = hex_float (float_type, temp);
if (flen < 0)
{
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
if (err)
{
as_bad ("Bad floating literal: %s", err);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
ignore_rest_of_line ();
return;
}
memcpy (p, temp, (unsigned int) flen);
}
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
+
demand_empty_rest_of_line ();
}
s_struct (ignore)
int ignore;
{
+ char *stop = NULL;
+ char stopc;
+
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
abs_section_offset = get_absolute_expression ();
subseg_set (absolute_section, 0);
+ if (flag_mri)
+ mri_comment_end (stop, stopc);
demand_empty_rest_of_line ();
}
md_flush_pending_output ();
#endif
+ if (flag_mri)
+ stop = mri_comment_field (&stopc);
+
if (is_it_end_of_statement ())
{
+ mri_comment_end (stop, stopc);
demand_empty_rest_of_line ();
return;
}
- /* In MRI mode, the operands end at the first unquoted space. */
- if (flag_mri)
- {
- char *s;
- int inquote = 0;
-
- for (s = input_line_pointer;
- ((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
- || inquote);
- s++)
- {
- if (*s == '\'')
- inquote = ! inquote;
- }
- stop = s;
- stopc = *stop;
- *stop = '\0';
- }
-
c = 0;
do
{
emit_expr (&exp, (unsigned int) nbytes);
++c;
}
- while (*input_line_pointer++ == ','
- && (! flag_mri || input_line_pointer < stop));
+ while (*input_line_pointer++ == ',');
/* In MRI mode, after an odd number of bytes, we must align to an
even word boundary, unless the next instruction is a dc.b, ds.b
input_line_pointer--; /* Put terminator back into stream. */
if (flag_mri)
- {
- input_line_pointer = stop;
- *stop = stopc;
- while (! is_end_of_line[(unsigned char) *input_line_pointer])
- ++input_line_pointer;
- }
+ mri_comment_end (stop, stopc);
demand_empty_rest_of_line ();
}
{
register symbolS *symbolP; /* symbol we are working with */
char *stop;
- int stopc;
+ char stopc;
input_line_pointer++;
if (*input_line_pointer == '=')
while (*input_line_pointer == ' ' || *input_line_pointer == '\t')
input_line_pointer++;
- /* In MRI mode, the operands end at the first unquoted space. */
if (flag_mri)
- {
- char *s;
- int inquote = 0;
-
- for (s = input_line_pointer;
- ((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
- || inquote);
- s++)
- {
- if (*s == '\'')
- inquote = ! inquote;
- }
- stop = s;
- stopc = *stop;
- *stop = '\0';
- }
+ stop = mri_comment_field (&stopc);
if (sym_name[0] == '.' && sym_name[1] == '\0')
{
}
if (flag_mri)
- {
- input_line_pointer = stop;
- *stop = stopc;
- while (! is_end_of_line[(unsigned char) *input_line_pointer])
- ++input_line_pointer;
- }
+ mri_comment_end (stop, stopc);
} /* equals() */
/* .include -- include a file at this point. */