This set of patches add support for aout emulation on the x86

assembler.  ie. You will be able to do "as --em=i386aout" on an x86
linux-elf assembler to generate aout format object files, rather than
using a separate assembler.  The aout emulation is enabled by giving
"--enable-targets=i386-linuxaout" to configure.
Oh yeah, there's a couple of fixes too.  Error messages shouldn't be
passed to printf in the format arg just in case someone puts a `%' in
the message.
This commit is contained in:
Alan Modra 2000-01-26 22:48:31 +00:00
parent f743149ecb
commit 4c63da97a7
22 changed files with 1132 additions and 687 deletions

View File

@ -1,3 +1,131 @@
2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
* Makefile.am (MULTI_CFILES): Add config/e-i386aout.c
Add dependencies for e-i386aout.o. Fix 2 comment lines.
* Makefile.in: Same here.
Update copyright.
* configure.in: Set bfd_gas for i386-aout when primary target
is bfd. Handle i386aout emulation. Don't use te_file=multi, as
we may need the primary te_file. Remove incorrect comment.
* configure: Regenerate.
* config/e-i386aout.c: New file.
* as.c (USE_EMULATIONS): Move to before print_version_id.
(struct emulation): Add i386aout.
(show_usage): Split text strings. Reformat -a text. Add --em
help.
Update copyright.
* obj.h (struct format_ops): Add s_get_other and s_get_desc.
(aout_format_ops): New.
Update copyright.
* read.c (s_lcomm_internal): Rewrite OBJ_AOUT,OBJ_BOUT
preprocessor conditional and add aout USE_EMULATIONS tests.
(read_a_source_file): Don't pass error strings to printf as
format arg.
Update copyright.
* gasp.c (exp_get_abs): Don't pass error strings to printf as
format arg.
(do_data): Same here.
(process_file): And here.
Update copyright.
* symbols.c (colon): Rewrite "already defined" fatal message
code for aout with USE_EMULATIONS.
Update copyright.
* config/obj-aout.c (OBJ_HEADER): Define.
(obj_pseudo_table): Rename to aout_pseudo_table. Init all
fields of sentinel.
(obj_aout_frob_symbol): Expand S_GET_DESC, S_GET_TYPE,
S_GET_OTHER, S_SET_TYPE macros since we don't need obj-multi
forms here.
(obj_aout_type): Expand S_SET_OTHER here too.
(obj_read_begin_hook): Remove.
(aout_pop_insert): New.
(obj_aout_s_get_other): New.
(obj_aout_s_get_desc): New.
(aout_format_ops): New.
Update copyright.
* config/obj-aout.h (obj_pop_insert): Define so non-multi usage
gets aout_pseudo_table.
(aout_pseudo_table): Declare.
(obj_read_begin_hook): Define.
Update copyright.
* config/obj-coff.c (obj_pseudo_table): Rename to
coff_pseudo_table.
(coff_pop_insert): Use coff_pseudo_table.
(coff_sec_sym_ok_for_reloc): Remove.
(coff_format_ops): Add 0 entries for s_get_size, s_set_size,
and comment all zero entries and remove #if 0 code.
Update copyright.
* config/obj-coff.h (obj_pop_insert): Define.
(coff_pseudo_table): Declare.
Update copyright.
* config/obj-ecoff.c (ecoff_format_ops): Add 0 entries for
s_get_size, s_set_size. Comment all zero entries.
Update copyright.
* config/obj-elf.c (elf_s_get_other): New function.
(obj_read_begin_hook): Rename to elf_obj_read_begin_hook.
(obj_symbol_new_hook): Rename to elf_obj_symbol_new_hook.
(elf_format_ops): Add elf_s_get_other, 0 s_get_size entry, and
comment.
(obj_elf_parse_section_letters): Don't pass error strings to
printf as format arg.
Update copyright.
* config/obj-elf.h (ECOFF_DEBUGGING): Define when
OBJ_MAYBE_ECOFF.
(elf_s_get_other): Declare.
(S_GET_OTHER) Define as elf_s_get_other if not already
defined.
(S_SET_OTHER): Only define when not already defined.
(elf_obj_read_begin_hook): Declare.
(obj_read_begin_hook): Define.
(elf_obj_symbol_new_hook): Declare.
(obj_symbol_new_hook): Define.
Update copyright.
* config/obj-multi.h: Add copyright header and protect against
multiple inclusion. Add * to all function pointers.
(OBJ_HEADER): If defined, include it rather than other defines
in this file.
(obj_frob_file_after_relocs): Test for NULL.
(obj_symbol_new_hook): Here too.
(obj_sec_sym_ok_for_reloc): And here.
(S_GET_OTHER): Define.
(S_GET_DESC): Define.
(ECOFF_DEBUGGING): Remove as it's done in obj-elf.h
(OBJ_MAYBE_ELF): Update comment.
* config/tc-i386.c (i386_immediate): Add OBJ_MAYBE_AOUT to
OBJ_AOUT preprocessor conditional and handle emulation by
testing OUTPUT_FLAVOR.
(i386_displacement): Here too.
(md_section_align): Similarly here.
(i386_target_format): Conditionally compile when more than one
of OBJ_MAYBE_{ELF,COFF,AOUT} defined. Add aout case.
(i386_immediate): Fix error message for aout BFD_ASSMBLER.
(i386_displacement): Here too.
Update copyright.
* config/tc-i386.h (AOUT_TARGET_FORMAT): Define for each TE_*.
Define TARGET_FORMAT for aout only when not multi.
Update copyright.
* config/te-multi.h: Delete file as it's identical to te-generic.h
2000-01-15 Alan Modra <alan@spri.levels.unisa.edu.au>
* config/tc-i386.h (DWORD_MNEM_SUFFIX): Delete.

View File

@ -321,6 +321,7 @@ TARG_ENV_HFILES = \
# Multi files in config
MULTI_CFILES = \
config/e-i386aout.c \
config/e-i386coff.c \
config/e-i386elf.c \
config/e-mipsecoff.c \
@ -508,6 +509,8 @@ e-mipself.o : $(srcdir)/config/e-mipself.c
$(COMPILE) -c $(srcdir)/config/e-mipself.c
e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
$(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
e-i386aout.o: $(srcdir)/config/e-i386aout.c
$(COMPILE) -c $(srcdir)/config/e-i386aout.c
e-i386coff.o: $(srcdir)/config/e-i386coff.c
$(COMPILE) -c $(srcdir)/config/e-i386coff.c
e-i386elf.o: $(srcdir)/config/e-i386elf.c
@ -756,7 +759,7 @@ DEPTC: $(TARGET_CPU_CFILES)
echo 'DEPTC_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> DEPTCA
echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA
echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA
# We don't try to handle all multi cases.
# We don't try to handle all multi cases.
for c in $(CPU_TYPES); do \
$(CPU_MULTI_VALID) \
if [ x$${valid} = xyes ]; then \
@ -803,7 +806,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES)
echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPOBJA
echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA
echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA
# We don't try to handle all multi cases.
# We don't try to handle all multi cases.
for c in $(CPU_TYPES); do \
$(CPU_MULTI_VALID) \
if [ x$${valid} = xyes ]; then \
@ -920,6 +923,8 @@ symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h \
write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
gasp.o: gasp.c sb.h macro.h
itbl-ops.o: itbl-ops.c itbl-ops.h itbl-parse.h
e-i386aout.o: $(srcdir)/config/e-i386aout.c emul.h \
emul-target.h
e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
emul-target.h
e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994-99, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -438,6 +438,7 @@ TARG_ENV_HFILES = \
# Multi files in config
MULTI_CFILES = \
config/e-i386aout.c \
config/e-i386coff.c \
config/e-i386elf.c \
config/e-mipsecoff.c \
@ -2135,6 +2136,8 @@ e-mipself.o : $(srcdir)/config/e-mipself.c
$(COMPILE) -c $(srcdir)/config/e-mipself.c
e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
$(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
e-i386aout.o: $(srcdir)/config/e-i386aout.c
$(COMPILE) -c $(srcdir)/config/e-i386aout.c
e-i386coff.o: $(srcdir)/config/e-i386coff.c
$(COMPILE) -c $(srcdir)/config/e-i386coff.c
e-i386elf.o: $(srcdir)/config/e-i386elf.c
@ -2352,7 +2355,7 @@ DEPTC: $(TARGET_CPU_CFILES)
echo 'DEPTC_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> DEPTCA
echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA
echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA
# We don't try to handle all multi cases.
# We don't try to handle all multi cases.
for c in $(CPU_TYPES); do \
$(CPU_MULTI_VALID) \
if [ x$${valid} = xyes ]; then \
@ -2399,7 +2402,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES)
echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPOBJA
echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA
echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA
# We don't try to handle all multi cases.
# We don't try to handle all multi cases.
for c in $(CPU_TYPES); do \
$(CPU_MULTI_VALID) \
if [ x$${valid} = xyes ]; then \
@ -2516,6 +2519,8 @@ symbols.o: symbols.c $(INCDIR)/obstack.h subsegs.h \
write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h
gasp.o: gasp.c sb.h macro.h
itbl-ops.o: itbl-ops.c itbl-ops.h itbl-parse.h
e-i386aout.o: $(srcdir)/config/e-i386aout.c emul.h \
emul-target.h
e-i386coff.o: $(srcdir)/config/e-i386coff.c emul.h \
emul-target.h
e-i386elf.o: $(srcdir)/config/e-i386elf.c emul.h emul-target.h

215
gas/as.c
View File

@ -1,5 +1,5 @@
/* as.c - GAS main program.
Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1987, 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -111,96 +111,12 @@ struct itbl_file_list
static struct itbl_file_list *itbl_files;
void
print_version_id ()
{
static int printed;
if (printed)
return;
printed = 1;
#ifdef BFD_ASSEMBLER
fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s"),
VERSION, TARGET_ALIAS, BFD_VERSION);
#else
fprintf (stderr, _("GNU assembler version %s (%s)"), VERSION, TARGET_ALIAS);
#endif
fprintf (stderr, "\n");
}
static void
show_usage (stream)
FILE *stream;
{
fprintf (stream, _("Usage: %s [option...] [asmfile...]\n"), myname);
fprintf (stream, _("\
Options:\n\
-a[sub-option...] turn on listings\n\
Sub-options [default hls]:\n\
c omit false conditionals\n\
d omit debugging directives\n\
h include high-level source\n\
l include assembly\n\
m include macro expansions\n\
n omit forms processing\n\
s include symbols\n\
L include line debug statistics (if applicable)\n\
=file set listing file name (must be last sub-option)\n"));
fprintf (stream, _("\
-D produce assembler debugging messages\n\
--defsym SYM=VAL define symbol SYM to given value\n\
-f skip whitespace and comment preprocessing\n\
--gstabs generate stabs debugging information\n\
--gdwarf2 generate DWARF2 debugging information\n\
--help show this message and exit\n\
-I DIR add DIR to search list for .include directives\n\
-J don't warn about signed overflow\n\
-K warn when differences altered for long displacements\n\
-L,--keep-locals keep local symbols (e.g. starting with `L')\n"));
fprintf (stream, _("\
-M,--mri assemble in MRI compatibility mode\n\
--MD FILE write dependency information in FILE (default none)\n\
-nocpp ignored\n\
-o OBJFILE name the object-file output OBJFILE (default a.out)\n\
-R fold data section into text section\n\
--statistics print various measured statistics from execution\n\
--strip-local-absolute strip local absolute symbols\n\
--traditional-format Use same format as native assembler when possible\n\
--version print assembler version number and exit\n\
-W --no-warn suppress warnings\n\
--warn don't suppress warnings\n\
--fatal-warnings treat warnings as errors\n\
--itbl INSTTBL extend instruction set to include instructions\n\
matching the specifications defined in file INSTTBL\n\
-w ignored\n\
-X ignored\n\
-Z generate object file even after errors\n"));
fprintf (stream, _("\
--listing-lhs-width set the width in words of the output data column of\n\
the listing\n\
--listing-lhs-width2 set the width in words of the continuation lines\n\
of the output data column; ignored if smaller than\n\
the width of the first line\n\
--listing-rhs-width set the max width in characters of the lines from\n\
the source file\n\
--listing-cont-lines set the maximum number of continuation lines used\n\
for the output data column of the listing\n"));
md_show_usage (stream);
fprintf (stream, _("\nReport bugs to bug-gnu-utils@gnu.org\n"));
}
#ifdef USE_EMULATIONS
#define EMULATION_ENVIRON "AS_EMULATION"
extern struct emulation mipsbelf, mipslelf, mipself;
extern struct emulation mipsbecoff, mipslecoff, mipsecoff;
extern struct emulation i386coff, i386elf;
extern struct emulation i386coff, i386elf, i386aout;
static struct emulation *const emulations[] = { EMULATIONS };
static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]);
@ -282,6 +198,133 @@ common_emul_init ()
}
#endif
void
print_version_id ()
{
static int printed;
if (printed)
return;
printed = 1;
#ifdef BFD_ASSEMBLER
fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s"),
VERSION, TARGET_ALIAS, BFD_VERSION);
#else
fprintf (stderr, _("GNU assembler version %s (%s)"), VERSION, TARGET_ALIAS);
#endif
fprintf (stderr, "\n");
}
static void
show_usage (stream)
FILE *stream;
{
fprintf (stream, _("Usage: %s [option...] [asmfile...]\n"), myname);
fprintf (stream, _("\
Options:\n\
-a[sub-option...] turn on listings\n\
Sub-options [default hls]:\n\
c omit false conditionals\n\
d omit debugging directives\n\
h include high-level source\n\
l include assembly\n\
m include macro expansions\n\
n omit forms processing\n\
s include symbols\n\
L include line debug statistics (if applicable)\n\
=FILE list to FILE (must be last sub-option)\n"));
fprintf (stream, _("\
-D produce assembler debugging messages\n"));
fprintf (stream, _("\
--defsym SYM=VAL define symbol SYM to given value\n"));
#ifdef USE_EMULATIONS
{
int i;
char *def_em;
fprintf (stream, "\
--em=[");
for (i = 0; i < n_emulations-1; i++)
fprintf (stream, "%s | ", emulations[i]->name);
fprintf (stream, "%s]\n", emulations[i]->name);
def_em = getenv (EMULATION_ENVIRON);
if (!def_em)
def_em = DEFAULT_EMULATION;
fprintf (stream, _("\
emulate output (default %s)\n"), def_em);
}
#endif
fprintf (stream, _("\
-f skip whitespace and comment preprocessing\n"));
fprintf (stream, _("\
--gstabs generate stabs debugging information\n"));
fprintf (stream, _("\
--gdwarf2 generate DWARF2 debugging information\n"));
fprintf (stream, _("\
--help show this message and exit\n"));
fprintf (stream, _("\
-I DIR add DIR to search list for .include directives\n"));
fprintf (stream, _("\
-J don't warn about signed overflow\n"));
fprintf (stream, _("\
-K warn when differences altered for long displacements\n"));
fprintf (stream, _("\
-L,--keep-locals keep local symbols (e.g. starting with `L')\n"));
fprintf (stream, _("\
-M,--mri assemble in MRI compatibility mode\n"));
fprintf (stream, _("\
--MD FILE write dependency information in FILE (default none)\n"));
fprintf (stream, _("\
-nocpp ignored\n"));
fprintf (stream, _("\
-o OBJFILE name the object-file output OBJFILE (default a.out)\n"));
fprintf (stream, _("\
-R fold data section into text section\n"));
fprintf (stream, _("\
--statistics print various measured statistics from execution\n"));
fprintf (stream, _("\
--strip-local-absolute strip local absolute symbols\n"));
fprintf (stream, _("\
--traditional-format Use same format as native assembler when possible\n"));
fprintf (stream, _("\
--version print assembler version number and exit\n"));
fprintf (stream, _("\
-W --no-warn suppress warnings\n"));
fprintf (stream, _("\
--warn don't suppress warnings\n"));
fprintf (stream, _("\
--fatal-warnings treat warnings as errors\n"));
fprintf (stream, _("\
--itbl INSTTBL extend instruction set to include instructions\n\
matching the specifications defined in file INSTTBL\n"));
fprintf (stream, _("\
-w ignored\n"));
fprintf (stream, _("\
-X ignored\n"));
fprintf (stream, _("\
-Z generate object file even after errors\n"));
fprintf (stream, _("\
--listing-lhs-width set the width in words of the output data column of\n\
the listing\n"));
fprintf (stream, _("\
--listing-lhs-width2 set the width in words of the continuation lines\n\
of the output data column; ignored if smaller than\n\
the width of the first line\n"));
fprintf (stream, _("\
--listing-rhs-width set the max width in characters of the lines from\n\
the source file\n"));
fprintf (stream, _("\
--listing-cont-lines set the maximum number of continuation lines used\n\
for the output data column of the listing\n"));
md_show_usage (stream);
fprintf (stream, _("\nReport bugs to bug-gnu-utils@gnu.org\n"));
}
/*
* Since it is easy to do here we interpret the special arg "-"
* to mean "use stdin" and we set that argv[] pointing to "".

17
gas/config/e-i386aout.c Normal file
View File

@ -0,0 +1,17 @@
#include "as.h"
#include "emul.h"
static const char *
i386aout_bfd_name ()
{
abort ();
return NULL;
}
#define emul_bfd_name i386aout_bfd_name
#define emul_format &aout_format_ops
#define emul_name "i386aout"
#define emul_struct_name i386aout
#define emul_default_endian 0
#include "emul-target.h"

View File

@ -1,5 +1,5 @@
/* a.out object file format
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -19,6 +19,8 @@ along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#define OBJ_HEADER "obj-aout.h"
#include "as.h"
#ifdef BFD_ASSEMBLER
#undef NO_RELOC
@ -67,7 +69,7 @@ static void obj_aout_line PARAMS ((int));
static void obj_aout_weak PARAMS ((int));
static void obj_aout_type PARAMS ((int));
const pseudo_typeS obj_pseudo_table[] =
const pseudo_typeS aout_pseudo_table[] =
{
{"line", obj_aout_line, 0}, /* source code line number */
{"ln", obj_aout_line, 0}, /* coff line number that we use anyway */
@ -94,8 +96,8 @@ const pseudo_typeS obj_pseudo_table[] =
/* other stuff */
{"ABORT", s_abort, 0},
{NULL} /* end sentinel */
}; /* obj_pseudo_table */
{NULL, NULL, 0} /* end sentinel */
}; /* aout_pseudo_table */
#ifdef BFD_ASSEMBLER
@ -110,9 +112,9 @@ obj_aout_frob_symbol (sym, punt)
int desc, type, other;
flags = symbol_get_bfdsym (sym)->flags;
desc = S_GET_DESC (sym);
type = S_GET_TYPE (sym);
other = S_GET_OTHER (sym);
desc = aout_symbol (symbol_get_bfdsym (sym))->desc;
type = aout_symbol (symbol_get_bfdsym (sym))->type;
other = aout_symbol (symbol_get_bfdsym (sym))->other;
sec = S_GET_SEGMENT (sym);
/* Only frob simple symbols this way right now. */
@ -187,7 +189,7 @@ obj_aout_frob_symbol (sym, punt)
symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
}
S_SET_TYPE (sym, type);
aout_symbol (symbol_get_bfdsym (sym))->type = type;
/* Double check weak symbols. */
if (S_IS_WEAK (sym))
@ -420,9 +422,17 @@ obj_aout_type (ignore)
{
++input_line_pointer;
if (strncmp (input_line_pointer, "object", 6) == 0)
#ifdef BFD_ASSEMBLER
aout_symbol (symbol_get_bfdsym (sym))->other = 1;
#else
S_SET_OTHER (sym, 1);
#endif
else if (strncmp (input_line_pointer, "function", 8) == 0)
#ifdef BFD_ASSEMBLER
aout_symbol (symbol_get_bfdsym (sym))->other = 2;
#else
S_SET_OTHER (sym, 2);
#endif
}
}
}
@ -431,11 +441,6 @@ obj_aout_type (ignore)
s_ignore (0);
}
void
obj_read_begin_hook ()
{
}
#ifndef BFD_ASSEMBLER
void
@ -630,4 +635,58 @@ DEFUN_VOID (s_sect)
#endif /* ! BFD_ASSEMBLER */
#ifdef BFD_ASSEMBLER
/* Support for an AOUT emulation. */
static void aout_pop_insert PARAMS ((void));
static int obj_aout_s_get_other PARAMS ((symbolS *));
static int obj_aout_s_get_desc PARAMS ((symbolS *));
static void
aout_pop_insert ()
{
pop_insert (aout_pseudo_table);
}
static int
obj_aout_s_get_other (sym)
symbolS *sym;
{
return aout_symbol (symbol_get_bfdsym (sym))->other;
}
static int
obj_aout_s_get_desc (sym)
symbolS *sym;
{
return aout_symbol (symbol_get_bfdsym (sym))->desc;
}
const struct format_ops aout_format_ops =
{
bfd_target_aout_flavour,
1, /* dfl_leading_underscore */
0, /* emit_section_symbols */
obj_aout_frob_symbol,
obj_aout_frob_file,
0, /* frob_file_after_relocs */
0, /* s_get_size */
0, /* s_set_size */
0, /* s_get_align */
0, /* s_set_align */
obj_aout_s_get_other,
obj_aout_s_get_desc,
0, /* copy_symbol_attributes */
0, /* generate_asm_lineno */
0, /* process_stab */
0, /* sec_sym_ok_for_reloc */
aout_pop_insert,
0, /* ecoff_set_ext */
0, /* read_begin_hook */
0 /* symbol_new_hook */
};
#endif BFD_ASSEMBLER
/* end of obj-aout.c */

