This is the mail archive of the binutils@sourceware.cygnus.com 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]

x86 gas aout emulation support


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.  I haven't enabled the
emulation support automatically for linux-elf yet.

Tested to the point of passing the gas testsuite (except for failures
on elf-only tests with AS_EMULATION={i386coff,i386aout}) using
"configure --host=i586-linux --target=i586-linux \
--enable-targets=i386-linuxaout,i386-coff,m68k-coff,sparc-elf".

The patch also seems to not break the stand-alone x86-linuxaout
assembler.  ie. gas configured with
"configure --host=i586-linux --target=i586-linuxaout"

OK to install?


gas/ChangeLog
	* Makefile.in (MULTI_CFILES): Add config/e-i386aout.c
	Add dependencies for e-i386aout.o.  Fix 2 comment lines.

	* 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.

	* 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. 

	* obj.h (struct format_ops): Add s_get_other and s_get_desc.
	(aout_format_ops): New.

	* read.c (s_lcomm_internal): Rewrite OBJ_AOUT,OBJ_BOUT
	preprocessor conditional and add aout USE_EMULATIONS tests.

	* symbols.c (colon): Rewrite "already defined" fatal message
	code for aout with USE_EMULATIONS.

	* config/obj-aout.c (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_bgein_hook): Remove.
	(aout_pop_insert): New.
	(obj_aout_s_get_other): New.
	(obj_aout_s_get_desc): New.
	(aout_format_ops): New.

	* 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.

	* 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.
	Comment all zero entries and remove #if 0 code.

	* config/obj-coff.h (obj_pop_insert): Define.
	(coff_pseudo_table): Declare.

	* config/obj-ecoff.c (ecoff_format_ops): Add 0 entries for
	s_get_size, s_set_size.  Comment all zero entries.

	* config/obj-elf.c (ecoff_format_ops): Same here.

	* config/obj-elf.h (S_GET_OTHER, S_SET_OTHER): Only define
	when not already defined.

	* config/obj-multi.h: Add * to all function pointers.
	(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.
	Include bfd/libaout.h when OBJ_MAYBE_AOUT

	* 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.

	* config/tc-i386.h (AOUT_TARGET_FORMAT): Define for each TE_*.
	Define TARGET_FORMAT for aout only when not multi.

	* config/te-multi.h: Delete file as it's identical to te-generic.h


Index: gas/Makefile.in
===================================================================
RCS file: /cvs/binutils/binutils/gas/Makefile.in,v
retrieving revision 1.12
diff -c -p -r1.12 Makefile.in
*** Makefile.in	1999/09/04 17:29:21	1.12
--- Makefile.in	2000/01/23 23:49:57
*************** TARG_ENV_HFILES = \
*** 438,443 ****
--- 438,444 ----
  # Multi files in config
  
  MULTI_CFILES = \
+ 	config/e-i386aout.c \
  	config/e-i386coff.c \
  	config/e-i386elf.c \
  	config/e-mipsecoff.c \
*************** e-mipself.o : $(srcdir)/config/e-mipself
*** 2135,2140 ****
--- 2136,2143 ----
  	$(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
*************** DEPTC: $(TARGET_CPU_CFILES)
*** 2352,2358 ****
  	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.
  	for c in $(CPU_TYPES); do \
  	  $(CPU_MULTI_VALID) \
  	  if [ x$${valid} = xyes ]; then \
--- 2355,2361 ----
  	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.
  	for c in $(CPU_TYPES); do \
  	  $(CPU_MULTI_VALID) \
  	  if [ x$${valid} = xyes ]; then \
*************** DEPOBJ: $(OBJ_FORMAT_CFILES)
*** 2399,2405 ****
  	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.
  	for c in $(CPU_TYPES); do \
  	  $(CPU_MULTI_VALID) \
  	  if [ x$${valid} = xyes ]; then \
--- 2402,2408 ----
  	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.
  	for c in $(CPU_TYPES); do \
  	  $(CPU_MULTI_VALID) \
  	  if [ x$${valid} = xyes ]; then \
*************** symbols.o: symbols.c $(INCDIR)/obstack.h
*** 2516,2521 ****
--- 2519,2526 ----
  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
Index: gas/as.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/as.c,v
retrieving revision 1.6
diff -c -p -r1.6 as.c
*** as.c	1999/10/11 04:07:10	1.6
--- as.c	2000/01/23 23:50:02
*************** struct itbl_file_list
*** 111,206 ****
  
  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;
  
  static struct emulation *const emulations[] = { EMULATIONS };
  static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]);
--- 111,122 ----
  
  static struct itbl_file_list *itbl_files;
  
  #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, i386aout;
  
  static struct emulation *const emulations[] = { EMULATIONS };
  static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]);
*************** common_emul_init ()
*** 281,286 ****
--- 197,329 ----
      }
  }
  #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 "-"
Index: gas/configure.in
===================================================================
RCS file: /cvs/binutils/binutils/gas/configure.in,v
retrieving revision 1.14
diff -c -p -r1.14 configure.in
*** configure.in	2000/01/10 19:47:50	1.14
--- configure.in	2000/01/23 23:50:18
*************** changequote([,])dnl
*** 394,402 ****
        *-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
        i386-coff)	if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;;
        *)		;;
      esac
  
--- 394,403 ----
        *-elf)	bfd_gas=yes ;;
        *-ecoff)	bfd_gas=yes ;;
        *-som)	bfd_gas=yes ;;
!     #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
  
*************** changequote([,])dnl
*** 501,511 ****
  			big)	emulation="mipsbelf mipslelf mipself" ;;
  			*)	emulation="mipslelf mipsbelf mipself" ;;
  			esac ;;
-       i386-*-elf)	emulation="i386elf" ;;
-       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" ;;
      esac
  
      emulations="$emulations $emulation"
--- 502,518 ----
  			big)	emulation="mipsbelf mipslelf mipself" ;;
  			*)	emulation="mipslelf mipsbelf mipself" ;;
  			esac ;;
        # Uncommenting the next line will turn on support for i386 COFF
!       # and AOUT in any i386 ELF configuration.
!       # i386-*-*-elf)	emulation="i386elf i386coff i386aout" ;;
!       #
!       # 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" ;;
!       i386-*-elf)	emulation="i386elf" ;;
      esac
  
      emulations="$emulations $emulation"
*************** for em in . $emulations ; do
*** 601,606 ****
--- 608,615 ----
  	fmt=elf   file=mipself ;;
      mipsbecoff | mipslecoff)
  	fmt=ecoff file=mipsecoff ;;
+     i386aout)
+ 	fmt=aout  file=i386aout ;;
      i386coff)
  	fmt=coff  file=i386coff ;;
      i386elf)