View File

@ -1,5 +1,5 @@
/* obj-aout.h, a.out object file format for gas, the assembler.
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 1999
Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -51,6 +51,12 @@ extern const segT N_TYPE_seg[];
#endif /* ! BFD_ASSEMBLER */
extern const pseudo_typeS aout_pseudo_table[];
#ifndef obj_pop_insert
#define obj_pop_insert() pop_insert (aout_pseudo_table)
#endif
/* SYMBOL TABLE */
/* Symbol table entry data type */
@ -236,6 +242,7 @@ void tc_aout_fix_to_chars PARAMS ((char *where, struct fix *fixP, relax_addressT
#endif
#define obj_read_begin_hook() {;}
#define obj_symbol_new_hook(s) {;}
#define EMIT_SECTION_SYMBOLS 0

View File

@ -4527,7 +4527,7 @@ adjust_stab_section(abfd, seg)
#endif /* not BFD_ASSEMBLER */
const pseudo_typeS obj_pseudo_table[] =
const pseudo_typeS coff_pseudo_table[] =
{
{"def", obj_coff_def, 0},
{"dim", obj_coff_dim, 0},
@ -4568,58 +4568,42 @@ const pseudo_typeS obj_pseudo_table[] =
{"sdef", obj_coff_def, 0},
#endif
{NULL, NULL, 0} /* end sentinel */
}; /* obj_pseudo_table */
}; /* coff_pseudo_table */
#ifdef BFD_ASSEMBLER
static void coff_pop_insert PARAMS ((void));
static int coff_sec_sym_ok_for_reloc PARAMS ((asection *));
/* Support for a COFF emulation. */
static void coff_pop_insert PARAMS ((void));
static void
coff_pop_insert ()
{
pop_insert (obj_pseudo_table);
}
static int
coff_sec_sym_ok_for_reloc (sec)
asection *sec ATTRIBUTE_UNUSED;
{
return 0;
pop_insert (coff_pseudo_table);
}
const struct format_ops coff_format_ops =
{
bfd_target_coff_flavour,
0,
1,
0, /* dfl_leading_underscore */
1, /* emit_section_symbols */
coff_frob_symbol,
0,
0, /* frob_file */
coff_frob_file_after_relocs,
0, 0,
0, 0,
0,
#if 0
obj_generate_asm_lineno,
#else
0,
#endif
#if 0
obj_stab,
#else
0,
#endif
coff_sec_sym_ok_for_reloc,
0, /* s_get_size */
0, /* s_set_size */
0, /* s_get_align */
0, /* s_set_align */
0, /* s_get_other */
0, /* s_get_desc */
0, /* copy_symbol_attributes */
0, /* generate_asm_lineno */
0, /* process_stab */
0, /* sec_sym_ok_for_reloc */
coff_pop_insert,
#if 0
obj_set_ext,
#else
0,
#endif
0, /* ecoff_set_ext */
coff_obj_read_begin_hook,
coff_obj_symbol_new_hook,
coff_obj_symbol_new_hook
};
#endif

View File

@ -1,5 +1,5 @@
/* coff object file format
Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 1999
Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS.
@ -821,6 +821,12 @@ extern void obj_coff_pe_handle_link_once ();
#endif /* not BFD_ASSEMBLER */
extern const pseudo_typeS coff_pseudo_table[];
#ifndef obj_pop_insert
#define obj_pop_insert() pop_insert (coff_pseudo_table)
#endif
/* In COFF, if a symbol is defined using .def/.val SYM/.endef, it's OK
to redefine the symbol later on. This can happen if C symbols use
a prefix, and a symbol is defined both with and without the prefix,

View File

@ -1,5 +1,6 @@
/* ECOFF object file format.
Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file was put together by Ian Lance Taylor <ian@cygnus.com>.
@ -292,14 +293,18 @@ ecoff_pop_insert ()
const struct format_ops ecoff_format_ops =
{
bfd_target_ecoff_flavour,
0,
1,
0, /* dfl_leading_underscore */
1, /* emit_section_symbols */
obj_ecoff_frob_symbol,
ecoff_frob_file,
0,
0, 0,
0, 0,
0,
0, /* frob_file_after_relocs */
0, /* s_get_size */
0, /* s_set_size */
0, /* s_get_align */
0, /* s_set_align */
0, /* s_get_other */
0, /* s_get_desc */
0, /* copy_symbol_attributes */
ecoff_generate_asm_lineno,
ecoff_stab,
ecoff_sec_sym_ok_for_reloc,

View File

@ -1,5 +1,5 @@
/* ELF object file format
Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -221,6 +221,13 @@ elf_s_set_align (sym, align)
S_SET_ALIGN (sym, align);
}
int
elf_s_get_other (sym)
symbolS *sym;
{
return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other;
}
static void
elf_copy_symbol_attributes (dest, src)
symbolS *dest, *src;
@ -719,7 +726,7 @@ obj_elf_parse_section_letters (str, len)
else
#endif
{
as_warn (bad_msg);
as_warn ("%s", bad_msg);
attr = -1;
}
}
@ -1221,7 +1228,7 @@ obj_elf_vtable_entry (ignore)
}
void
obj_read_begin_hook ()
elf_obj_read_begin_hook ()
{
#ifdef NEED_ECOFF_DEBUG
if (ECOFF_DEBUGGING)
@ -1230,7 +1237,7 @@ obj_read_begin_hook ()
}
void
obj_symbol_new_hook (symbolP)
elf_obj_symbol_new_hook (symbolP)
symbolS *symbolP;
{
struct elf_obj_sy *sy_obj;
@ -1877,28 +1884,30 @@ sco_id ()
const struct format_ops elf_format_ops =
{
bfd_target_elf_flavour,
0,
1,
0, /* dfl_leading_underscore */
1, /* emit_section_symbols */
elf_frob_symbol,
elf_frob_file,
elf_frob_file_after_relocs,
elf_s_get_size, elf_s_set_size,
elf_s_get_align, elf_s_set_align,
elf_s_get_other,
0, /* s_get_desc */
elf_copy_symbol_attributes,
#ifdef NEED_ECOFF_DEBUG
ecoff_generate_asm_lineno,
ecoff_stab,
#else
0,
0, /* process_stab */
0, /* generate_asm_lineno */
0, /* process_stab */
#endif
elf_sec_sym_ok_for_reloc,
elf_pop_insert,
#ifdef NEED_ECOFF_DEBUG
elf_ecoff_set_ext,
#else
0,
0, /* ecoff_set_ext */
#endif
obj_read_begin_hook,
obj_symbol_new_hook,
elf_obj_read_begin_hook,
elf_obj_symbol_new_hook,
};

View File

@ -1,5 +1,5 @@
/* ELF object file format.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -53,6 +53,12 @@ extern int alpha_flag_mdebug;
#endif /* MIPS_STABS_ELF */
#endif /* TC_MIPS */
#ifdef OBJ_MAYBE_ECOFF
#ifndef ECOFF_DEBUGGING
#define ECOFF_DEBUGGING 1
#endif
#endif
/* Additional information we keep for each symbol. */
struct elf_obj_sy
{
@ -106,10 +112,14 @@ extern void elf_begin PARAMS ((void));
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V))
#endif
#define S_GET_OTHER(S) \
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other)
int elf_s_get_other PARAMS ((symbolS *));
#ifndef S_GET_OTHER
#define S_GET_OTHER(S) (elf_s_get_other (S))
#endif
#ifndef S_SET_OTHER
#define S_SET_OTHER(S,V) \
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other = (V))
#endif
extern asection *gdb_section;
@ -141,6 +151,16 @@ extern void obj_elf_text PARAMS ((int));
#define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0)
#endif
void elf_obj_read_begin_hook PARAMS ((void));
#ifndef obj_read_begin_hook
#define obj_read_begin_hook elf_obj_read_begin_hook
#endif
void elf_obj_symbol_new_hook PARAMS ((symbolS *));
#ifndef obj_symbol_new_hook
#define obj_symbol_new_hook elf_obj_symbol_new_hook
#endif
/* When setting one symbol equal to another, by default we probably
want them to have the same "size", whatever it means in the current
context. */