*************** if test `set . $emfiles ; shift ; echo $
*** 637,643 ****
    # 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
--- 646,651 ----
Index: gas/obj.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/obj.h,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 obj.h
*** obj.h	1999/05/03 07:28:41	1.1.1.1
--- obj.h	2000/01/23 23:50:19
*************** struct format_ops {
*** 57,62 ****
--- 57,64 ----
    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));
*************** struct format_ops {
*** 72,77 ****
--- 74,80 ----
  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;
Index: gas/read.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/read.c,v
retrieving revision 1.9
diff -c -p -r1.9 read.c
*** read.c	1999/11/03 22:14:47	1.9
--- read.c	2000/01/23 23:50:31
*************** s_lcomm_internal (needs_align, bytes_p)
*** 2057,2068 ****
    *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)))
      {
        char *pfrag;
  
--- 2057,2072 ----
    *p = c;
  
    if (
! #if defined(S_GET_OTHER) && defined(S_GET_DESC)
! #ifdef USE_EMULATIONS
!       (&S_GET_OTHER == 0 || &S_GET_DESC == 0
!        || (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;
  
Index: gas/symbols.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/symbols.c,v
retrieving revision 1.10
diff -c -p -r1.10 symbols.c
*** symbols.c	1999/08/03 15:29:03	1.10
--- symbols.c	2000/01/23 23:50:37
*************** colon (sym_name)		/* just seen "x:" - ra
*** 437,454 ****
  		}
  	      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));
  #else
! 		  as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%ld."),
  			    sym_name,
  			    segment_name (S_GET_SEGMENT (symbolP)),
  			    (long) S_GET_VALUE (symbolP));
- #endif
  		}
  	    }			/* if the undefined symbol has no value */
  	}
--- 437,458 ----
  		}
  	      else
  		{
! #if !defined (S_GET_OTHER) || !defined (S_GET_DESC)
! 		  static const char *od_buf = "";
  #else
! 		  char od_buf[100];
! #ifdef USE_EMULATIONS
! 		  if (&S_GET_OTHER && &S_GET_DESC)
! #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));
  		}
  	    }			/* if the undefined symbol has no value */
  	}
Index: gas/config/e-i386aout.c
===================================================================
RCS file: e-i386aout.c
diff -N e-i386aout.c
*** /dev/null	Tue May  5 13:32:27 1998
--- e-i386aout.c	Sun Jan 23 15:50:37 2000
***************
*** 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"
Index: gas/config/obj-aout.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-aout.c,v
retrieving revision 1.4
diff -c -p -r1.4 obj-aout.c
*** obj-aout.c	1999/06/22 14:32:12	1.4
--- obj-aout.c	2000/01/23 23:50:39
*************** static void obj_aout_line PARAMS ((int))
*** 67,73 ****
  static void obj_aout_weak PARAMS ((int));
  static void obj_aout_type PARAMS ((int));
  
! const pseudo_typeS obj_pseudo_table[] =
  {
    {"line", obj_aout_line, 0},	/* source code line number */
    {"ln", obj_aout_line, 0},	/* coff line number that we use anyway */
--- 67,73 ----
  static void obj_aout_weak PARAMS ((int));
  static void obj_aout_type PARAMS ((int));
  
! 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 */
*************** const pseudo_typeS obj_pseudo_table[] =
*** 94,101 ****
    /* other stuff */
    {"ABORT", s_abort, 0},
  
!   {NULL}			/* end sentinel */
! };				/* obj_pseudo_table */
  
  
  #ifdef BFD_ASSEMBLER
--- 94,101 ----
    /* other stuff */
    {"ABORT", s_abort, 0},
  
!   {NULL, NULL, 0}		/* end sentinel */
! };				/* aout_pseudo_table */
  
  
  #ifdef BFD_ASSEMBLER
*************** obj_aout_frob_symbol (sym, punt)
*** 110,118 ****
    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);
    sec = S_GET_SEGMENT (sym);
  
    /* Only frob simple symbols this way right now.  */
--- 110,118 ----
    int desc, type, other;
  
    flags = symbol_get_bfdsym (sym)->flags;
!   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.  */
*************** obj_aout_frob_symbol (sym, punt)
*** 187,193 ****
        symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
      }
  
!   S_SET_TYPE (sym, type);
  
    /* Double check weak symbols.  */
    if (S_IS_WEAK (sym))
--- 187,193 ----
        symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
      }
  
!   aout_symbol (symbol_get_bfdsym (sym))->type = type;
  
    /* Double check weak symbols.  */
    if (S_IS_WEAK (sym))
*************** obj_aout_type (ignore)
*** 420,428 ****
--- 420,436 ----
  	    {
  	      ++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
  	    }
  	}
      }
*************** obj_aout_type (ignore)
*** 431,441 ****
    s_ignore (0);
  }
  
- void
- obj_read_begin_hook ()
- {
- }
- 
  #ifndef BFD_ASSEMBLER
  
  void
--- 439,444 ----
*************** DEFUN_VOID (s_sect)
*** 629,633 ****
--- 632,690 ----
  }
  
  #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 */
Index: gas/config/obj-aout.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-aout.h,v
retrieving revision 1.2
diff -c -p -r1.2 obj-aout.h
*** obj-aout.h	1999/06/03 00:29:11	1.2
--- obj-aout.h	2000/01/23 23:50:41
*************** extern const segT N_TYPE_seg[];
*** 51,56 ****
--- 51,62 ----
  
  #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 */
  
*************** void tc_aout_fix_to_chars PARAMS ((char 
*** 236,241 ****
--- 242,248 ----
  
  #endif
  
+ #define obj_read_begin_hook()	{;}
  #define obj_symbol_new_hook(s)	{;}
  
  #define EMIT_SECTION_SYMBOLS		0
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-coff.c,v
retrieving revision 1.19
diff -c -p -r1.19 obj-coff.c
*** obj-coff.c	1999/09/12 03:44:41	1.19
--- obj-coff.c	2000/01/23 23:50:52
*************** adjust_stab_section(abfd, seg)
*** 4527,4533 ****
  
  #endif /* not BFD_ASSEMBLER */
  
! const pseudo_typeS obj_pseudo_table[] =
  {
    {"def", obj_coff_def, 0},
    {"dim", obj_coff_dim, 0},
--- 4527,4533 ----
  
  #endif /* not BFD_ASSEMBLER */
  
! const pseudo_typeS coff_pseudo_table[] =
  {
    {"def", obj_coff_def, 0},
    {"dim", obj_coff_dim, 0},
*************** const pseudo_typeS obj_pseudo_table[] =
*** 4568,4625 ****
    {"sdef", obj_coff_def, 0},
  #endif
    {NULL, NULL, 0}		/* end sentinel */
! };				/* obj_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 ()
- {
-   pop_insert (obj_pseudo_table);
- }
- 
- static int
- coff_sec_sym_ok_for_reloc (sec)
-      asection *sec ATTRIBUTE_UNUSED;
  {
!   return 0;
  }
  
  const struct format_ops coff_format_ops =
  {
    bfd_target_coff_flavour,
!   0,
!   1,
    coff_frob_symbol,
!   0,
    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,
    coff_pop_insert,
! #if 0
!   obj_set_ext,
! #else
!   0,
! #endif
    coff_obj_read_begin_hook,
!   coff_obj_symbol_new_hook,
  };
  
  #endif
--- 4568,4609 ----
    {"sdef", obj_coff_def, 0},
  #endif
    {NULL, NULL, 0}		/* end sentinel */
! };				/* coff_pseudo_table */
  
  #ifdef BFD_ASSEMBLER
  
  /* Support for a COFF emulation.  */
  
+ static void coff_pop_insert PARAMS ((void));
+ 
  static void
  coff_pop_insert ()
  {
!   pop_insert (coff_pseudo_table);
  }
  
  const struct format_ops coff_format_ops =
  {
    bfd_target_coff_flavour,
!   0,	/* dfl_leading_underscore */
!   1,	/* emit_section_symbols */
    coff_frob_symbol,
!   0,	/* frob_file */
    coff_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 */
!   0,	/* generate_asm_lineno */
!   0,	/* process_stab */
!   0,	/* sec_sym_ok_for_reloc */
    coff_pop_insert,
!   0,	/* ecoff_set_ext */
    coff_obj_read_begin_hook,
!   coff_obj_symbol_new_hook
  };
  
  #endif
Index: gas/config/obj-coff.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-coff.h,v
retrieving revision 1.3
diff -c -p -r1.3 obj-coff.h
*** obj-coff.h	1999/09/12 03:44:41	1.3
--- obj-coff.h	2000/01/23 23:50:56
*************** extern void obj_coff_pe_handle_link_once
*** 821,826 ****
--- 821,832 ----
  
  #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,
Index: gas/config/obj-ecoff.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-ecoff.c,v
retrieving revision 1.2
diff -c -p -r1.2 obj-ecoff.c
*** obj-ecoff.c	1999/06/22 14:17:52	1.2
--- obj-ecoff.c	2000/01/23 23:50:57
*************** ecoff_pop_insert ()
*** 292,305 ****
  const struct format_ops ecoff_format_ops =
  {
    bfd_target_ecoff_flavour,
!   0,
!   1,
    obj_ecoff_frob_symbol,
    ecoff_frob_file,
!   0,
!   0, 0,
!   0, 0,
!   0,
    ecoff_generate_asm_lineno,
    ecoff_stab,
    ecoff_sec_sym_ok_for_reloc,
--- 292,309 ----
  const struct format_ops ecoff_format_ops =
  {
    bfd_target_ecoff_flavour,
!   0,	/* dfl_leading_underscore */
!   1,	/* emit_section_symbols */
    obj_ecoff_frob_symbol,
    ecoff_frob_file,
!   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,
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-elf.c,v
retrieving revision 1.11
diff -c -p -r1.11 obj-elf.c
*** obj-elf.c	2000/01/03 18:34:24	1.11
--- obj-elf.c	2000/01/23 23:51:02
*************** sco_id ()
*** 1877,1903 ****
  const struct format_ops elf_format_ops =
  {
    bfd_target_elf_flavour,
!   0,
!   1,
    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_copy_symbol_attributes,
  #ifdef NEED_ECOFF_DEBUG
    ecoff_generate_asm_lineno,
    ecoff_stab,
  #else
!   0,
!   0,				/* process_stab */
  #endif
    elf_sec_sym_ok_for_reloc,
    elf_pop_insert,
  #ifdef NEED_ECOFF_DEBUG
    elf_ecoff_set_ext,
  #else
!   0,
  #endif
    obj_read_begin_hook,
    obj_symbol_new_hook,
--- 1877,1905 ----
  const struct format_ops elf_format_ops =
  {
    bfd_target_elf_flavour,
!   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,
+   0,	/* s_get_other */
+   0,	/* s_get_desc */
    elf_copy_symbol_attributes,
  #ifdef NEED_ECOFF_DEBUG
    ecoff_generate_asm_lineno,
    ecoff_stab,
  #else
!   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,	/* ecoff_set_ext */
  #endif
    obj_read_begin_hook,
    obj_symbol_new_hook,
Index: gas/config/obj-elf.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-elf.h,v
retrieving revision 1.4
diff -c -p -r1.4 obj-elf.h
*** obj-elf.h	1999/09/02 15:12:01	1.4
--- obj-elf.h	2000/01/23 23:51:02
*************** extern void elf_begin PARAMS ((void));
*** 106,115 ****
--- 106,119 ----
    (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V))
  #endif
  
+ #ifndef S_GET_OTHER
  #define S_GET_OTHER(S) \
    (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other)
+ #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;
  
Index: gas/config/obj-multi.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-multi.h,v
retrieving revision 1.3
diff -c -p -r1.3 obj-multi.h
*** obj-multi.h	1999/09/02 15:12:01	1.3
--- obj-multi.h	2000/01/23 23:51:02
***************
*** 7,59 ****
  	(this_format->flavor)
  
  #define obj_frob_symbol(S,P)				\
! 	(this_format->frob_symbol) (S, &(P))
  
  #define obj_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_ecoff_set_ext				\
! 	(this_format->ecoff_set_ext)
  
  #define obj_pop_insert					\
! 	(this_format->pop_insert)
  
  #define obj_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_sec_sym_ok_for_reloc			\
! 	(this_format->sec_sym_ok_for_reloc)
  
  #define S_GET_SIZE					\
! 	(this_format->s_get_size)
  
  #define S_SET_SIZE					\
! 	(this_format->s_set_size)
  
  #define S_GET_ALIGN					\
! 	(this_format->s_get_align)
  
  #define S_SET_ALIGN					\
! 	(this_format->s_set_align)
  
  #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s)			\
  	(this_format->copy_symbol_attributes		\
! 	 ? 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)	\
  	 : (void) 0)
  
  #if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS))
--- 7,71 ----
  	(this_format->flavor)
  
  #define obj_frob_symbol(S,P)				\
! 	(*this_format->frob_symbol) (S, &(P))
  
  #define obj_frob_file()					\
  	(this_format->frob_file				\
! 	 ? (*this_format->frob_file) ()			\
  	 : (void) 0)
  
! #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)
  
  #define obj_pop_insert					\
! 	(*this_format->pop_insert)
  
  #define obj_read_begin_hook()				\
  	(this_format->read_begin_hook			\
! 	 ? (*this_format->read_begin_hook) ()		\
  	 : (void) 0)
  
! #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(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)
  
  #define S_SET_SIZE					\
! 	(*this_format->s_set_size)
  
  #define S_GET_ALIGN					\
! 	(*this_format->s_get_align)
  
  #define 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) \
  	 : (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)	\
  	 : (void) 0)
  
  #if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS))
***************
*** 63,66 ****
--- 75,83 ----
  #ifdef OBJ_MAYBE_ELF
  /* We need obj-elf for OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined */
  #include "obj-elf.h"
+ #endif
+ 
+ #ifdef OBJ_MAYBE_AOUT
+ /* We need libaout for aout_symbol macro */
+ #include "bfd/libaout.h"
  #endif
Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-i386.c,v
retrieving revision 1.32
diff -c -p -r1.32 tc-i386.c
*** tc-i386.c	2000/01/15 12:06:02	1.32
--- tc-i386.c	2000/01/23 23:51:15
*************** i386_immediate (imm_start)
*** 2586,2593 ****
  	  break;
  	}
      }
! #ifdef OBJ_AOUT
!   else if (exp_seg != text_section
  	   && exp_seg != data_section
  	   && exp_seg != bss_section
  	   && exp_seg != undefined_section
--- 2586,2597 ----
  	  break;
  	}
      }
! #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
*************** i386_displacement (disp_start, disp_end)
*** 2821,2828 ****
        if (fits_in_signed_byte (exp->X_add_number))
  	i.types[this_operand] |= Disp8;
      }
! #ifdef OBJ_AOUT
!   else if (exp_seg != text_section
  	   && exp_seg != data_section
  	   && exp_seg != bss_section
  	   && exp_seg != undefined_section)
--- 2825,2836 ----
        if (fits_in_signed_byte (exp->X_add_number))
  	i.types[this_operand] |= Disp8;
      }
! #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)
*************** md_show_usage (stream)
*** 4206,4213 ****
  }
  
  #ifdef BFD_ASSEMBLER
! #ifdef OBJ_MAYBE_ELF
! #ifdef OBJ_MAYBE_COFF
  
  /* Pick the target format to use.  */
  
--- 4214,4222 ----
  }
  
  #ifdef BFD_ASSEMBLER
! #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.  */
  
*************** i386_target_format ()
*** 4216,4233 ****
  {
    switch (OUTPUT_FLAVOR)
      {
      case bfd_target_coff_flavour:
        return "coff-i386";
      case bfd_target_elf_flavour:
        return "elf32-i386";
      default:
        abort ();
        return NULL;
      }
  }
  
! #endif /* OBJ_MAYBE_COFF */
! #endif /* OBJ_MAYBE_ELF */
  #endif /* BFD_ASSEMBLER */
  
  symbolS *
--- 4225,4249 ----
  {
    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_ more than one */
  #endif /* BFD_ASSEMBLER */
  
  symbolS *
*************** md_section_align (segment, size)
*** 4257,4273 ****
       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;
  
!   align = bfd_get_section_alignment (stdoutput, segment);
!   size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
  #endif
  #endif
  
--- 4273,4292 ----
       segT segment ATTRIBUTE_UNUSED;
       valueT size;
  {
  #ifdef BFD_ASSEMBLER
! #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));
!     }
  #endif
  #endif
  
Index: gas/config/tc-i386.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-i386.h,v
retrieving revision 1.7
diff -c -p -r1.7 tc-i386.h
*** tc-i386.h	2000/01/15 12:06:02	1.7
--- tc-i386.h	2000/01/23 23:51:17
*************** extern int tc_i386_fix_adjustable PARAMS
*** 74,108 ****
  
  #define TARGET_ARCH		bfd_arch_i386
  
- #ifdef OBJ_AOUT
  #ifdef TE_NetBSD
! #define TARGET_FORMAT		"a.out-i386-netbsd"
  #endif
  #ifdef TE_386BSD
! #define TARGET_FORMAT		"a.out-i386-bsd"
  #endif
  #ifdef TE_LINUX
! #define TARGET_FORMAT		"a.out-i386-linux"
  #endif
  #ifdef TE_Mach
! #define TARGET_FORMAT		"a.out-mach3"
  #endif
  #ifdef TE_DYNIX
! #define TARGET_FORMAT		"a.out-i386-dynix"
  #endif
! #ifndef TARGET_FORMAT
! #define TARGET_FORMAT		"a.out-i386"
  #endif
- #endif /* OBJ_AOUT */
  
  #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 ()
  #endif
  #endif
  
--- 74,109 ----
  
  #define TARGET_ARCH		bfd_arch_i386
  
  #ifdef TE_NetBSD
! #define AOUT_TARGET_FORMAT	"a.out-i386-netbsd"
  #endif
  #ifdef TE_386BSD
! #define AOUT_TARGET_FORMAT	"a.out-i386-bsd"
  #endif
  #ifdef TE_LINUX
! #define AOUT_TARGET_FORMAT	"a.out-i386-linux"
  #endif
  #ifdef TE_Mach
! #define AOUT_TARGET_FORMAT	"a.out-mach3"
  #endif
  #ifdef TE_DYNIX
! #define AOUT_TARGET_FORMAT	"a.out-i386-dynix"
  #endif
! #ifndef AOUT_TARGET_FORMAT
! #define AOUT_TARGET_FORMAT	"a.out-i386"
  #endif
  
+ #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_AOUT
! #define TARGET_FORMAT		AOUT_TARGET_FORMAT
  #endif
  #endif
  
Index: gas/config/te-multi.h
===================================================================
RCS file: te-multi.h
diff -N te-multi.h
*** /sourceware/cvs-tmp/cvsEhhaki	Sun Jan 23 15:51:23 2000
--- /dev/null	Tue May  5 13:32:27 1998
***************
*** 1,22 ****
- /*
-  * 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 */
--- 0 ----



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