View File

@ -1,4 +1,30 @@
/* hi */
/* Multiple object format emulation.
Copyright (C) 1995, 96, 97, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef _OBJ_MULTI_H
#define _OBJ_MULTI_H
#ifdef OBJ_HEADER
#include OBJ_HEADER
#else
#include "emul.h"
#include "targ-cpu.h"
@ -7,60 +33,72 @@
(this_format->flavor)
#define obj_frob_symbol(S,P) \
(this_format->frob_symbol) (S, &(P))
(*this_format->frob_symbol) (S, &(P))
#define obj_frob_file() \
(this_format->frob_file \
? this_format->frob_file () \
? (*this_format->frob_file) () \
: (void) 0)
#define obj_frob_file_after_relocs \
(this_format->frob_file_after_relocs)
#define obj_frob_file_after_relocs() \
(this_format->frob_file_after_relocs \
? (*this_format->frob_file_after_relocs) () \
: (void) 0)
#define obj_ecoff_set_ext \
(this_format->ecoff_set_ext)
(*this_format->ecoff_set_ext)
#define obj_pop_insert \
(this_format->pop_insert)
(*this_format->pop_insert)
#define obj_read_begin_hook() \
(this_format->read_begin_hook \
? this_format->read_begin_hook () \
? (*this_format->read_begin_hook) () \
: (void) 0)
#define obj_symbol_new_hook \
(this_format->symbol_new_hook)
#define obj_symbol_new_hook(S) \
(this_format->symbol_new_hook \
? (*this_format->symbol_new_hook) (S) \
: (void) 0)
#define obj_sec_sym_ok_for_reloc \
(this_format->sec_sym_ok_for_reloc)
#define obj_sec_sym_ok_for_reloc(A) \
(this_format->sec_sym_ok_for_reloc \
? (*this_format->sec_sym_ok_for_reloc) (A) \
: 0)
#define S_GET_SIZE \
(this_format->s_get_size)
(*this_format->s_get_size)
#define S_SET_SIZE \
(this_format->s_set_size)
(*this_format->s_set_size)
#define S_GET_ALIGN \
(this_format->s_get_align)
(*this_format->s_get_align)
#define S_SET_ALIGN \
(this_format->s_set_align)
(*this_format->s_set_align)
#define S_GET_OTHER \
(*this_format->s_get_other)
#define S_GET_DESC \
(*this_format->s_get_desc)
#define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \
(this_format->copy_symbol_attributes \
? this_format->copy_symbol_attributes (d, s) \
? (*this_format->copy_symbol_attributes) (d, s) \
: (void) 0)
#define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) \
(this_format->process_stab \
? this_format->process_stab (SEG,W,S,T,O,D) \
? (*this_format->process_stab) (SEG,W,S,T,O,D) \
: (void) 0)
#if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS))
#define ECOFF_DEBUGGING 1
#endif
#ifdef OBJ_MAYBE_ELF
/* We need obj-elf for OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined */
/* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c
We also need various STAB defines for stab.c */
#include "obj-elf.h"
#endif
#endif /* !OBJ_HEADER */
#endif /* _OBJ_MULTI_H */

View File

@ -1,5 +1,5 @@
/* i386.c -- Assemble code for the Intel 80386
Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@ -2586,8 +2586,12 @@ i386_immediate (imm_start)
break;
}
}
#ifdef OBJ_AOUT
else if (exp_seg != text_section
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
else if (
#ifdef BFD_ASSEMBLER
OUTPUT_FLAVOR == bfd_target_aout_flavour &&
#endif
exp_seg != text_section
&& exp_seg != data_section
&& exp_seg != bss_section
&& exp_seg != undefined_section
@ -2596,7 +2600,11 @@ i386_immediate (imm_start)
#endif
)
{
#ifdef BFD_ASSEMBLER
as_bad (_("Unimplemented segment %s in operand"), exp_seg->name);
#else
as_bad (_("Unimplemented segment type %d in operand"), exp_seg);
#endif
return 0;
}
#endif
@ -2821,13 +2829,21 @@ i386_displacement (disp_start, disp_end)
if (fits_in_signed_byte (exp->X_add_number))
i.types[this_operand] |= Disp8;
}
#ifdef OBJ_AOUT
else if (exp_seg != text_section
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
else if (
#ifdef BFD_ASSEMBLER
OUTPUT_FLAVOR == bfd_target_aout_flavour &&
#endif
exp_seg != text_section
&& exp_seg != data_section
&& exp_seg != bss_section
&& exp_seg != undefined_section)
{
as_bad (_ ("Unimplemented segment type %d in operand"), exp_seg);
#ifdef BFD_ASSEMBLER
as_bad (_("Unimplemented segment %s in operand"), exp_seg->name);
#else
as_bad (_("Unimplemented segment type %d in operand"), exp_seg);
#endif
return 0;
}
#endif
@ -4206,8 +4222,9 @@ md_show_usage (stream)
}
#ifdef BFD_ASSEMBLER
#ifdef OBJ_MAYBE_ELF
#ifdef OBJ_MAYBE_COFF
#if ((defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_COFF)) \
|| (defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_AOUT)) \
|| (defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)))
/* Pick the target format to use. */
@ -4216,18 +4233,25 @@ i386_target_format ()
{
switch (OUTPUT_FLAVOR)
{
#ifdef OBJ_MAYBE_AOUT
case bfd_target_aout_flavour:
return AOUT_TARGET_FORMAT;
#endif
#ifdef OBJ_MAYBE_COFF
case bfd_target_coff_flavour:
return "coff-i386";
#endif
#ifdef OBJ_MAYBE_ELF
case bfd_target_elf_flavour:
return "elf32-i386";
#endif
default:
abort ();
return NULL;
}
}
#endif /* OBJ_MAYBE_COFF */
#endif /* OBJ_MAYBE_ELF */
#endif /* OBJ_MAYBE_ more than one */
#endif /* BFD_ASSEMBLER */
symbolS *
@ -4257,17 +4281,20 @@ md_section_align (segment, size)
segT segment ATTRIBUTE_UNUSED;
valueT size;
{
#ifdef OBJ_AOUT
#ifdef BFD_ASSEMBLER
/* For a.out, force the section size to be aligned. If we don't do
this, BFD will align it for us, but it will not write out the
final bytes of the section. This may be a bug in BFD, but it is
easier to fix it here since that is how the other a.out targets
work. */
int align;
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
{
/* For a.out, force the section size to be aligned. If we don't do
this, BFD will align it for us, but it will not write out the
final bytes of the section. This may be a bug in BFD, but it is
easier to fix it here since that is how the other a.out targets
work. */
int align;
align = bfd_get_section_alignment (stdoutput, segment);
size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
align = bfd_get_section_alignment (stdoutput, segment);
size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
}
#endif
#endif

View File

@ -1,5 +1,5 @@
/* tc-i386.h -- Header file for tc-i386.c
Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@ -74,35 +74,36 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
#define TARGET_ARCH bfd_arch_i386
#ifdef OBJ_AOUT
#ifdef TE_NetBSD
#define TARGET_FORMAT "a.out-i386-netbsd"
#define AOUT_TARGET_FORMAT "a.out-i386-netbsd"
#endif
#ifdef TE_386BSD
#define TARGET_FORMAT "a.out-i386-bsd"
#define AOUT_TARGET_FORMAT "a.out-i386-bsd"
#endif
#ifdef TE_LINUX
#define TARGET_FORMAT "a.out-i386-linux"
#define AOUT_TARGET_FORMAT "a.out-i386-linux"
#endif
#ifdef TE_Mach
#define TARGET_FORMAT "a.out-mach3"
#define AOUT_TARGET_FORMAT "a.out-mach3"
#endif
#ifdef TE_DYNIX
#define TARGET_FORMAT "a.out-i386-dynix"
#define AOUT_TARGET_FORMAT "a.out-i386-dynix"
#endif
#ifndef TARGET_FORMAT
#define TARGET_FORMAT "a.out-i386"
#ifndef AOUT_TARGET_FORMAT
#define AOUT_TARGET_FORMAT "a.out-i386"
#endif
#endif /* OBJ_AOUT */
#if ((defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_COFF)) \
|| (defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_AOUT)) \
|| (defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)))
extern const char *i386_target_format PARAMS ((void));
#define TARGET_FORMAT i386_target_format ()
#else
#ifdef OBJ_ELF
#define TARGET_FORMAT "elf32-i386"
#endif
#ifdef OBJ_MAYBE_ELF
#ifdef OBJ_MAYBE_COFF
extern const char *i386_target_format PARAMS ((void));
#define TARGET_FORMAT i386_target_format ()
#ifdef OBJ_AOUT
#define TARGET_FORMAT AOUT_TARGET_FORMAT
#endif
#endif

View File

@ -1,22 +0,0 @@
/*
* This file is te-generic.h and is intended to be a template for
* target environment specific header files.
*
* It is my intent that this file will evolve into a file suitable for config,
* compile, and copying as an aid for testing and porting. xoxorich.
*/
/* Added these, because if we don't know what we're targetting we may
need an assembler version of libgcc, and that will use local
labels. */
#define LOCAL_LABELS_DOLLAR 1
#define LOCAL_LABELS_FB 1
/* these define interfaces */
#ifdef OBJ_HEADER
#include OBJ_HEADER
#else
#include "obj-format.h"
#endif
/* end of te-generic.h */

926
gas/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -394,9 +394,10 @@ changequote([,])dnl
*-elf) bfd_gas=yes ;;
*-ecoff) bfd_gas=yes ;;
*-som) bfd_gas=yes ;;
#enable bfd for coff to allow testing if a bfd target is the primary target,
#but not for coff as the primary target
#enable bfd for coff and aout to allow testing if a bfd target is
#the primary target, but not for coff or aout as the primary target
i386-coff) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;;
i386-aout) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;;
*) ;;
esac
@ -501,11 +502,13 @@ changequote([,])dnl
big) emulation="mipsbelf mipslelf mipself" ;;
*) emulation="mipslelf mipsbelf mipself" ;;
esac ;;
i386-*-elf) emulation="i386elf" ;;
# Uncommenting the next line will turn on support for i386 AOUT
# for the default linux configuration
# i386-*-linux*-elf) emulation="i386elf i386aout" ;;
#
i386-*-aout) emulation="i386aout" ;;
i386-*-coff) emulation="i386coff" ;;
# Uncommenting the next line will turn on support for i386 COFF
# in any i386 ELF configuration.
# i386-*-*-elf) emulation="i386elf i386coff" ;;
i386-*-elf) emulation="i386elf" ;;
esac
emulations="$emulations $emulation"
@ -601,6 +604,8 @@ for em in . $emulations ; do
fmt=elf file=mipself ;;
mipsbecoff | mipslecoff)
fmt=ecoff file=mipsecoff ;;
i386aout)
fmt=aout file=i386aout ;;
i386coff)
fmt=coff file=i386coff ;;
i386elf)
@ -637,7 +642,6 @@ if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
# USE_EMULATIONS or include any of the e-files as they will only be bloat.
case "${obj_format}${emfiles}" in
multi* | *mips*)
te_file=multi
extra_objects="$extra_objects $emfiles"
AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;;
esac

View File

@ -1,5 +1,6 @@
/* gasp.c - Gnu assembler preprocessor main program.
Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Copyright (C) 1994, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
@ -893,7 +894,7 @@ exp_get_abs (emsg, idx, in, val)
exp_t res;
idx = exp_parse (idx, in, &res);
if (res.add_symbol.len || res.sub_symbol.len)
ERROR ((stderr, emsg));
ERROR ((stderr, "%s", emsg));
*val = res.value;
return idx;
}
@ -1384,7 +1385,7 @@ do_data (idx, in, size)
idx = exp_parse (idx, in, &e);
exp_string (&e, &acc);
sb_add_char (&acc, 0);
fprintf (outfile, acc.ptr);
fprintf (outfile, "%s", acc.ptr);
if (idx < in->len && in->ptr[idx] == ',')
{
fprintf (outfile, ",");
@ -1922,7 +1923,7 @@ process_file ()
|| line.ptr[0] == '!'))
{
/* MRI line comment. */
fprintf (outfile, sb_name (&line));
fprintf (outfile, "%s", sb_name (&line));
}
else
{

View File

@ -1,7 +1,7 @@
/* obj.h - defines the object dependent hooks for all object
format backends.
Copyright (C) 1987, 90, 91, 92, 93, 95, 96, 97, 1999
Copyright (C) 1987, 90, 91, 92, 93, 95, 96, 97, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -57,6 +57,8 @@ struct format_ops {
void (*s_set_size) PARAMS ((symbolS *, bfd_vma));
bfd_vma (*s_get_align) PARAMS ((symbolS *));
void (*s_set_align) PARAMS ((symbolS *, bfd_vma));
int (*s_get_other) PARAMS ((symbolS *));
int (*s_get_desc) PARAMS ((symbolS *));
void (*copy_symbol_attributes) PARAMS ((symbolS *, symbolS *));
void (*generate_asm_lineno) PARAMS ((void));
void (*process_stab) PARAMS ((segT, int, const char *, int, int, int));
@ -72,6 +74,7 @@ struct format_ops {
extern const struct format_ops elf_format_ops;
extern const struct format_ops ecoff_format_ops;
extern const struct format_ops coff_format_ops;
extern const struct format_ops aout_format_ops;
#ifndef this_format
COMMON const struct format_ops *this_format;

View File

@ -1,5 +1,5 @@
/* read.c - read a source file -
Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1986, 87, 1990-99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -870,7 +870,7 @@ read_a_source_file (name)
if (check_macro (s, &out, '\0', &err))
{
if (err != NULL)
as_bad (err);
as_bad ("%s", err);
*input_line_pointer++ = c;
input_scrub_include_sb (&out,
input_line_pointer);
@ -2057,12 +2057,17 @@ s_lcomm_internal (needs_align, bytes_p)
*p = c;
if (
#if defined(OBJ_AOUT) | defined(OBJ_BOUT)
S_GET_OTHER (symbolP) == 0 &&
S_GET_DESC (symbolP) == 0 &&
#endif /* OBJ_AOUT or OBJ_BOUT */
(S_GET_SEGMENT (symbolP) == bss_seg
|| (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0)))
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT) \
|| defined (OBJ_BOUT) || defined (OBJ_MAYBE_BOUT))
#ifdef BFD_ASSEMBLER
(OUTPUT_FLAVOR != bfd_target_aout_flavour
|| (S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0)) &&
#else
(S_GET_OTHER (symbolP) == 0 && S_GET_DESC (symbolP) == 0) &&
#endif
#endif
(S_GET_SEGMENT (symbolP) == bss_seg
|| (!S_IS_DEFINED (symbolP) && S_GET_VALUE (symbolP) == 0)))
{
char *pfrag;

View File

@ -1,5 +1,5 @@
/* symbols.c -symbol table-
Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -437,18 +437,24 @@ colon (sym_name) /* just seen "x:" - rattle symbols & frags */
}
else
{
#if defined (S_GET_OTHER) && defined (S_GET_DESC)
as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%d.%d.%ld."),
sym_name,
segment_name (S_GET_SEGMENT (symbolP)),
S_GET_OTHER (symbolP), S_GET_DESC (symbolP),
(long) S_GET_VALUE (symbolP));
#if (!defined (OBJ_AOUT) && !defined (OBJ_MAYBE_AOUT) \
&& !defined (OBJ_BOUT) && !defined (OBJ_MAYBE_BOUT))
static const char *od_buf = "";
#else
as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%ld."),
char od_buf[100];
od_buf[0] = '\0';
#ifdef BFD_ASSEMBLER
if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
#endif
sprintf(od_buf, "%d.%d.",
S_GET_OTHER (symbolP),
S_GET_DESC (symbolP));
#endif
as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."),
sym_name,
segment_name (S_GET_SEGMENT (symbolP)),
od_buf,
(long) S_GET_VALUE (symbolP));
#endif
}
} /* if the undefined symbol has no value */
}