diff options
133 files changed, 293 insertions, 19086 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 83f90af..116a977 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,143 @@ +2005-08-11 Alan Modra <amodra@bigpond.net.au> + + * README-vms: Delete. + * config-gas.com: Delete. + * makefile.vms: Delete. + * vmsconf.sh: Delete. + * config/atof-tahoe.c: Delete. + * config/m88k-opcode.h: Delete. + * config/obj-bout.c: Delete. + * config/obj-bout.h: Delete. + * config/obj-hp300.c: Delete. + * config/obj-hp300.h: Delete. + * config/tc-a29k.c: Delete. + * config/tc-a29k.h: Delete. + * config/tc-h8500.c: Delete. + * config/tc-h8500.h: Delete. + * config/tc-m88k.c: Delete. + * config/tc-m88k.h: Delete. + * config/tc-tahoe.c: Delete. + * config/tc-tahoe.h: Delete. + * config/tc-tic80.c: Delete. + * config/tc-tic80.h: Delete. + * config/tc-w65.c: Delete. + * config/tc-w65.h: Delete. + * config/te-aux.h: Delete. + * config/te-delt88.h: Delete. + * config/te-delta.h: Delete. + * config/te-dpx2.h: Delete. + * config/te-hp300.h: Delete. + * config/te-ic960.h: Delete. + * config/vms-a-conf.h: Delete. + * doc/c-a29k.texi: Delete. + * doc/c-h8500.texi: Delete. + * doc/c-m88k.texi: Delete. + * README: Remove obsolete examples, and list of supported targets. + * Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65, + bout and hp300 support. + (DEP_FLAGS): Don't define BFD_ASSEMBLER. + * configure.in: Remove --enable-bfd-assembler, need_bfd, + primary_bfd_gas. + * configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf, + m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy. + * as.c: Remove all non-BFD_ASSEMBLER code, support for above targets. + * as.h: Likewise. + * dw2gencfi.c: Likewise. + * dwarf2dbg.c: Likewise. + * ehopt.c: Likewise. + * input-file.c: Likewise. + * listing.c: Likewise. + * literal.c: Likewise. + * messages.c: Likewise. + * obj.h: Likewise. + * output-file.c: Likewise. + * read.c: Likewise. + * stabs.c: Likewise. + * struc-symbol.h: Likewise. + * subsegs.c: Likewise. + * subsegs.h: Likewise. + * symbols.c: Likewise. + * symbols.h: Likewise. + * tc.h: Likewise. + * write.c: Likewise. + * write.h: Likewise. + * config/aout_gnu.h: Likewise. + * config/obj-aout.c: Likewise. + * config/obj-aout.h: Likewise. + * config/obj-coff.c: Likewise. + * config/obj-coff.h: Likewise. + * config/obj-evax.h: Likewise. + * config/obj-ieee.h: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-arm.h: Likewise. + * config/tc-avr.c: Likewise. + * config/tc-avr.h: Likewise. + * config/tc-crx.h: Likewise. + * config/tc-d10v.h: Likewise. + * config/tc-d30v.h: Likewise. + * config/tc-dlx.h: Likewise. + * config/tc-fr30.h: Likewise. + * config/tc-frv.h: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8300.h: Likewise. + * config/tc-hppa.h: Likewise. + * config/tc-i370.h: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-i386.h: Likewise. + * config/tc-i860.h: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-i960.h: Likewise. + * config/tc-ip2k.h: Likewise. + * config/tc-iq2000.h: Likewise. + * config/tc-m32c.h: Likewise. + * config/tc-m32r.h: Likewise. + * config/tc-m68hc11.h: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-m68k.h: Likewise. + * config/tc-maxq.c: Likewise. + * config/tc-maxq.h: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mcore.h: Likewise. + * config/tc-mn10200.h: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-mn10300.h: Likewise. + * config/tc-ms1.h: Likewise. + * config/tc-msp430.c: Likewise. + * config/tc-msp430.h: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-ns32k.h: Likewise. + * config/tc-openrisc.h: Likewise. + * config/tc-or32.c: Likewise. + * config/tc-or32.h: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-ppc.h: Likewise. + * config/tc-s390.h: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh.h: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-tic30.h: Likewise. + * config/tc-tic4x.c: Likewise. + * config/tc-tic4x.h: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-tic54x.h: Likewise. + * config/tc-v850.h: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-vax.h: Likewise. + * config/tc-xstormy16.h: Likewise. + * config/tc-xtensa.h: Likewise. + * config/tc-z8k.c: Likewise. + * config/tc-z8k.h: Likewise. + * config/vms-a-conf.h + * doc/Makefile.am: Likewise. + * doc/all.texi: Likewise. + * doc/as.texinfo: Likewise. + * doc/Makefile.in: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + * config.in: Regenerate. + * po/POTFILES.in: Regenerate. + 2005-08-09 Nick Clifton <nickc@redhat.com> PR 1070 diff --git a/gas/Makefile.am b/gas/Makefile.am index b4ae195..aec4ac9 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -41,7 +41,6 @@ IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o # CPU types. This is only used for dependency information. CPU_TYPES = \ - a29k \ alpha \ arc \ arm \ @@ -54,7 +53,6 @@ CPU_TYPES = \ fr30 \ frv \ h8300 \ - h8500 \ hppa \ ia64 \ i370 \ @@ -66,7 +64,6 @@ CPU_TYPES = \ m32r \ m68hc11 \ m68k \ - m88k \ mcore \ mips \ mmix \ @@ -83,13 +80,10 @@ CPU_TYPES = \ sh \ sh64 \ sparc \ - tahoe \ tic30 \ tic4x \ tic54x \ - tic80 \ vax \ - w65 \ v850 \ xstormy16 \ xtensa \ @@ -100,12 +94,10 @@ CPU_TYPES = \ OBJ_FORMATS = \ aout \ - bout \ coff \ ecoff \ elf \ evax \ - hp300 \ ieee \ vms @@ -119,13 +111,9 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ + arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - bout) \ - case $$c in \ - i960) valid=yes ;; \ - esac ;; \ coff) valid=yes; \ case $$c in \ cris | i860 | mmix | sh64) \ @@ -140,10 +128,6 @@ CPU_OBJ_VALID = \ case $$c in \ alpha) valid=yes ;; \ esac ;; \ - hp300) \ - case $$c in \ - m68k) valid=yes ;; \ - esac ;; \ vms) \ case $$c in \ vax) valid=yes ;; \ @@ -239,7 +223,6 @@ HFILES = \ # CPU files in config. TARGET_CPU_CFILES = \ - config/tc-a29k.c \ config/tc-alpha.c \ config/tc-arc.c \ config/tc-arm.c \ @@ -252,7 +235,6 @@ TARGET_CPU_CFILES = \ config/tc-fr30.c \ config/tc-frv.c \ config/tc-h8300.c \ - config/tc-h8500.c \ config/tc-hppa.c \ config/tc-ia64.c \ config/tc-i370.c \ @@ -264,7 +246,6 @@ TARGET_CPU_CFILES = \ config/tc-m32r.c \ config/tc-m68hc11.c \ config/tc-m68k.c \ - config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ config/tc-mmix.c \ @@ -281,19 +262,15 @@ TARGET_CPU_CFILES = \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ - config/tc-tahoe.c \ config/tc-tic30.c \ config/tc-tic54x.c \ - config/tc-tic80.c \ config/tc-vax.c \ - config/tc-w65.c \ config/tc-v850.c \ config/tc-xstormy16.c \ config/tc-xtensa.c \ config/tc-z8k.c TARGET_CPU_HFILES = \ - config/tc-a29k.h \ config/tc-alpha.h \ config/tc-arc.h \ config/tc-arm.h \ @@ -306,7 +283,6 @@ TARGET_CPU_HFILES = \ config/tc-fr30.h \ config/tc-frv.h \ config/tc-h8300.h \ - config/tc-h8500.h \ config/tc-hppa.h \ config/tc-ia64.h \ config/tc-i370.h \ @@ -318,7 +294,6 @@ TARGET_CPU_HFILES = \ config/tc-m32r.h \ config/tc-m68hc11.h \ config/tc-m68k.h \ - config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ config/tc-mmix.h \ @@ -335,12 +310,9 @@ TARGET_CPU_HFILES = \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ - config/tc-tahoe.h \ config/tc-tic30.h \ config/tc-tic54x.h \ - config/tc-tic80.h \ config/tc-vax.h \ - config/tc-w65.h \ config/tc-v850.h \ config/tc-xstormy16.h \ config/tc-xtensa.h \ @@ -350,23 +322,19 @@ TARGET_CPU_HFILES = \ OBJ_FORMAT_CFILES = \ config/obj-aout.c \ - config/obj-bout.c \ config/obj-coff.c \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-hp300.c \ config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ config/obj-aout.h \ - config/obj-bout.h \ config/obj-coff.h \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-hp300.h \ config/obj-ieee.h \ config/obj-som.h @@ -383,7 +351,6 @@ TARG_ENV_HFILES = \ config/te-epoc-pe.h \ config/te-generic.h \ config/te-go32.h \ - config/te-hp300.h \ config/te-hppa.h \ config/te-hppa64.h \ config/te-hppalinux64.h \ @@ -501,7 +468,7 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) # in a subdirectory. DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" -DEP_FLAGS = -DBFD_ASSEMBLER -DOBJ_MAYBE_ELF \ +DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) # How to link with both our special library facilities @@ -571,8 +538,6 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ obj-aout.o : $(srcdir)/config/obj-aout.c $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-bout.o : $(srcdir)/config/obj-bout.c - $(COMPILE) -c $(srcdir)/config/obj-bout.c obj-coff.o: $(srcdir)/config/obj-coff.c $(COMPILE) -c $(srcdir)/config/obj-coff.c obj-ecoff.o : $(srcdir)/config/obj-ecoff.c @@ -581,8 +546,6 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-hp300.o : $(srcdir)/config/obj-hp300.c - $(COMPILE) -c $(srcdir)/config/obj-hp300.c obj-ieee.o : $(srcdir)/config/obj-ieee.c $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c @@ -974,17 +937,6 @@ dep-am: DEP .PHONY: dep dep-in dep-am AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h -DEPTC_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h -DEPTC_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ @@ -1125,16 +1077,6 @@ DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ - $(INCDIR)/safe-ctype.h -DEPTC_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ - $(INCDIR)/safe-ctype.h DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -1188,9 +1130,6 @@ DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/i960.h DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1272,21 +1211,6 @@ DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h -DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h -DEPTC_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/config/m88k-opcode.h DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1467,17 +1391,6 @@ DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ dwarf2dbg.h -DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h @@ -1511,14 +1424,6 @@ DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ struc-symbol.h $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(BFDDIR)/libcoff.h -DEPTC_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h -DEPTC_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ @@ -1534,14 +1439,6 @@ DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h \ $(INCDIR)/safe-ctype.h -DEPTC_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1587,18 +1484,6 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1717,15 +1602,6 @@ DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1775,8 +1651,6 @@ DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1834,19 +1708,6 @@ DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/obstack.h -DEPOBJ_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -2000,18 +1861,6 @@ DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2042,15 +1891,6 @@ DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2063,15 +1903,6 @@ DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -2114,14 +1945,6 @@ DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_a29k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2198,12 +2021,6 @@ DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \ DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h -DEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2237,7 +2054,6 @@ DEP_i386_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h -DEP_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2276,14 +2092,6 @@ DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \ DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h -DEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_m88k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2384,14 +2192,6 @@ DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h -DEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h -DEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ @@ -2412,12 +2212,6 @@ DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h -DEP_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_tic80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ @@ -2426,12 +2220,6 @@ DEP_vax_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-vax.h \ DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h -DEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h -DEP_w65_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h diff --git a/gas/Makefile.in b/gas/Makefile.in index 2115976..648ac44 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -270,7 +270,6 @@ IT_OBJS = itbl-parse.o itbl-lex.o itbl-ops.o # CPU types. This is only used for dependency information. CPU_TYPES = \ - a29k \ alpha \ arc \ arm \ @@ -283,7 +282,6 @@ CPU_TYPES = \ fr30 \ frv \ h8300 \ - h8500 \ hppa \ ia64 \ i370 \ @@ -295,7 +293,6 @@ CPU_TYPES = \ m32r \ m68hc11 \ m68k \ - m88k \ mcore \ mips \ mmix \ @@ -312,13 +309,10 @@ CPU_TYPES = \ sh \ sh64 \ sparc \ - tahoe \ tic30 \ tic4x \ tic54x \ - tic80 \ vax \ - w65 \ v850 \ xstormy16 \ xtensa \ @@ -329,12 +323,10 @@ CPU_TYPES = \ # We deliberately omit SOM, since it does not work as a cross assembler. OBJ_FORMATS = \ aout \ - bout \ coff \ ecoff \ elf \ evax \ - hp300 \ ieee \ vms @@ -348,13 +340,9 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ + arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \ valid=yes ;; \ esac ;; \ - bout) \ - case $$c in \ - i960) valid=yes ;; \ - esac ;; \ coff) valid=yes; \ case $$c in \ cris | i860 | mmix | sh64) \ @@ -369,10 +357,6 @@ CPU_OBJ_VALID = \ case $$c in \ alpha) valid=yes ;; \ esac ;; \ - hp300) \ - case $$c in \ - m68k) valid=yes ;; \ - esac ;; \ vms) \ case $$c in \ vax) valid=yes ;; \ @@ -466,7 +450,6 @@ HFILES = \ # CPU files in config. TARGET_CPU_CFILES = \ - config/tc-a29k.c \ config/tc-alpha.c \ config/tc-arc.c \ config/tc-arm.c \ @@ -479,7 +462,6 @@ TARGET_CPU_CFILES = \ config/tc-fr30.c \ config/tc-frv.c \ config/tc-h8300.c \ - config/tc-h8500.c \ config/tc-hppa.c \ config/tc-ia64.c \ config/tc-i370.c \ @@ -491,7 +473,6 @@ TARGET_CPU_CFILES = \ config/tc-m32r.c \ config/tc-m68hc11.c \ config/tc-m68k.c \ - config/tc-m88k.c \ config/tc-mcore.c \ config/tc-mips.c \ config/tc-mmix.c \ @@ -508,19 +489,15 @@ TARGET_CPU_CFILES = \ config/tc-sh.c \ config/tc-sh64.c \ config/tc-sparc.c \ - config/tc-tahoe.c \ config/tc-tic30.c \ config/tc-tic54x.c \ - config/tc-tic80.c \ config/tc-vax.c \ - config/tc-w65.c \ config/tc-v850.c \ config/tc-xstormy16.c \ config/tc-xtensa.c \ config/tc-z8k.c TARGET_CPU_HFILES = \ - config/tc-a29k.h \ config/tc-alpha.h \ config/tc-arc.h \ config/tc-arm.h \ @@ -533,7 +510,6 @@ TARGET_CPU_HFILES = \ config/tc-fr30.h \ config/tc-frv.h \ config/tc-h8300.h \ - config/tc-h8500.h \ config/tc-hppa.h \ config/tc-ia64.h \ config/tc-i370.h \ @@ -545,7 +521,6 @@ TARGET_CPU_HFILES = \ config/tc-m32r.h \ config/tc-m68hc11.h \ config/tc-m68k.h \ - config/tc-m88k.h \ config/tc-mcore.h \ config/tc-mips.h \ config/tc-mmix.h \ @@ -562,12 +537,9 @@ TARGET_CPU_HFILES = \ config/tc-sh.h \ config/tc-sh64.h \ config/tc-sparc.h \ - config/tc-tahoe.h \ config/tc-tic30.h \ config/tc-tic54x.h \ - config/tc-tic80.h \ config/tc-vax.h \ - config/tc-w65.h \ config/tc-v850.h \ config/tc-xstormy16.h \ config/tc-xtensa.h \ @@ -577,23 +549,19 @@ TARGET_CPU_HFILES = \ # OBJ files in config OBJ_FORMAT_CFILES = \ config/obj-aout.c \ - config/obj-bout.c \ config/obj-coff.c \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ - config/obj-hp300.c \ config/obj-ieee.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ config/obj-aout.h \ - config/obj-bout.h \ config/obj-coff.h \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ - config/obj-hp300.h \ config/obj-ieee.h \ config/obj-som.h @@ -610,7 +578,6 @@ TARG_ENV_HFILES = \ config/te-epoc-pe.h \ config/te-generic.h \ config/te-go32.h \ - config/te-hp300.h \ config/te-hppa.h \ config/te-hppa64.h \ config/te-hppalinux64.h \ @@ -709,7 +676,7 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) # when building dependencies, because the dependency building is done # in a subdirectory. DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(datadir)/locale\"" -DEP_FLAGS = -DBFD_ASSEMBLER -DOBJ_MAYBE_ELF \ +DEP_FLAGS = -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) @@ -750,20 +717,6 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. -DEPTC_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h - -DEPTC_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h - -DEPTC_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/a29k.h - DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ @@ -931,18 +884,6 @@ DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h -DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ - $(INCDIR)/safe-ctype.h - -DEPTC_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h \ - $(INCDIR)/safe-ctype.h - DEPTC_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -1006,10 +947,6 @@ DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h -DEPTC_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/i960.h - DEPTC_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1104,24 +1041,6 @@ DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h dw2gencfi.h \ - $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h - -DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h - -DEPTC_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/config/m88k-opcode.h - DEPTC_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1336,20 +1255,6 @@ DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ dwarf2dbg.h -DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h - -DEPTC_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h - -DEPTC_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h - DEPTC_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h @@ -1390,16 +1295,6 @@ DEPTC_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(BFDDIR)/libcoff.h -DEPTC_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h - -DEPTC_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic80.h - DEPTC_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \ @@ -1418,16 +1313,6 @@ DEPTC_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h \ $(INCDIR)/safe-ctype.h -DEPTC_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h - -DEPTC_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h - DEPTC_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1483,21 +1368,6 @@ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf) -DEPOBJ_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_a29k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1643,17 +1513,6 @@ DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1713,9 +1572,6 @@ DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h - DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1786,22 +1642,6 @@ DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/obstack.h - -DEPOBJ_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1989,21 +1829,6 @@ DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_tahoe_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2041,17 +1866,6 @@ DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2067,17 +1881,6 @@ DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h -DEPOBJ_w65_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h - DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -2130,17 +1933,6 @@ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf) -DEP_a29k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-a29k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h - -DEP_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_a29k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h - DEP_alpha_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-alpha.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2243,14 +2035,6 @@ DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h -DEP_h8500_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8500.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h - DEP_hppa_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-hppa.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2294,7 +2078,6 @@ DEP_i860_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h -DEP_i960_bout = $(srcdir)/config/obj-bout.h $(srcdir)/config/tc-i960.h DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2346,17 +2129,6 @@ DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h -DEP_m68k_hp300 = $(srcdir)/config/obj-hp300.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h - -DEP_m88k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m88k.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/m88k.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_m88k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h - DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h \ $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2491,17 +2263,6 @@ DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h -DEP_tahoe_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tahoe.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h - -DEP_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h - -DEP_tahoe_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h - DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h @@ -2529,14 +2290,6 @@ DEP_tic54x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h -DEP_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_tic80_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h - DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h @@ -2548,14 +2301,6 @@ DEP_vax_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h -DEP_w65_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-w65.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - -DEP_w65_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ - $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h - DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/symcat.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -3024,8 +2769,6 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ obj-aout.o : $(srcdir)/config/obj-aout.c $(COMPILE) -c $(srcdir)/config/obj-aout.c -obj-bout.o : $(srcdir)/config/obj-bout.c - $(COMPILE) -c $(srcdir)/config/obj-bout.c obj-coff.o: $(srcdir)/config/obj-coff.c $(COMPILE) -c $(srcdir)/config/obj-coff.c obj-ecoff.o : $(srcdir)/config/obj-ecoff.c @@ -3034,8 +2777,6 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c -obj-hp300.o : $(srcdir)/config/obj-hp300.c - $(COMPILE) -c $(srcdir)/config/obj-hp300.c obj-ieee.o : $(srcdir)/config/obj-ieee.c $(COMPILE) -c $(srcdir)/config/obj-ieee.c obj-multi.o : $(srcdir)/config/obj-multi.c @@ -57,14 +57,6 @@ facility to list all supported host and target names or aliases. abbreviations to full names; you can read the script, if you wish, or you can use it to test your guesses on abbreviations--for example: - % sh config.sub sun4 - sparc-sun-sunos411 - % sh config.sub sun3 - m68k-sun-sunos411 - % sh config.sub decstation - mips-dec-ultrix42 - % sh config.sub hp300bsd - m68k-hp-bsd % sh config.sub i386v i386-unknown-sysv % sh config.sub i786v @@ -139,75 +131,6 @@ The `--enable' options recognized by software in the gas distribution are: been done, it's already the default. So generally you won't need to use this option. -Supported platforms -=================== - -At this point I believe gas to be ANSI only code for most target cpu's. That -is, there should be relatively few, if any host system dependencies. So -porting (as a cross-assembler) to hosts not yet supported should be fairly -easy. Porting to a new target shouldn't be too tough if it's a variant of one -already supported. - -Native assembling should work on: - - sun3 - sun4 - 386bsd - bsd/386 - delta (m68k-sysv from Motorola) - delta88 (m88k-sysv from Motorola) - GNU/linux - m68k hpux 8.0 (hpux 7.0 may be a problem) - vax bsd, ultrix, vms - hp9000s300 - decstation - irix 4 - irix 5 - miniframe (m68k-sysv from Convergent Technologies) - i386-aix (ps/2) - hppa (hpux 4.3bsd, osf1) - AIX - unixware - sco 3.2v4.2 - sco openserver 5.0 (a.k.a. 3.2v5.0 ) - sparc solaris - ns32k (netbsd, lites) - -I believe that gas as a cross-assembler can currently be targeted for -most of the above hosts, plus - - arm - decstation-bsd (a.out format, to be used in BSD 4.4) - ebmon29k - go32 (DOS on i386, with DJGPP -- old a.out version) - H8/300, H8/500 (Hitachi) - i386-aix (ps/2) - i960-coff - mips ecoff (decstation-ultrix, iris, mips magnum, mips-idt-ecoff) - Mitsubishi d10v and d30v - nindy960 - powerpc EABI - SH (Hitachi) - sco386 - TI tic30 and tic80 - vax bsd or ultrix? - vms - vxworks68k - vxworks960 - z8000 (Zilog) - -MIPS ECOFF support has been added, but GAS will not run a C-style -preprocessor. If you want that, rename your file to have a ".S" suffix, and -run gcc on it. Or run "gcc -xassembler-with-cpp foo.s". - -Support for ELF should work now for sparc, hppa, i386, alpha, m68k, -MIPS, powerpc. - -Support for sequent (ns32k), tahoe, i860 may be suffering from bitrot. - -If you try out gas on some host or target not listed above, please let me know -the results, so I can update the list. - Compiler Support Hacks ====================== diff --git a/gas/README-vms b/gas/README-vms deleted file mode 100644 index f3ee10e..0000000 --- a/gas/README-vms +++ /dev/null @@ -1,248 +0,0 @@ - This document explains a couple of things that are specific to VMS. -There are currently two "chapters", the first deals with cross-assembly -issues, and the second deals with the VMS debugger and GNU-CC. - - -*********************************************************************** -****************** Notes for Cross Assembly with VMS ****************** -*********************************************************************** - - If you wish to build gas on a non-VMS system to cross-assemble, -you should use: - -configure ${hosttype} -target=vms - -and then follow the usual procedure. The object files generated on -Unix will be correct from a binary point of view, but the real trick is -getting them to the VMS machine. The format of the object file is -a variable-length record, but each record contains binary data. gas -writes the records in the same format that VMS would expect, -namely a two-byte count followed by that number of bytes. - - If you try to copy the file to a VMS system using ftp, the ftp -protocol will screw up the file by looking for nulls (record terminator for -unix) and it will insert it's own record terminators at that point. This -will obviously corrupt the file. - - If you try to transfer the file with ftp in binary mode, the -file itself will not be corrupt, but VMS will think that the file contains -fixed-length records of 512 bytes. You can use the public-domain FILE -utility to change this with a command like: - -$FILE foo.o/type=variable - -If you do not have this utility available, the following program can be -used to perform this task: - - #include <fab.h> - - #define RME$C_SETRFM 1 - - struct FAB * fab; - - main(int argc, char * argv[]){ - int i, status; - fab = (struct FAB*) malloc(sizeof(struct FAB)); - *fab = cc$rms_fab; /* initialize FAB*/ - fab->fab$b_fac = FAB$M_PUT; - fab->fab$l_fop |= FAB$M_ESC; - fab->fab$l_ctx = RME$C_SETRFM; - fab->fab$w_ifi = 0; - for(i=1;i<argc;i++){ - printf("Setting %s to variable length records.\n",argv[i]); - fab->fab$l_fna = argv[i]; - fab->fab$b_fns = strlen(argv[i]); - status = sys$open(fab,0,0); - if((status & 7) != 1) lib$signal(status); - fab->fab$b_rfm = FAB$C_VAR; - status = sys$modify(fab,0,0); - if((status & 7) != 1) lib$signal(status); - status = sys$close(fab,0,0); - if((status & 7) != 1) lib$signal(status); - }; - } - - If you have NFS running on the VMS system, what you need to do -depends upon which NFS software you are running on the VMS system. There -are a number of different TCP/IP packages for VMS available, and only very -limited testing has been performed. In the tests that has been done so -far, the contents of the file will always be correct when transferring the -file via NFS, but the record attributes may or may not be correct. - - One proprietary TCP/IP/NFS package for VMS is known to -automatically fix the record attributes of the object file if you NFS mount -a unix disk from the VMS system, and if the file has a ".obj" extension on -the unix system. Other TCP/IP packages might do this for you as well, but -they have not been checked. - -No matter what method you use to get the file to the VMS system, it is -always a good idea to check to make sure that it is the correct type by -doing a "$dir/full" on the object file. The desired record attributes will -be "None". Undesirable record attributes will be "Stream-LF" or anything -else. - -Once you get the files on the VMS system, you can check their integrity -with the "$anal/obj" command. (Naturally at some point you should rename -the .o files to .obj). As far as the debugger is concerned, the records -will be correct, but the debugger will not be able to find the source files, -since it only has the file name, and not the full directory specification. -You must give the debugger some help by telling it which directories to -search for the individual files - once you have done this you should be -able to proceed normally. - - It is a good idea to use names for your files which will be valid -under VMS, since otherwise you will have no way of getting the debugger to -find the source file when deugging. - -The reason for this is that the object file normally contins specific -information that the debugger can use to positively identify a file, and if -you are assembling on a unix system this information simply does not exist -in a meaningful way. You must help the debugger by using the "SET FILE=" -command to tell the debugger where to look for source files. The debugger -records will be correct, except that the debugger will not be initially -able to find the source files. You can use the "SET FILE" command to tell -the debugger where to look for the source files. - -I have only tested this with a SVr4 i486 machine, and everything seems to -work OK, with the limited testing that I have done. Other machines may -or may not work. You should read the chapters on cross-compilers in the gcc -manual before fooling with this. Since gas does not need to do any floating -point arithmetic, the floating point constants that are generated here should -be correct - the only concern is with constant folding in the main compiler. -The range and precision of floats and doubles are similar on the 486 (with -a builtin 80387) and the VAX, although there is a factor of 2 to 4 -difference in the range. The double, as implemented on the 486, is quite -similar to the G_FLOAT on the VAX. - -*********************************************************************** -****************** Notes for using GNU CC with the VMS debugger******** -*********************************************************************** - - - 1) You should be aware that GNU-C, as with any other decent compiler, -will do things when optimization is turned on that you may not expect. -Sometimes intermediate results are not written to variables, if they are only -used in one place, and sometimes variables that are not used at all will not be -written to the symbol table. Also, parameters to inline functions are often -inaccessible. You can see the assembly code equivalent by using KP7 in the -debugger, and from this you can tell if in fact a variable should have the -value that you expect. You can find out if a variable lives withing a register -by doing a 'show symbol/addr'. - - 2) Overly complex data types, such as: - -int (*(*(*(*(*(* sarr6)[1])[1])[2])[3])[4])[5]; - -will not be debugged properly, since the debugging record overflows an internal -debugger buffer. gcc-as will convert these to *void as far as the debugger -symbol table is concerned, which will avoid any problems, and the assembler -will give you a message informing you that this has happened. - - 3) You must, of course, compile and link with /debug. If you link -without debug, you still get traceback table in the executable, but there is no -symbol table for variables. - - 4) Included in the patches to VMS.C are fixes to two bugs that are -unrelated to the changes that I have made. One of these made it impossible to -debug small programs sometimes, and the other caused the debugger to become -confused about which routine it was in, and give this incorrect info in -tracebacks. - - 5) If you are using the GNU-C++ compiler, you should modify the -compiler driver file GNU_CC:[000000]GCC.COM (or GXX.COM). If you have a -separate GXX.COM, then you need to change one line in GXX.COM to: -$ if f$locate("D",p2) .ne. P2_Length then Debug = " ""-G0""" - Notice zero---> ^ -If you are using a GCC.COM that does both C and C++, add the following lines to -GCC.COM: - -$! -$! Use old style debugging records for VMS -$! -$ if (Debug.nes."" ).and. Plus then Debug = " ""-G0""" - -after the variables Plus and Debug are set. The reason for this, is that C++ -compiler by default generates debugging records that are more complex, -with many new syntactical elements that allow for the new features of the -language. The -G0 switch tells the C++ compiler to use the old style debugging -records. Until the debugger understands C++ there is not any point to try and -use the expanded syntax. - - 6) When you have nested scopes, i.e.: -main(){ - int i; - {int i; - {int i; -};};} -and you say "EXAM i" the debugger needs to figure out which variable you -actually want to reference. I have arranged things to define a block to the -debugger when you use brackets to enter a new scope, so in the example above, -the variables would be described as: -TEST\main\i -TEST\main\$0\i -TEST\main\$0\$0\i -At each level, the block name is a number with a dollar sign prefix, the -numbers start with 0 and count upward. When you say EXAM i, the debugger looks -at the current PC, and decides which block it is currently in. It works from -the innermost level outward until it finds a block that has the variable "i" -defined. You can always specify the scope explicitly. - - 7) With C++, there can be a lot of inline functions, and it would be -rather restrictive to force the user to debug the program by converting all of -the inline functions to normal functions. What I have done is to essentially -"add" (with the debugger) source lines from the include files that contain the -inline functions. Thus when you step into an inline function it appears as if -you have called the function, and you can examine variables and so forth. -There are several *very* important differences, however. First of all, since -there is no function call involved, you cannot step over the inline function -call - you always step into it. Secondly, since the same source lines are used -in many locations, there is a separate copy of the source for *each* usage. -Without this, breakpoints do not work, since we must have a 1-to-1 mapping -between source lines and PC. - Since you cannot step over inline function calls, it can be a real pain -if you are not really interested in what is going on for that function call. -What I have done is to use the "-D" switch for the assembler to toggle the -following behavior. With the "-D" switch, all inline functions are included in -the object file, and you can debug everything. Without the "-D" switch -(default case with VMS implementation), inline functions are included *only* if -they did not come from system header files (i.e. from GNU_CC_INCLUDE: or -GNU_GXX_INCLUDE:). Thus, without the switch the user only debugs his/her own -inline functions, and not the system ones. (This is especially useful if you do -a lot of stream I/O in C++). This probably will not provide enough granularity -for many users, but for now this is still somewhat experimental, and I would -like to reflect upon it and get some feedback before I go any further. -Possible solutions include an interactive prompting, a logical name, or a new -command line option in gcc.c (which is then passed through somehow to the guts -of the assembler). - The inline functions from header files appear after the source code -for the source file. This has the advantage that the source file itself is -numbered with the same line numbers that you get with an editor. In addition, -the entire header file is not included, since the assembler makes a list of -the min and max source lines that are used, and only includes those lines from -the first to the last actually used. (It is easy to change it to include the -whole file). - - 8) When you are debugging C++ objects, the object "this" is refered to -as "$this". Actually, the compiler writes it as ".this", but the period is -not good for the debugger, so I have a routine to convert it to a $. (It -actually converts all periods to $, but only for variables, since this was -intended to allow us to access "this". - - 9) If you use the asm("...") keyword for global symbols, you will not -be able to see that symbol with the debugger. The reason is that there are two -records for the symbol stored in the data structures of the assembler. One -contains the info such as psect number and offset, and the other one contains -the information having to do with the data type of the variable. In order to -debug as symbol, you need to be able to coorelate these records, and the only -way to do this is by name. The record with the storage attributes will take -the name used in the asm directive, and the record that specifies the data type -has the actual variable name, and thus when you use the asm directive to change -a variable name, the symbol becomes invisible. - - 10) Older versions of the compiler ( GNU-C 1.37.92 and earlier) place -global constants in the text psect. This is unfortunate, since to the linker -this appears to be an entry point. I sent a patch to the compiler to RMS, -which will generate a .const section for these variables, and patched the -assembler to put these variables into a psect just like that for normal -variables, except that they are marked NOWRT. static constants are still -placed in the text psect, since there is no need for any external access. @@ -43,10 +43,7 @@ #include "dwarf2dbg.h" #include "dw2gencfi.h" #include "hash.h" - -#ifdef BFD_ASSEMBLER #include "bfdver.h" -#endif #ifdef HAVE_ITBL_CPU #include "itbl-ops.h" @@ -112,13 +109,11 @@ int debug_memory = 0; /* Enable verbose mode. */ int verbose = 0; -#ifdef BFD_ASSEMBLER segT reg_section; segT expr_section; segT text_section; segT data_section; segT bss_section; -#endif /* Name of listing file. */ static char *listing_filename = NULL; @@ -225,13 +220,8 @@ print_version_id (void) return; printed = 1; -#ifdef BFD_ASSEMBLER - fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s"), + fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s\n"), VERSION, TARGET_ALIAS, BFD_VERSION_STRING); -#else - fprintf (stderr, _("GNU assembler version %s (%s)"), VERSION, TARGET_ALIAS); -#endif - fprintf (stderr, "\n"); } static void @@ -276,7 +266,7 @@ Options:\n\ emulate output (default %s)\n"), def_em); } #endif -#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) +#if defined OBJ_ELF || defined OBJ_MAYBE_ELF fprintf (stream, _("\ --execstack require executable stack for this object\n")); fprintf (stream, _("\ @@ -457,7 +447,7 @@ parse_args (int * pargc, char *** pargv) ,{"defsym", required_argument, NULL, OPTION_DEFSYM} ,{"dump-config", no_argument, NULL, OPTION_DUMPCONFIG} ,{"emulation", required_argument, NULL, OPTION_EMULATION} -#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) +#if defined OBJ_ELF || defined OBJ_MAYBE_ELF ,{"execstack", no_argument, NULL, OPTION_EXECSTACK} ,{"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK} #endif @@ -598,11 +588,7 @@ parse_args (int * pargc, char *** pargv) case OPTION_VERSION: /* This output is intended to follow the GNU standards document. */ -#ifdef BFD_ASSEMBLER printf (_("GNU assembler %s\n"), BFD_VERSION_STRING); -#else - printf (_("GNU assembler %s\n"), VERSION); -#endif printf (_("Copyright 2005 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ @@ -643,11 +629,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); if (*s == '\0') as_fatal (_("bad defsym; format is --defsym name=value")); *s++ = '\0'; -#ifdef BFD_ASSEMBLER i = bfd_scan_vma (s, (const char **) NULL, 0); -#else - i = strtol (s, (char **) NULL, 0); -#endif n = xmalloc (sizeof *n); n->next = defsyms; n->name = optarg; @@ -774,7 +756,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); flag_fatal_warnings = 1; break; -#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) +#if defined OBJ_ELF || defined OBJ_MAYBE_ELF case OPTION_EXECSTACK: flag_execstack = 1; flag_noexecstack = 0; @@ -983,44 +965,10 @@ static void perform_an_assembly_pass (int argc, char ** argv) { int saw_a_file = 0; -#ifdef BFD_ASSEMBLER flagword applicable; -#endif need_pass_2 = 0; -#ifndef BFD_ASSEMBLER -#ifdef MANY_SEGMENTS - { - unsigned int i; - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - segment_info[i].fix_root = 0; - } - /* Create the three fixed ones. */ - { - segT seg; - -#ifdef TE_APOLLO - seg = subseg_new (".wtext", 0); -#else - seg = subseg_new (".text", 0); -#endif - assert (seg == SEG_E0); - seg = subseg_new (".data", 0); - assert (seg == SEG_E1); - seg = subseg_new (".bss", 0); - assert (seg == SEG_E2); -#ifdef TE_APOLLO - create_target_segments (); -#endif - } - -#else /* not MANY_SEGMENTS. */ - text_fix_root = NULL; - data_fix_root = NULL; - bss_fix_root = NULL; -#endif /* not MANY_SEGMENTS. */ -#else /* BFD_ASSEMBLER. */ /* Create the standard sections, and those the assembler uses internally. */ text_section = subseg_new (TEXT_SECTION_NAME, 0); @@ -1042,12 +990,10 @@ perform_an_assembly_pass (int argc, char ** argv) reg_section = subseg_new ("*GAS `reg' section*", 0); expr_section = subseg_new ("*GAS `expr' section*", 0); -#endif /* BFD_ASSEMBLER. */ - subseg_set (text_section, 0); /* This may add symbol table entries, which requires having an open BFD, - and sections already created, in BFD_ASSEMBLER mode. */ + and sections already created. */ md_begin (); #ifdef USING_CGEN @@ -1113,10 +1059,8 @@ main (int argc, char ** argv) out_file_name = OBJ_DEFAULT_OUTPUT_FILE_NAME; hex_init (); -#ifdef BFD_ASSEMBLER bfd_init (); bfd_set_error_program_name (myname); -#endif #ifdef USE_EMULATIONS select_emulation_mode (argc, argv); @@ -1140,21 +1084,13 @@ main (int argc, char ** argv) #ifdef TC_I960 macro_strip_at = flag_mri; #endif -#ifdef TC_A29K - /* For compatibility with the AMD 29K family macro assembler - specification. */ - flag_macro_alternate = 1; - macro_strip_at = 1; -#endif macro_init (flag_macro_alternate, flag_mri, macro_strip_at, macro_expr); PROGRESS (1); -#ifdef BFD_ASSEMBLER output_file_create (out_file_name); assert (stdoutput != 0); -#endif #ifdef tc_init_after_args tc_init_after_args (); @@ -1189,7 +1125,7 @@ main (int argc, char ** argv) md_end (); #endif -#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) +#if defined OBJ_ELF || defined OBJ_MAYBE_ELF if ((flag_execstack || flag_noexecstack) && OUTPUT_FLAVOR == bfd_target_elf_flavour) { @@ -1216,13 +1152,11 @@ main (int argc, char ** argv) else keep_it = 0; -#if defined (BFD_ASSEMBLER) || !defined (BFD) /* This used to be done at the start of write_object_file in write.c, but that caused problems when doing listings when keep_it was zero. This could probably be moved above md_end, but I didn't want to risk the change. */ subsegs_finish (); -#endif if (keep_it) write_object_file (); @@ -1232,10 +1166,7 @@ main (int argc, char ** argv) #endif #ifndef OBJ_VMS /* Does its own file handling. */ -#ifndef BFD_ASSEMBLER - if (keep_it) -#endif - output_file_close (out_file_name); + output_file_close (out_file_name); #endif if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0) @@ -111,9 +111,7 @@ extern void *alloca (); /* Now GNU header files... */ #include "ansidecl.h" -#ifdef BFD_ASSEMBLER #include "bfd.h" -#endif #include "libiberty.h" /* Define the standard progress macros. */ @@ -207,14 +205,9 @@ extern char *strstr (); /* These are assembler-wide concepts */ -#ifdef BFD_ASSEMBLER extern bfd *stdoutput; typedef bfd_vma addressT; typedef bfd_signed_vma offsetT; -#else -typedef unsigned long addressT; -typedef long offsetT; -#endif /* Type of symbol value, etc. For use in prototypes. */ typedef addressT valueT; @@ -243,49 +236,11 @@ typedef addressT valueT; /* subsegs.c Sub-segments. Also, segment(=expression type)s.*/ -#ifndef BFD_ASSEMBLER - -#ifdef MANY_SEGMENTS -#include "bfd.h" -#define N_SEGMENTS 40 -#define SEG_NORMAL(x) ((x) >= SEG_E0 && (x) <= SEG_E39) -#define SEG_LIST SEG_E0,SEG_E1,SEG_E2,SEG_E3,SEG_E4,SEG_E5,SEG_E6,SEG_E7,SEG_E8,SEG_E9,\ - SEG_E10,SEG_E11,SEG_E12,SEG_E13,SEG_E14,SEG_E15,SEG_E16,SEG_E17,SEG_E18,SEG_E19,\ - SEG_E20,SEG_E21,SEG_E22,SEG_E23,SEG_E24,SEG_E25,SEG_E26,SEG_E27,SEG_E28,SEG_E29,\ - SEG_E30,SEG_E31,SEG_E32,SEG_E33,SEG_E34,SEG_E35,SEG_E36,SEG_E37,SEG_E38,SEG_E39 -#define SEG_TEXT SEG_E0 -#define SEG_DATA SEG_E1 -#define SEG_BSS SEG_E2 -#define SEG_LAST SEG_E39 -#else -#define N_SEGMENTS 3 -#define SEG_NORMAL(x) ((x) == SEG_TEXT || (x) == SEG_DATA || (x) == SEG_BSS) -#define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS -#endif - -typedef enum _segT -{ - SEG_ABSOLUTE = 0, - SEG_LIST, - SEG_UNKNOWN, - SEG_GOOF, /* Only happens if AS has a logic error. */ - /* Invented so we don't crash printing - error message involving weird segment. */ - SEG_EXPR, /* Intermediate expression values. */ - SEG_DEBUG, /* Debug segment */ - SEG_NTV, /* Transfert vector preload segment. */ - SEG_PTV, /* Transfert vector postload segment. */ - SEG_REGISTER /* Mythical: a register-valued expression. */ -} segT; - -#define SEG_MAXIMUM_ORDINAL (SEG_REGISTER) -#else typedef asection *segT; #define SEG_NORMAL(SEG) ( (SEG) != absolute_section \ && (SEG) != undefined_section \ && (SEG) != reg_section \ && (SEG) != expr_section) -#endif typedef int subsegT; /* What subseg we are accessing now? */ @@ -294,33 +249,13 @@ COMMON subsegT now_subseg; /* Segment our instructions emit to. */ COMMON segT now_seg; -#ifdef BFD_ASSEMBLER #define segment_name(SEG) bfd_get_section_name (stdoutput, SEG) -#else -extern char const *const seg_name[]; -#define segment_name(SEG) seg_name[(int) (SEG)] -#endif - -#ifndef BFD_ASSEMBLER -extern int section_alignment[]; -#endif -#ifdef BFD_ASSEMBLER extern segT reg_section, expr_section; /* Shouldn't these be eliminated someday? */ extern segT text_section, data_section, bss_section; #define absolute_section bfd_abs_section_ptr #define undefined_section bfd_und_section_ptr -#else -#define reg_section SEG_REGISTER -#define expr_section SEG_EXPR -#define text_section SEG_TEXT -#define data_section SEG_DATA -#define bss_section SEG_BSS -#define absolute_section SEG_ABSOLUTE -#define undefined_section SEG_UNKNOWN -#endif - enum _relax_state { @@ -602,9 +537,7 @@ int seg_not_empty_p (segT); void start_dependencies (char *); void register_dependency (char *); void print_dependencies (void); -#ifdef BFD_ASSEMBLER segT subseg_get (const char *, int); -#endif struct expressionS; struct fix; @@ -612,10 +545,8 @@ typedef struct symbol symbolS; struct relax_type; typedef struct frag fragS; -#ifdef BFD_ASSEMBLER /* literal.c */ valueT add_to_literal_pool (symbolS *, valueT, segT, int); -#endif int check_eh_frame (struct expressionS *, unsigned int *); int eh_frame_estimate_size_before_relax (fragS *); diff --git a/gas/config-gas.com b/gas/config-gas.com deleted file mode 100644 index 110fa3f..0000000 --- a/gas/config-gas.com +++ /dev/null @@ -1,189 +0,0 @@ -$!config-gas.com -$! This file sets things up to build gas on a VMS system to generate object -$! files for a VMS system. We do not use the configure script, since we -$! do not have /bin/sh to execute it. -$! -$! Note: Only this script contains vax-vms and alpha-vms support, but vax-vms -$! is no longer supported. -$! -$! -$ gas_host="vms" -$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$ arch = f$element(arch_indx,"|","|VAX|Alpha|") -$ if arch.eqs."VAX" -$ then -$ cpu_type="vax" -$ obj_format="vms" -$ atof="vax" -$ else -$ cpu_type="alpha" -$ obj_format="evax" -$ atof="ieee" -$ endif -$ emulation="generic" -$! -$ DELETE = "delete/noConfirm" -$ ECHO = "write sys$output" -$! -$! Target specific information -$ call make "targ-cpu.h" "[.config]tc-''cpu_type'.h" -$ call make "targ-env.h" "[.config]te-''emulation'.h" -$! -$! Code to handle the object file format. -$ call make "obj-format.h" "[.config]obj-''obj_format'.h" -$! -$! (not currently used for vax or alpha) -$ call make "itbl-cpu.h" "[.config]itbl-''cpu_type'.h" -$! -$! -$! Create the file version.opt, which helps identify the executable. -$! -$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$search CONFIGURE.IN "AM_INIT_AUTOMAKE"/Exact/Output=config-gas-tmp.tmp -$open ifile$ config-gas-tmp.tmp -$read ifile$ line -$close ifile$ -$DELETE config-gas-tmp.tmp;* -$! Discard "AM_INIT_AUTOMAKE(gas, " and ")" parts. -$ijk=f$locate(",",line)+2 -$line=f$extract(ijk,f$length(line)-ijk,line) -$ijk=f$locate(")",line) -$line=f$extract(0,ijk,line) -$! -$ if f$search("version.opt").nes."" then DELETE version.opt;* -$copy _NL: version.opt -$open/Append ifile$ version.opt -$write ifile$ "identification="+""""+line+"""" -$close ifile$ -$! -$! Now write config.h. -$! -$ if f$search("config.h").nes."" then DELETE config.h;* -$copy _NL: config.h -$open/Append ifile$ config.h -$write ifile$ "/* config.h. Generated by config-gas.com. */ -$write ifile$ "#ifndef VERSION" -$write ifile$ "#define VERSION """,line,"""" -$write ifile$ "#endif" -$write ifile$ "/*--*/" -$if arch .eqs. "VAX" -$then -$append [.config]vms-conf.h ifile$: -$else -$ append [.config]vms-a-conf.h ifile$: -$endif -$close ifile$ -$ECHO "Created config.h." -$! -$! Check for, and possibly make, header file <unistd.h>. -$! -$ if f$search("tmp-chk-h.*").nes."" then DELETE tmp-chk-h.*;* -$!can't use simple `#include HDR' with `gcc /Define="HDR=<foo.h>"' -$!because the 2.6.[0-3] preprocessor handles it wrong (VMS-specific gcc bug) -$ create tmp-chk-h.c -int tmp_chk_h; /* guarantee non-empty output */ -#ifdef HAVE_STDIO_H -#include <stdio.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_UNIXIO_H -#include <unixio.h> -#endif -#ifdef HAVE_UNIXLIB_H -#include <unixlib.h> -#endif -$ on warning then continue -$ CHECK = "call tmp_chk_h" -$ CHECK "HAVE_STDIO_H" -$ if .not.$status -$ then type sys$input: - -? could not compile <stdio.h>. - - If you're compiling with DEC C or VAX C, create config.status as an - empty file and start gnu make again. - - If you're compiling with GNU C, there is some setup problem and - gas configuration cannot proceed. - -$ DELETE tmp-chk-h.c;* -$ exit %x002C -$ endif -$! -$ CHECK "HAVE_UNISTD_H" -$ if .not.$status -$ then -$ if f$trnlnm("HFILE$").nes."" then close/noLog hfile$ -$ CHECK "HAVE_UNIXIO_H" -$ got_unixio = ($status .and. 1) -$ CHECK "HAVE_UNIXLIB_H" -$ got_unixlib = ($status .and. 1) -$ create []unistd.h !with rudimentary contents -/* <unistd.h> substitute for building gas */ -#ifndef UNISTD_H -#define UNISTD_H - -$ open/Append hfile$ []unistd.h -$ if got_unixio -$ then write hfile$ "#include <unixio.h>" -$ else append sys$input: hfile$: -/* some of the routines normally prototyped in <unixio.h> */ -extern int creat(), open(), close(), read(), write(); -extern int access(), dup(), dup2(), fstat(), stat(); -extern long lseek(); -$ endif -$ write hfile$ "" -$ if got_unixlib -$ then write hfile$ "#include <unixlib.h>" -$ else append sys$input: hfile$: -/* some of the routines normally prototyped in <unixlib.h> */ -extern char *sbrk(), *getcwd(), *cuserid(); -extern int brk(), chdir(), chmod(), chown(), mkdir(); -extern unsigned getuid(), umask(); -$ endif -$ append sys$input: hfile$: - -#endif /*UNISTD_H*/ -$ close hfile$ -$ ECHO "Created ""[]unistd.h""." -$ endif !gcc '#include <unistd.h>' failed -$ DELETE tmp-chk-h.c;* -$ -$tmp_chk_h: subroutine -$ set noOn -$ hname = f$edit("<" + (p1 - "HAVE_" - "_H") + ".h>","LOWERCASE") -$ write sys$output "Checking for ''hname'." -$ if f$search("tmp-chk-h.obj").nes."" then DELETE tmp-chk-h.obj;* -$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc -$ define/noLog sys$output _NL: ! driver's use of multiple image activation -$ gcc /Include=([],[-.include]) /Define=("''p1'") tmp-chk-h.c -$!can't just check $status; gcc 2.6.[0-3] preprocessor doesn't set it correctly -$ ok = (($status.and.1).and.(f$search("tmp-chk-h.obj").nes."")) .or. %x10000000 -$ deassign sys$error !restore, more or less -$ deassign sys$output -$ if ok then DELETE tmp-chk-h.obj;* -$ exit ok -$ endsubroutine !tmp_chk_h -$ -$! -$! Done -$! -$ if f$search("config.status") .nes. "" then DELETE config.status;* -$ open/write cfile []config.status -$ write cfile "Links are now set up for use with a "+arch+" running VMS." -$ close cfile -$ type []config.status -$exit -$! -$! -$make: subroutine -$ if f$search(p1).nes."" then DELETE 'p1';* -$ create 'p1' -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ open/Append ifile$ 'p1' -$ write ifile$ "#include ""''f$string(p2 - "[.config]")'""" -$ close ifile$ -$ ECHO "Created ''p1' for ''p2'." -$endsubroutine !make diff --git a/gas/config.in b/gas/config.in index 9c8c793..9f8fd4f 100644 --- a/gas/config.in +++ b/gas/config.in @@ -3,9 +3,6 @@ /* Define if using AIX 5.2 value for C_WEAKEXT. */ #undef AIX_WEAK_SUPPORT -/* Use BFD interface? */ -#undef BFD_ASSEMBLER - /* assert broken? */ #undef BROKEN_ASSERT @@ -168,9 +165,6 @@ /* Using m88k COFF? */ #undef M88KCOFF -/* old COFF support? */ -#undef MANY_SEGMENTS - /* Default CPU for MIPS targets. */ #undef MIPS_CPU_STRING_DEFAULT @@ -219,9 +213,6 @@ /* generic support? */ #undef OBJ_MAYBE_GENERIC -/* HP300 support? */ -#undef OBJ_MAYBE_HP300 - /* IEEE support? */ #undef OBJ_MAYBE_IEEE diff --git a/gas/config/aout_gnu.h b/gas/config/aout_gnu.h index 091b2de..e17fda9 100644 --- a/gas/config/aout_gnu.h +++ b/gas/config/aout_gnu.h @@ -26,15 +26,15 @@ relocations, and one which uses extended relocations. Today, the extended reloc uses are - TC_SPARC, TC_A29K + TC_SPARC each must define the enum reloc_type */ -#define USE_EXTENDED_RELOC (defined(TC_SPARC) || defined(TC_A29K)) +#define USE_EXTENDED_RELOC defined(TC_SPARC) -#if defined(TC_SPARC) || defined(TC_A29K) +#if defined(TC_SPARC) enum reloc_type { RELOC_8, RELOC_16, RELOC_32,/* simple relocations */ @@ -62,7 +62,7 @@ enum reloc_type NO_RELOC }; -#endif /* TC_SPARC or TC_A29K */ +#endif /* TC_SPARC */ #define __GNU_EXEC_MACROS__ diff --git a/gas/config/atof-tahoe.c b/gas/config/atof-tahoe.c deleted file mode 100644 index 6345cf7..0000000 --- a/gas/config/atof-tahoe.c +++ /dev/null @@ -1,415 +0,0 @@ -/* atof_tahoe.c - turn a string into a Tahoe floating point number - Copyright 1987, 1993, 2000, 2003 Free Software Foundation, Inc. - -/* This is really a simplified version of atof_vax.c. I glommed it wholesale - and then shaved it down. I don't even know how it works. (Don't you find - my honesty refreshing? Devon E Bowen <bowen@cs.buffalo.edu> - - I don't allow uppercase letters in the precision descriptors. - i.e. 'f' and 'd' are allowed but 'F' and 'D' aren't. */ - -#include "as.h" - -/* Precision in LittleNums. */ -#define MAX_PRECISION (4) -#define D_PRECISION (4) -#define F_PRECISION (2) - -/* Precision in chars. */ -#define D_PRECISION_CHARS (8) -#define F_PRECISION_CHARS (4) - -/* Length in LittleNums of guard bits. */ -#define GUARD (2) - -static const long int mask[] = -{ - 0x00000000, - 0x00000001, - 0x00000003, - 0x00000007, - 0x0000000f, - 0x0000001f, - 0x0000003f, - 0x0000007f, - 0x000000ff, - 0x000001ff, - 0x000003ff, - 0x000007ff, - 0x00000fff, - 0x00001fff, - 0x00003fff, - 0x00007fff, - 0x0000ffff, - 0x0001ffff, - 0x0003ffff, - 0x0007ffff, - 0x000fffff, - 0x001fffff, - 0x003fffff, - 0x007fffff, - 0x00ffffff, - 0x01ffffff, - 0x03ffffff, - 0x07ffffff, - 0x0fffffff, - 0x1fffffff, - 0x3fffffff, - 0x7fffffff, - 0xffffffff -}; - -/* Shared between flonum_gen2tahoe and next_bits. */ -static int bits_left_in_littlenum; -static LITTLENUM_TYPE *littlenum_pointer; -static LITTLENUM_TYPE *littlenum_end; - -#if __STDC__ == 1 - -int flonum_gen2tahoe (int format_letter, FLONUM_TYPE * f, - LITTLENUM_TYPE * words); - -#else /* not __STDC__ */ - -int flonum_gen2tahoe (); - -#endif /* not __STDC__ */ - -static int -next_bits (number_of_bits) - int number_of_bits; -{ - int return_value; - - if (littlenum_pointer < littlenum_end) - return 0; - if (number_of_bits >= bits_left_in_littlenum) - { - return_value = mask[bits_left_in_littlenum] & *littlenum_pointer; - number_of_bits -= bits_left_in_littlenum; - return_value <<= number_of_bits; - bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits; - littlenum_pointer--; - if (littlenum_pointer >= littlenum_end) - return_value |= ((*littlenum_pointer) >> (bits_left_in_littlenum)) & - mask[number_of_bits]; - } - else - { - bits_left_in_littlenum -= number_of_bits; - return_value = mask[number_of_bits] & - ((*littlenum_pointer) >> bits_left_in_littlenum); - } - return return_value; -} - -static void -make_invalid_floating_point_number (words) - LITTLENUM_TYPE *words; -{ - /* Floating Reserved Operand Code. */ - *words = 0x8000; -} - -static int /* 0 means letter is OK. */ -what_kind_of_float (letter, precisionP, exponent_bitsP) - /* In: lowercase please. What kind of float? */ - char letter; - - /* Number of 16-bit words in the float. */ - int *precisionP; - - /* Number of exponent bits. */ - long int *exponent_bitsP; -{ - int retval; /* 0: OK. */ - - retval = 0; - switch (letter) - { - case 'f': - *precisionP = F_PRECISION; - *exponent_bitsP = 8; - break; - - case 'd': - *precisionP = D_PRECISION; - *exponent_bitsP = 8; - break; - - default: - retval = 69; - break; - } - return (retval); -} - -/* Warning: This returns 16-bit LITTLENUMs, because that is what the - VAX thinks in. It is up to the caller to figure out any alignment - problems and to conspire for the bytes/word to be emitted in the - right order. Bigendians beware! */ - -char * /* Return pointer past text consumed. */ -atof_tahoe (str, what_kind, words) - char *str; /* Text to convert to binary. */ - char what_kind; /* 'd', 'f', 'g', 'h' */ - LITTLENUM_TYPE *words; /* Build the binary here. */ -{ - FLONUM_TYPE f; - LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD]; - /* Extra bits for zeroed low-order bits. */ - /* The 1st MAX_PRECISION are zeroed, the last contain flonum bits. */ - char *return_value; - int precision; /* Number of 16-bit words in the format. */ - long int exponent_bits; - - return_value = str; - f.low = bits + MAX_PRECISION; - f.high = NULL; - f.leader = NULL; - f.exponent = NULL; - f.sign = '\0'; - - if (what_kind_of_float (what_kind, &precision, &exponent_bits)) - { - /* We lost. */ - return_value = NULL; - make_invalid_floating_point_number (words); - } - if (return_value) - { - memset (bits, '\0', sizeof (LITTLENUM_TYPE) * MAX_PRECISION); - - /* Use more LittleNums than seems necessary: - the highest flonum may have 15 leading 0 bits, so could be - useless. */ - f.high = f.low + precision - 1 + GUARD; - - if (atof_generic (&return_value, ".", "eE", &f)) - { - make_invalid_floating_point_number (words); - /* We lost. */ - return_value = NULL; - } - else - { - if (flonum_gen2tahoe (what_kind, &f, words)) - return_value = NULL; - } - } - return return_value; -} - -/* In: a flonum, a Tahoe floating point format. - Out: a Tahoe floating-point bit pattern. */ - -int /* 0: OK. */ -flonum_gen2tahoe (format_letter, f, words) - char format_letter; /* One of 'd' 'f'. */ - FLONUM_TYPE *f; - LITTLENUM_TYPE *words; /* Deliver answer here. */ -{ - LITTLENUM_TYPE *lp; - int precision; - long int exponent_bits; - int return_value; /* 0 == OK. */ - - return_value = - what_kind_of_float (format_letter, &precision, &exponent_bits); - if (return_value != 0) - { - make_invalid_floating_point_number (words); - } - else - { - if (f->low > f->leader) - { - /* 0.0e0 seen. */ - memset (words, '\0', sizeof (LITTLENUM_TYPE) * precision); - } - else - { - long int exponent_1; - long int exponent_2; - long int exponent_3; - long int exponent_4; - int exponent_skippage; - LITTLENUM_TYPE word1; - - /* JF: Deal with new Nan, +Inf and -Inf codes. */ - if (f->sign != '-' && f->sign != '+') - { - make_invalid_floating_point_number (words); - return return_value; - } - /* All tahoe floating_point formats have: - Bit 15 is sign bit. - Bits 14:n are excess-whatever exponent. - Bits n-1:0 (if any) are most significant bits of fraction. - Bits 15:0 of the next word are the next most significant bits. - And so on for each other word. - - So we need: number of bits of exponent, number of bits of - mantissa. */ - - bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS; - littlenum_pointer = f->leader; - littlenum_end = f->low; - - /* Seek (and forget) 1st significant bit. */ - for (exponent_skippage = 0; - !next_bits (1); - exponent_skippage++) - ; - - exponent_1 = f->exponent + f->leader + 1 - f->low; - - /* Radix LITTLENUM_RADIX, point just higher than f -> leader. */ - exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS; - - /* Radix 2. */ - exponent_3 = exponent_2 - exponent_skippage; - - /* Forget leading zeros, forget 1st bit. */ - exponent_4 = exponent_3 + (1 << (exponent_bits - 1)); - - /* Offset exponent. */ - - if (exponent_4 & ~mask[exponent_bits]) - { - /* Exponent overflow. Lose immediately. */ - - make_invalid_floating_point_number (words); - - /* We leave return_value alone: admit we read the - number, but return a floating exception because we - can't encode the number. */ - } - else - { - lp = words; - - /* Word 1. Sign, exponent and perhaps high bits. */ - /* Assume 2's complement integers. */ - word1 = ((exponent_4 & mask[exponent_bits]) - << (15 - exponent_bits)) - | ((f->sign == '+') ? 0 : 0x8000) - | next_bits (15 - exponent_bits); - *lp++ = word1; - - /* The rest of the words are just mantissa bits. */ - for (; lp < words + precision; lp++) - *lp = next_bits (LITTLENUM_NUMBER_OF_BITS); - - if (next_bits (1)) - { - /* Since the NEXT bit is a 1, round UP the mantissa. - The cunning design of these hidden-1 floats permits - us to let the mantissa overflow into the exponent, and - it 'does the right thing'. However, we lose if the - highest-order bit of the lowest-order word flips. - Is that clear? */ - - unsigned long int carry; - - /* #if (sizeof(carry)) < ((sizeof(bits[0]) * - BITS_PER_CHAR) + 2) Please allow at least 1 more - bit in carry than is in a LITTLENUM. We need - that extra bit to hold a carry during a LITTLENUM - carry propagation. Another extra bit (kept 0) - will assure us that we don't get a sticky sign - bit after shifting right, and that permits us to - propagate the carry without any masking of bits. - #endif */ - for (carry = 1, lp--; - carry && (lp >= words); - lp--) - { - carry = *lp + carry; - *lp = carry; - carry >>= LITTLENUM_NUMBER_OF_BITS; - } - - if ((word1 ^ *words) - & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) - { - make_invalid_floating_point_number (words); - /* We leave return_value alone: admit we read - the number, but return a floating exception - because we can't encode the number. */ - } - } /* if (we needed to round up) */ - } /* if (exponent overflow) */ - } /* if (0.0e0) */ - } /* if (float_type was OK) */ - return return_value; -} - -/* In: input_line_pointer -> the 1st character of a floating-point - * number. - * 1 letter denoting the type of statement that wants a - * binary floating point number returned. - * Address of where to build floating point literal. - * Assumed to be 'big enough'. - * Address of where to return size of literal (in chars). - * - * Out: Input_line_pointer -> of next char after floating number. - * Error message, or 0. - * Floating point literal. - * Number of chars we used for the literal. */ - -char * -md_atof (what_statement_type, literalP, sizeP) - char what_statement_type; - char *literalP; - int *sizeP; -{ - LITTLENUM_TYPE words[MAX_PRECISION]; - register char kind_of_float; - register int number_of_chars; - register LITTLENUM_TYPE *littlenum_pointer; - - switch (what_statement_type) - { - case 'f': /* .ffloat */ - case 'd': /* .dfloat */ - kind_of_float = what_statement_type; - break; - - default: - kind_of_float = 0; - break; - } - - if (kind_of_float) - { - register LITTLENUM_TYPE *limit; - - input_line_pointer = atof_tahoe (input_line_pointer, - kind_of_float, - words); - /* The atof_tahoe() builds up 16-bit numbers. - Since the assembler may not be running on - a different-endian machine, be very careful about - converting words to chars. */ - number_of_chars = (kind_of_float == 'f' ? F_PRECISION_CHARS : - (kind_of_float == 'd' ? D_PRECISION_CHARS : 0)); - know (number_of_chars <= MAX_PRECISION * sizeof (LITTLENUM_TYPE)); - limit = words + (number_of_chars / sizeof (LITTLENUM_TYPE)); - for (littlenum_pointer = words; - littlenum_pointer < limit; - littlenum_pointer++) - { - md_number_to_chars (literalP, *littlenum_pointer, - sizeof (LITTLENUM_TYPE)); - literalP += sizeof (LITTLENUM_TYPE); - } - } - else - { - number_of_chars = 0; - } - - *sizeP = number_of_chars; - return kind_of_float ? 0 : _("Bad call to md_atof()"); -} diff --git a/gas/config/m88k-opcode.h b/gas/config/m88k-opcode.h deleted file mode 100644 index b9a3c93..0000000 --- a/gas/config/m88k-opcode.h +++ /dev/null @@ -1,559 +0,0 @@ -/* m88k-opcode.h -- Instruction information for the Motorola 88000 - Contributed by Devon Bowen of Buffalo University - and Torbjorn Granlund of the Swedish Institute of Computer Science. - Copyright 1989, 1990, 1991, 1993, 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, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if !defined(__STDC__) && !defined(const) -#define const -#endif - -/* - Character codes for op_spec field below. - Reserved for self-matching: [ ] , - - d = GRF Destination register (21:5) - x = XRF register prefix. Makes next d, 1, or 2, match an extended register. - 1 = Source register 1 (16:5) - 2 = Source register 2 (0:5) - 3 = Both source registers (same value) (0:5 and 16:5) - I = IMM16 (0:16) - b = bit field spec. (0:10) - p = 16 bit pc displ. (0:16) - P = 26 bit pc displ. (0:26) - B = bb0/bb1 condition (21:5) - M = bcnd condition (21:5) - f = fcr (5:6) - c = cr (5:6) - V = VEC9 (0:9) - o = O6 field of "prot" insn (10:7) - ? = Give warning for this insn/operand combination - */ - -/* instruction descriptor structure */ - -struct m88k_opcode -{ - unsigned int opcode; - char *name; - char *op_spec; -}; - -/* and introducing... the Motorola 88100 and 88110 instruction sets... */ - -/* By default, include the 88110 instructions. */ -#define MC88110 - -#if defined (MC88110) -#define _MC88100(OPCODE,MNEM,OP_SPEC) -#define _MC88110(OPCODE,MNEM,OP_SPEC) {OPCODE,MNEM,OP_SPEC}, -#else -#define _MC88100(OPCODE,MNEM,OP_SPEC) {OPCODE,MNEM,OP_SPEC}, -#define _MC88110(OPCODE,MNEM,OP_SPEC) -#endif - -#define _MC88xxx(OPCODE,MNEM,OP_SPEC) {OPCODE,MNEM,OP_SPEC}, - -/* Equal mnemonics must be adjacent. - More specific operand specification must go before more general. - For example, "d,1,2" must go before "d,1,I" as a register for s2 - would otherwise be considered a variable name. */ - -static struct m88k_opcode m88k_opcodes[] = -{ - /* Opcode Mnemonic Opspec */ - - _MC88xxx (0xf4007000, "add", "d,1,2") - _MC88xxx (0x70000000, "add", "d,1,I") - _MC88xxx (0xf4007200, "add.ci", "d,1,2") - _MC88xxx (0xf4007300, "add.cio", "d,1,2") - _MC88xxx (0xf4007100, "add.co", "d,1,2") - _MC88xxx (0xf4006000, "addu", "d,1,2") - _MC88xxx (0x60000000, "addu", "d,1,I") - _MC88xxx (0xf4006200, "addu.ci", "d,1,2") - _MC88xxx (0xf4006300, "addu.cio", "d,1,2") - _MC88xxx (0xf4006100, "addu.co", "d,1,2") - _MC88xxx (0xf4004000, "and", "d,1,2") - _MC88xxx (0x40000000, "and", "d,1,I") - _MC88xxx (0xf4004400, "and.c", "d,1,2") - _MC88xxx (0x44000000, "and.u", "d,1,I") - _MC88xxx (0xd0000000, "bb0", "B,1,p") - _MC88xxx (0xd4000000, "bb0.n", "B,1,p") - _MC88xxx (0xd8000000, "bb1", "B,1,p") - _MC88xxx (0xdc000000, "bb1.n", "B,1,p") - _MC88xxx (0xe8000000, "bcnd", "M,1,p") - _MC88xxx (0xec000000, "bcnd.n", "M,1,p") - _MC88xxx (0xc0000000, "br", "P") - _MC88xxx (0xc4000000, "br.n", "P") - _MC88xxx (0xc8000000, "bsr", "P") - _MC88xxx (0xcc000000, "bsr.n", "P") - _MC88xxx (0xf4008000, "clr", "d,1,2") - _MC88xxx (0xf0008000, "clr", "d,1,b") - _MC88xxx (0xf4007c00, "cmp", "d,1,2") - _MC88xxx (0x7c000000, "cmp", "d,1,I") - _MC88xxx (0xf4007800, "div", "d,1,2") - _MC88xxx (0x78000000, "div", "d,1,I") - _MC88xxx (0xf4007800, "divs", "d,1,2") - _MC88xxx (0x78000000, "divs", "d,1,I") - _MC88110 (0xf4006900, "divu.d", "d,1,2") - _MC88xxx (0xf4006800, "divu", "d,1,2") - _MC88xxx (0x68000000, "divu", "d,1,I") - _MC88xxx (0xf4009000, "ext", "d,1,2") - _MC88xxx (0xf0009000, "ext", "d,1,b") - _MC88xxx (0xf4009800, "extu", "d,1,2") - _MC88xxx (0xf0009800, "extu", "d,1,b") - _MC88xxx (0x84002800, "fadd.sss", "d,1,2") - _MC88110 (0x8400a800, "fadd.sss", "xd,x1,x2") - _MC88xxx (0x84002880, "fadd.ssd", "d,1,2") - _MC88110 (0x8400a820, "fadd.ssd", "xd,x1,x2") - _MC88110 (0x8400a840, "fadd.ssx", "xd,x1,x2") - _MC88xxx (0x84002a00, "fadd.sds", "d,1,2") - _MC88110 (0x8400a880, "fadd.sds", "xd,x1,x2") - _MC88xxx (0x84002a80, "fadd.sdd", "d,1,2") - _MC88110 (0x8400a8a0, "fadd.sdd", "xd,x1,x2") - _MC88110 (0x8400a8c0, "fadd.sdx", "xd,x1,x2") - _MC88110 (0x8400a900, "fadd.sxs", "xd,x1,x2") - _MC88110 (0x8400a920, "fadd.sxd", "xd,x1,x2") - _MC88110 (0x8400a940, "fadd.sxx", "xd,x1,x2") - _MC88xxx (0x84002820, "fadd.dss", "d,1,2") - _MC88110 (0x8400aa00, "fadd.dss", "xd,x1,x2") - _MC88xxx (0x840028a0, "fadd.dsd", "d,1,2") - _MC88110 (0x8400aa20, "fadd.dsd", "xd,x1,x2") - _MC88110 (0x8400aa40, "fadd.dsx", "xd,x1,x2") - _MC88xxx (0x84002a20, "fadd.dds", "d,1,2") - _MC88110 (0x8400aa80, "fadd.dds", "xd,x1,x2") - _MC88xxx (0x84002aa0, "fadd.ddd", "d,1,2") - _MC88110 (0x8400aaa0, "fadd.ddd", "xd,x1,x2") - _MC88110 (0x8400aac0, "fadd.ddx", "xd,x1,x2") - _MC88110 (0x8400ab00, "fadd.dxs", "xd,x1,x2") - _MC88110 (0x8400ab20, "fadd.dxd", "xd,x1,x2") - _MC88110 (0x8400ab40, "fadd.dxx", "xd,x1,x2") - _MC88110 (0x8400ac00, "fadd.xss", "xd,x1,x2") - _MC88110 (0x8400ac20, "fadd.xsd", "xd,x1,x2") - _MC88110 (0x8400ac40, "fadd.xsx", "xd,x1,x2") - _MC88110 (0x8400ac80, "fadd.xds", "xd,x1,x2") - _MC88110 (0x8400aca0, "fadd.xdd", "xd,x1,x2") - _MC88110 (0x8400acc0, "fadd.xdx", "xd,x1,x2") - _MC88110 (0x8400ad00, "fadd.xxs", "xd,x1,x2") - _MC88110 (0x8400ad20, "fadd.xxd", "xd,x1,x2") - _MC88110 (0x8400ad40, "fadd.xxx", "xd,x1,x2") - _MC88xxx (0x84003a80, "fcmp.sdd", "d,1,2") - _MC88110 (0x8400ba80, "fcmp.sdd", "d,x1,x2") - _MC88xxx (0x84003a00, "fcmp.sds", "d,1,2") - _MC88110 (0x8400ba00, "fcmp.sds", "d,x1,x2") - _MC88110 (0x8400bb00, "fcmp.sdx", "d,x1,x2") - _MC88xxx (0x84003880, "fcmp.ssd", "d,1,2") - _MC88110 (0x8400b880, "fcmp.ssd", "d,x1,x2") - _MC88xxx (0x84003800, "fcmp.sss", "d,1,2") - _MC88110 (0x8400b800, "fcmp.sss", "d,x1,x2") - _MC88110 (0x8400b900, "fcmp.ssx", "d,x1,x2") - _MC88110 (0x8400bc80, "fcmp.sxd", "d,x1,x2") - _MC88110 (0x8400bc00, "fcmp.sxs", "d,x1,x2") - _MC88110 (0x8400bd00, "fcmp.sxx", "d,x1,x2") - _MC88110 (0x84003aa0, "fcmpu.sdd", "d,1,2") - _MC88110 (0x8400baa0, "fcmpu.sdd", "d,x1,x2") - _MC88110 (0x84003a20, "fcmpu.sds", "d,1,2") - _MC88110 (0x8400ba20, "fcmpu.sds", "d,x1,x2") - _MC88110 (0x8400bb20, "fcmpu.sdx", "d,x1,x2") - _MC88110 (0x840038a0, "fcmpu.ssd", "d,1,2") - _MC88110 (0x8400b8a0, "fcmpu.ssd", "d,x1,x2") - _MC88110 (0x84003820, "fcmpu.sss", "d,1,2") - _MC88110 (0x8400b820, "fcmpu.sss", "d,x1,x2") - _MC88110 (0x8400b920, "fcmpu.ssx", "d,x1,x2") - _MC88110 (0x8400bca0, "fcmpu.sxd", "d,x1,x2") - _MC88110 (0x8400bc20, "fcmpu.sxs", "d,x1,x2") - _MC88110 (0x8400bd20, "fcmpu.sxx", "d,x1,x2") - _MC88110 (0x84000880, "fcvt.ds", "d,2") - _MC88110 (0x84008880, "fcvt.ds", "xd,x2") - _MC88110 (0x840088c0, "fcvt.dx", "xd,x2") - _MC88110 (0x84000820, "fcvt.sd", "d,2") - _MC88110 (0x84008820, "fcvt.sd", "xd,x2") - _MC88110 (0x84008840, "fcvt.sx", "xd,x2") - _MC88110 (0x84008920, "fcvt.xd", "xd,x2") - _MC88110 (0x84008900, "fcvt.xs", "xd,x2") - _MC88xxx (0x84007000, "fdiv.sss", "d,1,2") - _MC88110 (0x8400f000, "fdiv.sss", "xd,x1,x2") - _MC88xxx (0x84007080, "fdiv.ssd", "d,1,2") - _MC88110 (0x8400f020, "fdiv.ssd", "xd,x1,x2") - _MC88110 (0x8400f040, "fdiv.ssx", "xd,x1,x2") - _MC88xxx (0x84007200, "fdiv.sds", "d,1,2") - _MC88110 (0x8400f080, "fdiv.sds", "xd,x1,x2") - _MC88xxx (0x84007280, "fdiv.sdd", "d,1,2") - _MC88110 (0x8400f0a0, "fdiv.sdd", "xd,x1,x2") - _MC88110 (0x8400f0c0, "fdiv.sdx", "xd,x1,x2") - _MC88110 (0x8400f100, "fdiv.sxs", "xd,x1,x2") - _MC88110 (0x8400f120, "fdiv.sxd", "xd,x1,x2") - _MC88110 (0x8400f140, "fdiv.sxx", "xd,x1,x2") - _MC88xxx (0x84007020, "fdiv.dss", "d,1,2") - _MC88110 (0x8400f200, "fdiv.dss", "xd,x1,x2") - _MC88xxx (0x840070a0, "fdiv.dsd", "d,1,2") - _MC88110 (0x8400f220, "fdiv.dsd", "xd,x1,x2") - _MC88110 (0x8400f240, "fdiv.dsx", "xd,x1,x2") - _MC88xxx (0x84007220, "fdiv.dds", "d,1,2") - _MC88110 (0x8400f280, "fdiv.dds", "xd,x1,x2") - _MC88xxx (0x840072a0, "fdiv.ddd", "d,1,2") - _MC88110 (0x8400f2a0, "fdiv.ddd", "xd,x1,x2") - _MC88110 (0x8400f2c0, "fdiv.ddx", "xd,x1,x2") - _MC88110 (0x8400f300, "fdiv.dxs", "xd,x1,x2") - _MC88110 (0x8400f320, "fdiv.dxd", "xd,x1,x2") - _MC88110 (0x8400f340, "fdiv.dxx", "xd,x1,x2") - _MC88110 (0x8400f400, "fdiv.xss", "xd,x1,x2") - _MC88110 (0x8400f420, "fdiv.xsd", "xd,x1,x2") - _MC88110 (0x8400f440, "fdiv.xsx", "xd,x1,x2") - _MC88110 (0x8400f480, "fdiv.xds", "xd,x1,x2") - _MC88110 (0x8400f4a0, "fdiv.xdd", "xd,x1,x2") - _MC88110 (0x8400f4c0, "fdiv.xdx", "xd,x1,x2") - _MC88110 (0x8400f500, "fdiv.xxs", "xd,x1,x2") - _MC88110 (0x8400f520, "fdiv.xxd", "xd,x1,x2") - _MC88110 (0x8400f540, "fdiv.xxx", "xd,x1,x2") - _MC88xxx (0xf400ec00, "ff0", "d,2") - _MC88xxx (0xf400e800, "ff1", "d,2") - _MC88xxx (0x80004800, "fldcr", "d,f") - _MC88xxx (0x84002020, "flt.ds", "d,2") - _MC88110 (0x84002220, "flt.ds", "xd,2") - _MC88xxx (0x84002000, "flt.ss", "d,2") - _MC88110 (0x84002200, "flt.ss", "xd,2") - _MC88110 (0x84002240, "flt.xs", "xd,2") - _MC88xxx (0x84000000, "fmul.sss", "d,1,2") - _MC88110 (0x84008000, "fmul.sss", "xd,x1,x2") - _MC88xxx (0x84000080, "fmul.ssd", "d,1,2") - _MC88110 (0x84008020, "fmul.ssd", "xd,x1,x2") - _MC88110 (0x84008040, "fmul.ssx", "xd,x1,x2") - _MC88xxx (0x84000200, "fmul.sds", "d,1,2") - _MC88110 (0x84008080, "fmul.sds", "xd,x1,x2") - _MC88xxx (0x84000280, "fmul.sdd", "d,1,2") - _MC88110 (0x840080a0, "fmul.sdd", "xd,x1,x2") - _MC88110 (0x840080c0, "fmul.sdx", "xd,x1,x2") - _MC88110 (0x84008100, "fmul.sxs", "xd,x1,x2") - _MC88110 (0x84008120, "fmul.sxd", "xd,x1,x2") - _MC88110 (0x84008140, "fmul.sxx", "xd,x1,x2") - _MC88xxx (0x84000020, "fmul.dss", "d,1,2") - _MC88110 (0x84008200, "fmul.dss", "xd,x1,x2") - _MC88xxx (0x840000a0, "fmul.dsd", "d,1,2") - _MC88110 (0x84008220, "fmul.dsd", "xd,x1,x2") - _MC88110 (0x84008240, "fmul.dsx", "xd,x1,x2") - _MC88xxx (0x84000220, "fmul.dds", "d,1,2") - _MC88110 (0x84008280, "fmul.dds", "xd,x1,x2") - _MC88xxx (0x840002a0, "fmul.ddd", "d,1,2") - _MC88110 (0x840082a0, "fmul.ddd", "xd,x1,x2") - _MC88110 (0x840082c0, "fmul.ddx", "xd,x1,x2") - _MC88110 (0x84008300, "fmul.dxs", "xd,x1,x2") - _MC88110 (0x84008320, "fmul.dxd", "xd,x1,x2") - _MC88110 (0x84008340, "fmul.dxx", "xd,x1,x2") - _MC88110 (0x84008400, "fmul.xss", "xd,x1,x2") - _MC88110 (0x84008420, "fmul.xsd", "xd,x1,x2") - _MC88110 (0x84008440, "fmul.xsx", "xd,x1,x2") - _MC88110 (0x84008480, "fmul.xds", "xd,x1,x2") - _MC88110 (0x840084a0, "fmul.xdd", "xd,x1,x2") - _MC88110 (0x840084c0, "fmul.xdx", "xd,x1,x2") - _MC88110 (0x84008500, "fmul.xxs", "xd,x1,x2") - _MC88110 (0x84008520, "fmul.xxd", "xd,x1,x2") - _MC88110 (0x84008540, "fmul.xxx", "xd,x1,x2") - _MC88110 (0x840078a0, "fsqrt.dd", "d,2") - _MC88110 (0x8400f8a0, "fsqrt.dd", "xd,x2") - _MC88110 (0x84007880, "fsqrt.ds", "d,2") - _MC88110 (0x8400f880, "fsqrt.ds", "xd,x2") - _MC88110 (0x8400f8c0, "fsqrt.dx", "xd,x2") - _MC88110 (0x84007820, "fsqrt.sd", "d,2") - _MC88110 (0x8400f820, "fsqrt.sd", "xd,x2") - _MC88110 (0x84007800, "fsqrt.ss", "d,2") - _MC88110 (0x8400f800, "fsqrt.ss", "xd,x2") - _MC88110 (0x8400f840, "fsqrt.sx", "xd,x2") - _MC88110 (0x8400f920, "fsqrt.xd", "xd,x2") - _MC88110 (0x8400f900, "fsqrt.xs", "xd,x2") - _MC88110 (0x8400f940, "fsqrt.xx", "xd,x2") - _MC88xxx (0x80008800, "fstcr", "3,f") - _MC88xxx (0x84003000, "fsub.sss", "d,1,2") - _MC88110 (0x8400b000, "fsub.sss", "xd,x1,x2") - _MC88xxx (0x84003080, "fsub.ssd", "d,1,2") - _MC88110 (0x8400b020, "fsub.ssd", "xd,x1,x2") - _MC88110 (0x8400b040, "fsub.ssx", "xd,x1,x2") - _MC88xxx (0x84003200, "fsub.sds", "d,1,2") - _MC88110 (0x8400b080, "fsub.sds", "xd,x1,x2") - _MC88xxx (0x84003280, "fsub.sdd", "d,1,2") - _MC88110 (0x8400b0a0, "fsub.sdd", "xd,x1,x2") - _MC88110 (0x8400b0c0, "fsub.sdx", "xd,x1,x2") - _MC88110 (0x8400b100, "fsub.sxs", "xd,x1,x2") - _MC88110 (0x8400b120, "fsub.sxd", "xd,x1,x2") - _MC88110 (0x8400b140, "fsub.sxx", "xd,x1,x2") - _MC88xxx (0x84003020, "fsub.dss", "d,1,2") - _MC88110 (0x8400b200, "fsub.dss", "xd,x1,x2") - _MC88xxx (0x840030a0, "fsub.dsd", "d,1,2") - _MC88110 (0x8400b220, "fsub.dsd", "xd,x1,x2") - _MC88110 (0x8400b240, "fsub.dsx", "xd,x1,x2") - _MC88xxx (0x84003220, "fsub.dds", "d,1,2") - _MC88110 (0x8400b280, "fsub.dds", "xd,x1,x2") - _MC88xxx (0x840032a0, "fsub.ddd", "d,1,2") - _MC88110 (0x8400b2a0, "fsub.ddd", "xd,x1,x2") - _MC88110 (0x8400b2c0, "fsub.ddx", "xd,x1,x2") - _MC88110 (0x8400b300, "fsub.dxs", "xd,x1,x2") - _MC88110 (0x8400b320, "fsub.dxd", "xd,x1,x2") - _MC88110 (0x8400b340, "fsub.dxx", "xd,x1,x2") - _MC88110 (0x8400b400, "fsub.xss", "xd,x1,x2") - _MC88110 (0x8400b420, "fsub.xsd", "xd,x1,x2") - _MC88110 (0x8400b440, "fsub.xsx", "xd,x1,x2") - _MC88110 (0x8400b480, "fsub.xds", "xd,x1,x2") - _MC88110 (0x8400b4a0, "fsub.xdd", "xd,x1,x2") - _MC88110 (0x8400b4c0, "fsub.xdx", "xd,x1,x2") - _MC88110 (0x8400b500, "fsub.xxs", "xd,x1,x2") - _MC88110 (0x8400b520, "fsub.xxd", "xd,x1,x2") - _MC88110 (0x8400b540, "fsub.xxx", "xd,x1,x2") - _MC88xxx (0x8000c800, "fxcr", "d,3,f") - _MC88xxx (0x8400fc01, "illop1", "") - _MC88xxx (0x8400fc02, "illop2", "") - _MC88xxx (0x8400fc03, "illop3", "") - _MC88xxx (0x84004880, "int.sd", "d,2") - _MC88110 (0x8400c880, "int.sd", "d,x2") - _MC88xxx (0x84004800, "int.ss", "d,2") - _MC88110 (0x8400c800, "int.ss", "d,x2") - _MC88110 (0x8400c900, "int.sx", "d,x2") - _MC88xxx (0xf400c000, "jmp", "2") - _MC88xxx (0xf400c400, "jmp.n", "2") - _MC88xxx (0xf400c800, "jsr", "2") - _MC88xxx (0xf400cc00, "jsr.n", "2") - _MC88xxx (0xf4001400, "ld", "d,1,2") - _MC88xxx (0xf4001600, "ld", "d,1[2]") - _MC88xxx (0x14000000, "ld", "d,1,I") - _MC88110 (0xf0001600, "ld", "xd,1[2]") - _MC88110 (0xf0001400, "ld", "xd,1,2") - _MC88110 (0x04000000, "ld", "xd,1,I") - _MC88xxx (0xf4001e00, "ld.b", "d,1[2]") - _MC88xxx (0xf4001c00, "ld.b", "d,1,2") - _MC88xxx (0x1c000000, "ld.b", "d,1,I") - _MC88xxx (0xf4001d00, "ld.b.usr", "d,1,2") - _MC88xxx (0xf4001f00, "ld.b.usr", "d,1[2]") - _MC88xxx (0xf4000e00, "ld.bu", "d,1[2]") - _MC88xxx (0xf4000c00, "ld.bu", "d,1,2") - _MC88xxx (0x0c000000, "ld.bu", "d,1,I") - _MC88xxx (0xf4000d00, "ld.bu.usr", "d,1,2") - _MC88xxx (0xf4000f00, "ld.bu.usr", "d,1[2]") - _MC88xxx (0xf4001200, "ld.d", "d,1[2]") - _MC88xxx (0xf4001000, "ld.d", "d,1,2") - _MC88xxx (0x10000000, "ld.d", "d,1,I") - _MC88110 (0xf0001200, "ld.d", "xd,1[2]") - _MC88110 (0xf0001000, "ld.d", "xd,1,2") - _MC88110 (0x00000000, "ld.d", "xd,1,I") - _MC88xxx (0xf4001100, "ld.d.usr", "d,1,2") - _MC88xxx (0xf4001300, "ld.d.usr", "d,1[2]") - _MC88110 (0xf0001100, "ld.d.usr", "xd,1,2") - _MC88110 (0xf0001300, "ld.d.usr", "xd,1[2]") - _MC88xxx (0xf4001a00, "ld.h", "d,1[2]") - _MC88xxx (0xf4001800, "ld.h", "d,1,2") - _MC88xxx (0x18000000, "ld.h", "d,1,I") - _MC88xxx (0xf4001900, "ld.h.usr", "d,1,2") - _MC88xxx (0xf4001b00, "ld.h.usr", "d,1[2]") - _MC88xxx (0xf4000a00, "ld.hu", "d,1[2]") - _MC88xxx (0xf4000800, "ld.hu", "d,1,2") - _MC88xxx (0x08000000, "ld.hu", "d,1,I") - _MC88xxx (0xf4000900, "ld.hu.usr", "d,1,2") - _MC88xxx (0xf4000b00, "ld.hu.usr", "d,1[2]") - _MC88xxx (0xf4001500, "ld.usr", "d,1,2") - _MC88xxx (0xf4001700, "ld.usr", "d,1[2]") - _MC88110 (0xf0001500, "ld.usr", "xd,1,2") - _MC88110 (0xf0001700, "ld.usr", "xd,1[2]") - _MC88110 (0xf0001a00, "ld.x", "xd,1[2]") - _MC88110 (0xf0001800, "ld.x", "xd,1,2") - _MC88110 (0x3c000000, "ld.x", "xd,1,I") - _MC88110 (0xf0001900, "ld.x.usr", "xd,1,2") - _MC88110 (0xf0001b00, "ld.x.usr", "xd,1[2]") - _MC88xxx (0xf4003600, "lda", "d,1[2]") - _MC88xxx (0xf4006000, "lda", "?d,1,2") /* Output addu */ - _MC88xxx (0x60000000, "lda", "?d,1,I") /* Output addu */ - _MC88xxx (0xf4006000, "lda.b", "?d,1[2]") /* Output addu */ - _MC88xxx (0xf4006000, "lda.b", "?d,1,2") /* Output addu */ - _MC88xxx (0x60000000, "lda.b", "?d,1,I") /* Output addu */ - _MC88xxx (0xf4003200, "lda.d", "d,1[2]") - _MC88xxx (0xf4006000, "lda.d", "?d,1,2") /* Output addu */ - _MC88xxx (0x60000000, "lda.d", "?d,1,I") /* Output addu */ - _MC88110 (0xf4003e00, "lda.x", "d,1[2]") - _MC88xxx (0xf4003a00, "lda.h", "d,1[2]") - _MC88xxx (0xf4006000, "lda.h", "?d,1,2") /* Output addu */ - _MC88xxx (0x60000000, "lda.h", "?d,1,I") /* Output addu */ - _MC88xxx (0x80004000, "ldcr", "d,c") - _MC88xxx (0xf400a000, "mak", "d,1,2") - _MC88xxx (0xf000a000, "mak", "d,1,b") - _MC88xxx (0x48000000, "mask", "d,1,I") - _MC88xxx (0x4c000000, "mask.u", "d,1,I") - _MC88110 (0x8400c000, "mov.s", "d,x2") - _MC88110 (0x84004200, "mov.s", "xd,2") - _MC88110 (0x8400c080, "mov.d", "d,x2") - _MC88110 (0x84004280, "mov.d", "xd,2") - _MC88110 (0x8400c300, "mov", "xd,x2") - _MC88xxx (0xf4006c00, "mul", "d,1,2") - _MC88xxx (0x6c000000, "mul", "d,1,I") - _MC88xxx (0xf4006e00, "muls", "d,1,2") - _MC88xxx (0x6c000000, "muls", "d,1,I") - _MC88xxx (0xf4006c00, "mulu", "d,1,2") /* synonym for mul */ - _MC88xxx (0x6c000000, "mulu", "d,1,I") /* synonym for mul */ - _MC88110 (0xf4006d00, "mulu.d", "d,1,2") - _MC88xxx (0x84005080, "nint.sd", "d,2") - _MC88110 (0x8400d080, "nint.sd", "d,x2") - _MC88xxx (0x84005000, "nint.ss", "d,2") - _MC88110 (0x8400d000, "nint.ss", "d,x2") - _MC88110 (0x8400d100, "nint.sx", "d,x2") - _MC88xxx (0xf4005800, "or", "d,1,2") - _MC88xxx (0x58000000, "or", "d,1,I") - _MC88xxx (0xf4005c00, "or.c", "d,1,2") - _MC88xxx (0x5c000000, "or.u", "d,1,I") - _MC88110 (0x88002020, "padd.b", "d,1,2") - _MC88110 (0x88002040, "padd.h", "d,1,2") - _MC88110 (0x88002060, "padd", "d,1,2") - _MC88110 (0x880020a0, "padds.u.b", "d,1,2") - _MC88110 (0x880020c0, "padds.u.h", "d,1,2") - _MC88110 (0x880020e0, "padds.u", "d,1,2") - _MC88110 (0x88002120, "padds.us.b", "d,1,2") - _MC88110 (0x88002140, "padds.us.h", "d,1,2") - _MC88110 (0x88002160, "padds.us", "d,1,2") - _MC88110 (0x880021a0, "padds.s.b", "d,1,2") - _MC88110 (0x880021c0, "padds.s.h", "d,1,2") - _MC88110 (0x880021e0, "padds.s", "d,1,2") - _MC88110 (0x88003860, "pcmp", "d,1,2") - _MC88110 (0x88000000, "pmul", "d,1,2") - _MC88110 (0x88006420, "ppack.32.b", "d,1,2") - _MC88110 (0x88006240, "ppack.16.h", "d,1,2") - _MC88110 (0x88006440, "ppack.32.h", "d,1,2") - _MC88110 (0x88006160, "ppack.8", "d,1,2") - _MC88110 (0x88006260, "ppack.16", "d,1,2") - _MC88110 (0x88006460, "ppack.32", "d,1,2") - _MC88110 (0x88007800, "prot", "d,1,2") - _MC88110 (0x88007000, "prot", "d,1,o") - _MC88110 (0x88003020, "psub.b", "d,1,2") - _MC88110 (0x88003040, "psub.h", "d,1,2") - _MC88110 (0x88003060, "psub", "d,1,2") - _MC88110 (0x880030a0, "psubs.u.b", "d,1,2") - _MC88110 (0x880030c0, "psubs.u.h", "d,1,2") - _MC88110 (0x880030e0, "psubs.u", "d,1,2") - _MC88110 (0x88003120, "psubs.us.b", "d,1,2") - _MC88110 (0x88003140, "psubs.us.h", "d,1,2") - _MC88110 (0x88003160, "psubs.us", "d,1,2") - _MC88110 (0x880031a0, "psubs.s.b", "d,1,2") - _MC88110 (0x880031c0, "psubs.s.h", "d,1,2") - _MC88110 (0x880031e0, "psubs.s", "d,1,2") - _MC88110 (0x88006800, "punpk.n", "d,1") - _MC88110 (0x88006820, "punpk.b", "d,1") - _MC88110 (0x88006840, "punpk.h", "d,1") - _MC88xxx (0xf400a800, "rot", "d,1,2") - _MC88xxx (0xf000a800, "rot", "d,1,b") - _MC88xxx (0xf400fc00, "rte", "") - _MC88xxx (0xf4008800, "set", "d,1,2") - _MC88xxx (0xf0008800, "set", "d,1,b") - _MC88xxx (0xf4002600, "st", "d,1[2]") - _MC88xxx (0xf4002400, "st", "d,1,2") - _MC88xxx (0x24000000, "st", "d,1,I") - _MC88110 (0xf0002600, "st", "xd,1[2]") - _MC88110 (0xf0002400, "st", "xd,1,2") - _MC88110 (0x34000000, "st", "xd,1,I") - _MC88xxx (0xf4002e00, "st.b", "d,1[2]") - _MC88xxx (0xf4002c00, "st.b", "d,1,2") - _MC88xxx (0x2c000000, "st.b", "d,1,I") - _MC88xxx (0xf4002d00, "st.b.usr", "d,1,2") - _MC88xxx (0xf4002f00, "st.b.usr", "d,1[2]") - _MC88110 (0xf4002d80, "st.b.usr.wt", "d,1,2") - _MC88110 (0xf4002f80, "st.b.usr.wt", "d,1[2]") - _MC88110 (0xf4002c80, "st.b.wt", "d,1,2") - _MC88110 (0xf4002e80, "st.b.wt", "d,1[2]") - _MC88xxx (0xf4002200, "st.d", "d,1[2]") - _MC88xxx (0xf4002000, "st.d", "d,1,2") - _MC88xxx (0x20000000, "st.d", "d,1,I") - _MC88110 (0xf0002200, "st.d", "xd,1[2]") - _MC88110 (0xf0002000, "st.d", "xd,1,2") - _MC88110 (0x30000000, "st.d", "xd,1,I") - _MC88xxx (0xf4002100, "st.d.usr", "d,1,2") - _MC88xxx (0xf4002300, "st.d.usr", "d,1[2]") - _MC88110 (0xf0002100, "st.d.usr", "xd,1,2") - _MC88110 (0xf0002300, "st.d.usr", "xd,1[2]") - _MC88110 (0xf4002180, "st.d.usr.wt", "d,1,2") - _MC88110 (0xf4002380, "st.d.usr.wt", "d,1[2]") - _MC88110 (0xf0002180, "st.d.usr.wt", "xd,1,2") - _MC88110 (0xf0002380, "st.d.usr.wt", "xd,1[2]") - _MC88110 (0xf4002080, "st.d.wt", "d,1,2") - _MC88110 (0xf4002280, "st.d.wt", "d,1[2]") - _MC88110 (0xf0002080, "st.d.wt", "xd,1,2") - _MC88110 (0xf0002280, "st.d.wt", "xd,1[2]") - _MC88xxx (0xf4002a00, "st.h", "d,1[2]") - _MC88xxx (0xf4002800, "st.h", "d,1,2") - _MC88xxx (0x28000000, "st.h", "d,1,I") - _MC88xxx (0xf4002900, "st.h.usr", "d,1,2") - _MC88xxx (0xf4002b00, "st.h.usr", "d,1[2]") - _MC88110 (0xf4002980, "st.h.usr.wt", "d,1,2") - _MC88110 (0xf4002b80, "st.h.usr.wt", "d,1[2]") - _MC88110 (0xf4002880, "st.h.wt", "d,1,2") - _MC88110 (0xf4002a80, "st.h.wt", "d,1[2]") - _MC88xxx (0xf4002500, "st.usr", "d,1,2") - _MC88xxx (0xf4002700, "st.usr", "d,1[2]") - _MC88110 (0xf0002500, "st.usr", "xd,1,2") - _MC88110 (0xf0002700, "st.usr", "xd,1[2]") - _MC88110 (0xf4002580, "st.usr.wt", "d,1,2") - _MC88110 (0xf4002780, "st.usr.wt", "d,1[2]") - _MC88110 (0xf0002580, "st.usr.wt", "xd,1,2") - _MC88110 (0xf0002780, "st.usr.wt", "xd,1[2]") - _MC88110 (0xf4002480, "st.wt", "d,1,2") - _MC88110 (0xf4002680, "st.wt", "d,1[2]") - _MC88110 (0xf0002480, "st.wt", "xd,1,2") - _MC88110 (0xf0002680, "st.wt", "xd,1[2]") - _MC88110 (0xf0002a00, "st.x", "xd,1[2]") - _MC88110 (0xf0002800, "st.x", "xd,1,2") - _MC88110 (0x38000000, "st.x", "xd,1,I") - _MC88110 (0xf0002900, "st.x.usr", "xd,1,2") - _MC88110 (0xf0002b00, "st.x.usr", "xd,1[2]") - _MC88110 (0xf0002980, "st.x.usr.wt", "xd,1,2") - _MC88110 (0xf0002b80, "st.x.usr.wt", "xd,1[2]") - _MC88110 (0xf0002880, "st.x.wt", "xd,1,2") - _MC88110 (0xf0002a80, "st.x.wt", "xd,1[2]") - _MC88xxx (0x80008000, "stcr", "3,c") - _MC88xxx (0xf4007400, "sub", "d,1,2") - _MC88xxx (0x74000000, "sub", "d,1,I") - _MC88xxx (0xf4007600, "sub.ci", "d,1,2") - _MC88xxx (0xf4007700, "sub.cio", "d,1,2") - _MC88xxx (0xf4007500, "sub.co", "d,1,2") - _MC88xxx (0xf4006400, "subu", "d,1,2") - _MC88xxx (0x64000000, "subu", "d,1,I") - _MC88xxx (0xf4006600, "subu.ci", "d,1,2") - _MC88xxx (0xf4006700, "subu.cio", "d,1,2") - _MC88xxx (0xf4006500, "subu.co", "d,1,2") - _MC88xxx (0xf000d000, "tb0", "B,1,V") - _MC88xxx (0xf000d800, "tb1", "B,1,V") - _MC88xxx (0xf400f800, "tbnd", "1,2") - _MC88xxx (0xf8000000, "tbnd", "1,I") - _MC88xxx (0xf000e800, "tcnd", "M,1,V") - _MC88xxx (0x84005880, "trnc.sd", "d,2") - _MC88110 (0x8400d880, "trnc.sd", "d,x2") - _MC88xxx (0x84005800, "trnc.ss", "d,2") - _MC88110 (0x8400d800, "trnc.ss", "d,x2") - _MC88110 (0x8400d900, "trnc.sx", "d,x2") - _MC88xxx (0x8000c000, "xcr", "d,3,c") - _MC88xxx (0xf4000600, "xmem", "d,1[2]") - _MC88xxx (0xf4000400, "xmem", "d,1,2") - _MC88100 (0x04000000, "xmem", "?d,1,I") - _MC88xxx (0xf4000200, "xmem.bu", "d,1[2]") - _MC88xxx (0xf4000000, "xmem.bu", "d,1,2") - _MC88100 (0x00000000, "xmem.bu", "?d,1,I") - _MC88xxx (0xf4000300, "xmem.bu.usr", "d,1[2]") - _MC88xxx (0xf4000100, "xmem.bu.usr", "d,1,2") - _MC88100 (0x00000100, "xmem.bu.usr", "?d,1,I") - _MC88xxx (0xf4000700, "xmem.usr", "d,1[2]") - _MC88xxx (0xf4000500, "xmem.usr", "d,1,2") - _MC88100 (0x04000100, "xmem.usr", "?d,1,I") - _MC88xxx (0xf4005000, "xor", "d,1,2") - _MC88xxx (0x50000000, "xor", "d,1,I") - _MC88xxx (0xf4005400, "xor.c", "d,1,2") - _MC88xxx (0x54000000, "xor.u", "d,1,I") - _MC88xxx (0x00000000, "", 0) -}; - -#define NUMOPCODES ((sizeof m88k_opcodes)/(sizeof m88k_opcodes[0])) diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index eb71397..e99e63d 100644 --- a/gas/config/obj-aout.c +++ b/gas/config/obj-aout.c @@ -22,51 +22,10 @@ #define OBJ_HEADER "obj-aout.h" #include "as.h" -#ifdef BFD_ASSEMBLER #undef NO_RELOC #include "aout/aout64.h" -#endif #include "obstack.h" -#ifndef BFD_ASSEMBLER -/* in: segT out: N_TYPE bits. */ -const short seg_N_TYPE[] = -{ - N_ABS, - N_TEXT, - N_DATA, - N_BSS, - N_UNDF, /* Unknown. */ - N_UNDF, /* Error. */ - N_UNDF, /* Expression. */ - N_UNDF, /* Debug. */ - N_UNDF, /* Ntv. */ - N_UNDF, /* Ptv. */ - N_REGISTER, /* Register. */ -}; - -const segT N_TYPE_seg[N_TYPE + 2] = -{ /* N_TYPE == 0x1E = 32-2 */ - SEG_UNKNOWN, /* N_UNDF == 0 */ - SEG_GOOF, - SEG_ABSOLUTE, /* N_ABS == 2 */ - SEG_GOOF, - SEG_TEXT, /* N_TEXT == 4 */ - SEG_GOOF, - SEG_DATA, /* N_DATA == 6 */ - SEG_GOOF, - SEG_BSS, /* N_BSS == 8 */ - SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_REGISTER, /* Dummy N_REGISTER for regs = 30. */ - SEG_GOOF, -}; -#endif - -#ifdef BFD_ASSEMBLER - void obj_aout_frob_symbol (symbolS *sym, int *punt ATTRIBUTE_UNUSED) { @@ -176,137 +135,6 @@ obj_aout_frob_file_before_fix (void) assert (x); } -#else /* ! BFD_ASSEMBLER */ - -/* Relocation. */ - -/** Crawl along a fixS chain. Emit the segment's relocations. */ - -void -obj_emit_relocations (char **where, - fixS *fixP, /* Fixup chain for this segment. */ - relax_addressT segment_address_in_file) -{ - for (; fixP; fixP = fixP->fx_next) - if (fixP->fx_done == 0) - { - symbolS *sym; - - sym = fixP->fx_addsy; - while (sym->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym))) - sym = sym->sy_value.X_add_symbol; - fixP->fx_addsy = sym; - - if (! sym->sy_resolved && ! S_IS_DEFINED (sym)) - { - char *file; - unsigned int line; - - if (expr_symbol_where (sym, &file, &line)) - as_bad_where (file, line, _("unresolved relocation")); - else - as_bad (_("bad relocation: symbol `%s' not in symbol table"), - S_GET_NAME (sym)); - } - - tc_aout_fix_to_chars (*where, fixP, segment_address_in_file); - *where += md_reloc_size; - } -} - -#ifndef obj_header_append -/* Aout file generation & utilities. */ - -/* An AOUT header on disk is laid out in target byte order. */ - -void -obj_header_append (char **where, object_headers *headers) -{ - char *p; - - tc_headers_hook (headers); - -#ifdef __A_OUT_GNU_H__ -#define SIZEOF_HEADER(PIECE) (sizeof (((struct exec_bytes *) 0)->PIECE)) -#else -#define SIZEOF_HEADER(PIECE) 4 -#endif -#define DO(PIECE) \ - md_number_to_chars (p, headers->header.PIECE, SIZEOF_HEADER (PIECE)); \ - p += SIZEOF_HEADER (PIECE); - - p = *where; - DO (a_info); - DO (a_text); - DO (a_data); - DO (a_bss); - DO (a_syms); - DO (a_entry); - DO (a_trsize); - DO (a_drsize); - *where = p; -#undef DO -#undef SIZEOF_HEADER -} -#endif /* ! defined (obj_header_append) */ - -void -obj_symbol_to_chars (char **where, symbolS *symbolP) -{ - char *p = *where; - md_number_to_chars (p, S_GET_OFFSET (symbolP), 4); - p += 4; - /* Can't use S_GET_TYPE here as it masks. */ - *p++ = symbolP->sy_symbol.n_type; - *p++ = symbolP->sy_symbol.n_other; - md_number_to_chars (p, S_GET_DESC (symbolP), 2); - p += 2; - md_number_to_chars (p, S_GET_VALUE (symbolP), 4); - p += 4; - *where = p; -} - -void -obj_emit_symbols (char **where, symbolS *symbol_rootP) -{ - symbolS *symbolP; - - /* Emit all symbols left in the symbol chain. */ - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - { - /* Used to save the offset of the name. It is used to point - to the string in memory but must be a file offset. */ - char *temp; - - temp = S_GET_NAME (symbolP); - S_SET_OFFSET (symbolP, symbolP->sy_name_offset); - - /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */ - if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP)) - S_SET_EXTERNAL (symbolP); - - /* Adjust the type of a weak symbol. */ - if (S_GET_WEAK (symbolP)) - { - switch (S_GET_TYPE (symbolP)) - { - case N_UNDF: S_SET_TYPE (symbolP, N_WEAKU); break; - case N_ABS: S_SET_TYPE (symbolP, N_WEAKA); break; - case N_TEXT: S_SET_TYPE (symbolP, N_WEAKT); break; - case N_DATA: S_SET_TYPE (symbolP, N_WEAKD); break; - case N_BSS: S_SET_TYPE (symbolP, N_WEAKB); break; - default: as_bad (_("%s: bad type for weak symbol"), temp); break; - } - } - - obj_symbol_to_chars (where, symbolP); - S_SET_NAME (symbolP, temp); - } -} - -#endif /* ! BFD_ASSEMBLER */ - static void obj_aout_line (int ignore ATTRIBUTE_UNUSED) { @@ -381,136 +209,6 @@ obj_aout_type (int ignore ATTRIBUTE_UNUSED) s_ignore (0); } -#ifndef BFD_ASSEMBLER - -void -obj_crawl_symbol_chain (object_headers *headers) -{ - symbolS *symbolP; - symbolS **symbolPP; - int symbol_number = 0; - - tc_crawl_symbol_chain (headers); - - symbolPP = &symbol_rootP; /*->last symbol chain link. */ - while ((symbolP = *symbolPP) != NULL) - { - if (symbolP->sy_mri_common) - { - if (S_IS_EXTERNAL (symbolP)) - as_bad (_("%s: global symbols not supported in common sections"), - S_GET_NAME (symbolP)); - *symbolPP = symbol_next (symbolP); - continue; - } - - if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA)) - { - S_SET_SEGMENT (symbolP, SEG_TEXT); - } - - resolve_symbol_value (symbolP); - - /* Skip symbols which were equated to undefined or common - symbols. Also skip defined uncommon symbols which can - be resolved since in this case they should have been - resolved to a non-symbolic constant. */ - if (symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (symbolP) - || S_IS_COMMON (symbolP) - || symbol_resolved_p (symbolP))) - { - *symbolPP = symbol_next (symbolP); - continue; - } - - /* OK, here is how we decide which symbols go out into the brave - new symtab. Symbols that do are: - - * symbols with no name (stabd's?) - * symbols with debug info in their N_TYPE - - Symbols that don't are: - * symbols that are registers - * symbols with \1 as their 3rd character (numeric labels) - * "local labels" as defined by S_LOCAL_NAME(name) if the -L - switch was passed to gas. - - All other symbols are output. We complain if a deleted - symbol was marked external. */ - - if (!S_IS_REGISTER (symbolP) - && (!S_GET_NAME (symbolP) - || S_IS_DEBUG (symbolP) - || !S_IS_DEFINED (symbolP) - || S_IS_EXTERNAL (symbolP) - || (S_GET_NAME (symbolP)[0] != '\001' - && (flag_keep_locals || !S_LOCAL_NAME (symbolP))))) - { - symbolP->sy_number = symbol_number++; - - /* The + 1 after strlen account for the \0 at the - end of each string */ - if (!S_IS_STABD (symbolP)) - { - /* Ordinary case. */ - symbolP->sy_name_offset = string_byte_count; - string_byte_count += strlen (S_GET_NAME (symbolP)) + 1; - } - else /* .Stabd case. */ - symbolP->sy_name_offset = 0; - symbolPP = &symbolP->sy_next; - } - else - { - if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP)) - /* This warning should never get triggered any more. - Well, maybe if you're doing twisted things with - register names... */ - as_bad (_("Local symbol %s never defined."), - decode_local_label_name (S_GET_NAME (symbolP))); - - /* Unhook it from the chain */ - *symbolPP = symbol_next (symbolP); - } - } - - H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number); -} - -/* Find strings by crawling along symbol table chain. */ - -void -obj_emit_strings (char **where) -{ - symbolS *symbolP; - - md_number_to_chars (*where, string_byte_count, 4); - *where += 4; - - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - if (S_GET_NAME (symbolP)) - append (where, S_GET_NAME (symbolP), - (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1)); -} - -#ifndef AOUT_VERSION -#define AOUT_VERSION 0 -#endif - -void -obj_pre_write_hook (object_headers *headers) -{ - H_SET_DYNAMIC (headers, 0); - H_SET_VERSION (headers, AOUT_VERSION); - H_SET_MACHTYPE (headers, AOUT_MACHTYPE); - tc_aout_pre_write_hook (headers); -} - -#endif /* ! BFD_ASSEMBLER */ - -#ifdef BFD_ASSEMBLER - /* Support for an AOUT emulation. */ static void @@ -614,7 +312,6 @@ const struct format_ops aout_format_ops = 0, /* read_begin_hook. */ 0 /* symbol_new_hook. */ }; -#endif /* BFD_ASSEMBLER */ const pseudo_typeS aout_pseudo_table[] = { diff --git a/gas/config/obj-aout.h b/gas/config/obj-aout.h index d5383d1..4acc420 100644 --- a/gas/config/obj-aout.h +++ b/gas/config/obj-aout.h @@ -24,33 +24,10 @@ #include "targ-cpu.h" -#ifdef BFD_ASSEMBLER - #include "bfd/libaout.h" #define OUTPUT_FLAVOR bfd_target_aout_flavour -#else /* ! BFD_ASSEMBLER */ - -#ifndef VMS -#include "aout_gnu.h" /* Needed to define struct nlist. Sigh. */ -#else -#include "a_out.h" -#endif - -#ifndef AOUT_MACHTYPE -#define AOUT_MACHTYPE 0 -#endif /* AOUT_MACHTYPE */ - -extern const short seg_N_TYPE[]; -extern const segT N_TYPE_seg[]; - -#ifndef DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (OMAGIC) -#endif /* DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE */ - -#endif /* ! BFD_ASSEMBLER */ - extern const pseudo_typeS aout_pseudo_table[]; #ifndef obj_pop_insert @@ -63,8 +40,6 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry. */ /* Symbol table macros and constants */ -#ifdef BFD_ASSEMBLER - #define S_SET_OTHER(S,V) \ (aout_symbol (symbol_get_bfdsym (S))->other = (V)) #define S_SET_TYPE(S,T) \ @@ -88,163 +63,6 @@ extern void obj_aout_frob_file_before_fix (void); #define obj_sec_sym_ok_for_reloc(SEC) 1 -#else - -/* We use the sy_obj field to record whether a symbol is weak. */ -#define OBJ_SYMFIELD_TYPE char - -/* Macros to extract information from a symbol table entry. - This syntactic indirection allows independence regarding a.out or coff. - The argument (s) of all these macros is a pointer to a symbol table entry. */ - -/* True if the symbol is external. */ -#define S_IS_EXTERNAL(s) ((s)->sy_symbol.n_type & N_EXT) - -/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT. */ -#define S_IS_DEFINED(s) \ - (S_GET_TYPE (s) != N_UNDF || S_GET_DESC (s) != 0) - -#define S_IS_COMMON(s) \ - (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0) - -/* Return true for symbols that should not be reduced to section - symbols or eliminated from expressions, because they may be - overridden by the linker. */ -#define S_FORCE_RELOC(s, strict) \ - (!SEG_NORMAL (S_GET_SEGMENT (s))) - -#define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER) - -/* True if a debug special symbol entry. */ -#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB) -/* True if a symbol is local symbol name. */ -#define S_IS_LOCAL(s) \ - ((S_GET_NAME (s) \ - && !S_IS_DEBUG (s) \ - && (strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL \ - || (S_LOCAL_NAME(s) && !flag_keep_locals))) \ - || (flag_strip_local_absolute \ - && ! S_IS_EXTERNAL(s) \ - && S_GET_SEGMENT (s) == absolute_section)) -/* True if the symbol has been generated because of a .stabd directive. */ -#define S_IS_STABD(s) (S_GET_NAME(s) == NULL) - -/* Accessors. */ -/* The name of the symbol. */ -#define S_GET_NAME(s) ((s)->sy_symbol.n_un.n_name) -/* The pointer to the string table. */ -#define S_GET_OFFSET(s) ((s)->sy_symbol.n_un.n_strx) -/* The type of the symbol. */ -#define S_GET_TYPE(s) ((s)->sy_symbol.n_type & N_TYPE) -/* The numeric value of the segment. */ -#define S_GET_SEGMENT(s) (N_TYPE_seg[S_GET_TYPE(s)]) -/* The n_other expression value. */ -#define S_GET_OTHER(s) ((s)->sy_symbol.n_other) -/* The n_desc expression value. */ -#define S_GET_DESC(s) ((s)->sy_symbol.n_desc) -/* Whether the symbol is weak. */ -#define S_GET_WEAK(s) ((s)->sy_obj) - -/* Modifiers. */ -/* Assume that a symbol cannot be simultaneously in more than on segment. */ -/* Set segment. */ -#define S_SET_SEGMENT(s,seg) ((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type |= SEGMENT_TO_SYMBOL_TYPE (seg)) -/* The symbol is external. */ -#define S_SET_EXTERNAL(s) ((s)->sy_symbol.n_type |= N_EXT) -/* The symbol is not external. */ -#define S_CLEAR_EXTERNAL(s) ((s)->sy_symbol.n_type &= ~N_EXT) -/* Set the name of the symbol. */ -#define S_SET_NAME(s,v) ((s)->sy_symbol.n_un.n_name = (v)) -/* Set the offset in the string table. */ -#define S_SET_OFFSET(s,v) ((s)->sy_symbol.n_un.n_strx = (v)) -/* Set the n_type field. */ -#define S_SET_TYPE(s,t) ((s)->sy_symbol.n_type = (t)) -/* Set the n_other expression value. */ -#define S_SET_OTHER(s,v) ((s)->sy_symbol.n_other = (v)) -/* Set the n_desc expression value. */ -#define S_SET_DESC(s,v) ((s)->sy_symbol.n_desc = (v)) -/* Mark the symbol as weak. This causes n_type to be adjusted when - the symbol is written out. */ -#define S_SET_WEAK(s) ((s)->sy_obj = 1) - -/* File header macro and type definition. */ - -#define H_GET_FILE_SIZE(h) (H_GET_HEADER_SIZE (h) \ - + H_GET_TEXT_SIZE (h) \ - + H_GET_DATA_SIZE (h) \ - + H_GET_TEXT_RELOCATION_SIZE (h) \ - + H_GET_DATA_RELOCATION_SIZE (h) \ - + H_GET_LINENO_SIZE (h) \ - + H_GET_SYMBOL_TABLE_SIZE (h) \ - + H_GET_STRING_SIZE (h)) - -#define H_GET_HEADER_SIZE(h) (EXEC_BYTES_SIZE) -#define H_GET_TEXT_SIZE(h) ((h)->header.a_text) -#define H_GET_DATA_SIZE(h) ((h)->header.a_data) -#define H_GET_BSS_SIZE(h) ((h)->header.a_bss) -#define H_GET_TEXT_RELOCATION_SIZE(h) ((h)->header.a_trsize) -#define H_GET_DATA_RELOCATION_SIZE(h) ((h)->header.a_drsize) -#define H_GET_SYMBOL_TABLE_SIZE(h) ((h)->header.a_syms) -#define H_GET_ENTRY_POINT(h) ((h)->header.a_entry) -#define H_GET_STRING_SIZE(h) ((h)->string_table_size) -#define H_GET_LINENO_SIZE(h) (0) - -#define H_GET_DYNAMIC(h) ((h)->header.a_info >> 31) -#define H_GET_VERSION(h) (((h)->header.a_info >> 24) & 0x7f) -#define H_GET_MACHTYPE(h) (((h)->header.a_info >> 16) & 0xff) -#define H_GET_MAGIC_NUMBER(h) ((h)->header.a_info & 0xffff) - -#define H_SET_DYNAMIC(h,v) ((h)->header.a_info = (((v) << 31) \ - | (H_GET_VERSION (h) << 24) \ - | (H_GET_MACHTYPE (h) << 16) \ - | (H_GET_MAGIC_NUMBER (h)))) - -#define H_SET_VERSION(h,v) ((h)->header.a_info = ((H_GET_DYNAMIC (h) << 31) \ - | ((v) << 24) \ - | (H_GET_MACHTYPE (h) << 16) \ - | (H_GET_MAGIC_NUMBER (h)))) - -#define H_SET_MACHTYPE(h,v) ((h)->header.a_info = ((H_GET_DYNAMIC (h) << 31) \ - | (H_GET_VERSION (h) << 24) \ - | ((v) << 16) \ - | (H_GET_MAGIC_NUMBER (h)))) - -#define H_SET_MAGIC_NUMBER(h,v) ((h)->header.a_info = ((H_GET_DYNAMIC (h) << 31) \ - | (H_GET_VERSION (h) << 24) \ - | (H_GET_MACHTYPE (h) << 16) \ - | ((v)))) - -#define H_SET_TEXT_SIZE(h,v) ((h)->header.a_text = md_section_align (SEG_TEXT, (v))) -#define H_SET_DATA_SIZE(h,v) ((h)->header.a_data = md_section_align (SEG_DATA, (v))) -#define H_SET_BSS_SIZE(h,v) ((h)->header.a_bss = md_section_align (SEG_BSS, (v))) - -#define H_SET_RELOCATION_SIZE(h,t,d) (H_SET_TEXT_RELOCATION_SIZE ((h),(t)),\ - H_SET_DATA_RELOCATION_SIZE ((h),(d))) - -#define H_SET_TEXT_RELOCATION_SIZE(h,v) ((h)->header.a_trsize = (v)) -#define H_SET_DATA_RELOCATION_SIZE(h,v) ((h)->header.a_drsize = (v)) -#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * 12) - -#define H_SET_ENTRY_POINT(h,v) ((h)->header.a_entry = (v)) -#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) - -typedef struct -{ - struct exec header; /* a.out header. */ - long string_table_size; /* names + '\0' + sizeof (int). */ -} - -object_headers; - -/* Line numbering stuff. */ -#define OBJ_EMIT_LINENO(a, b, c) {;} - -struct fix; -extern void tc_aout_fix_to_chars (char *, struct fix *, relax_addressT); - -#endif - #define obj_read_begin_hook() {;} #define obj_symbol_new_hook(s) {;} diff --git a/gas/config/obj-bout.c b/gas/config/obj-bout.c deleted file mode 100644 index 2b35dd9..0000000 --- a/gas/config/obj-bout.c +++ /dev/null @@ -1,324 +0,0 @@ -/* b.out object file format - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002, - 2003, 2005 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 2, - 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "as.h" -#include "obstack.h" - -/* In: segT Out: N_TYPE bits. */ -const short seg_N_TYPE[] = -{ - N_ABS, - N_TEXT, - N_DATA, - N_BSS, - N_UNDF, /* Unknown. */ - N_UNDF, /* Error. */ - N_UNDF, /* Expression. */ - N_UNDF, /* Debug. */ - N_UNDF, /* Ntv. */ - N_UNDF, /* Ptv. */ - N_REGISTER, /* Register. */ -}; - -const segT N_TYPE_seg[N_TYPE + 2] = -{ /* N_TYPE == 0x1E = 32-2 */ - SEG_UNKNOWN, /* N_UNDF == 0 */ - SEG_GOOF, - SEG_ABSOLUTE, /* N_ABS == 2 */ - SEG_GOOF, - SEG_TEXT, /* N_TEXT == 4 */ - SEG_GOOF, - SEG_DATA, /* N_DATA == 6 */ - SEG_GOOF, - SEG_BSS, /* N_BSS == 8 */ - SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_REGISTER, /* Dummy N_REGISTER for regs = 30. */ - SEG_GOOF, -}; - -/* Relocation. */ - -/* Crawl along a fixS chain. Emit the segment's relocations. */ - -void -obj_emit_relocations (char **where, - fixS *fixP, /* Fixup chain for this segment. */ - relax_addressT segment_address_in_file) -{ - for (; fixP; fixP = fixP->fx_next) - { - if (fixP->fx_done == 0 - || fixP->fx_r_type != NO_RELOC) - { - symbolS *sym; - - sym = fixP->fx_addsy; - while (sym->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (sym) || S_IS_COMMON (sym))) - sym = sym->sy_value.X_add_symbol; - fixP->fx_addsy = sym; - - tc_bout_fix_to_chars (*where, fixP, segment_address_in_file); - *where += md_reloc_size; - } - } -} - -/* Aout file generation & utilities . */ - -/* Convert a lvalue to machine dependent data. */ - -void -obj_header_append (char **where, object_headers *headers) -{ - /* Always leave in host byte order. */ - char *p; - - headers->header.a_talign = section_alignment[SEG_TEXT]; - - /* Force to at least 2. */ - if (headers->header.a_talign < 2) - headers->header.a_talign = 2; - - headers->header.a_dalign = section_alignment[SEG_DATA]; - headers->header.a_balign = section_alignment[SEG_BSS]; - - headers->header.a_tload = 0; - headers->header.a_dload = - md_section_align (SEG_DATA, H_GET_TEXT_SIZE (headers)); - - headers->header.a_relaxable = linkrelax; - - p = *where; - host_number_to_chars (p, headers->header.a_magic, 4); - p += 4; - host_number_to_chars (p, headers->header.a_text, 4); - p += 4; - host_number_to_chars (p, headers->header.a_data, 4); - p += 4; - host_number_to_chars (p, headers->header.a_bss, 4); - p += 4; - host_number_to_chars (p, headers->header.a_syms, 4); - p += 4; - host_number_to_chars (p, headers->header.a_entry, 4); - p += 4; - host_number_to_chars (p, headers->header.a_trsize, 4); - p += 4; - host_number_to_chars (p, headers->header.a_drsize, 4); - p += 4; - host_number_to_chars (p, headers->header.a_tload, 4); - p += 4; - host_number_to_chars (p, headers->header.a_dload, 4); - p += 4; - *p++ = headers->header.a_talign; - *p++ = headers->header.a_dalign; - *p++ = headers->header.a_balign; - *p++ = headers->header.a_relaxable; - *where = p; -} - -void -obj_symbol_to_chars (char **where, symbolS *symbolP) -{ - char *p = *where; - - host_number_to_chars (p, S_GET_OFFSET (symbolP), 4); - p += 4; - /* Can't use S_GET_TYPE here as it masks. */ - *p++ = symbolP->sy_symbol.n_type; - *p++ = symbolP->sy_symbol.n_other; - host_number_to_chars (p, S_GET_DESC (symbolP), 2); - p += 2; - host_number_to_chars (p, S_GET_VALUE (symbolP), 4); - p += 4; - *where = p; -} - -void -obj_emit_symbols (char **where, symbolS *symbol_rootP) -{ - symbolS *symbolP; - - /* Emit all symbols left in the symbol chain. */ - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - { - /* Used to save the offset of the name. It is used to point to - the string in memory but must be a file offset. */ - char *temp; - - temp = S_GET_NAME (symbolP); - S_SET_OFFSET (symbolP, symbolP->sy_name_offset); - - /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */ - if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP)) - S_SET_EXTERNAL (symbolP); - - obj_symbol_to_chars (where, symbolP); - S_SET_NAME (symbolP, temp); - } -} - -void -obj_symbol_new_hook (symbolS *symbolP) -{ - S_SET_OTHER (symbolP, 0); - S_SET_DESC (symbolP, 0); -} - -static void -obj_bout_line (int ignore ATTRIBUTE_UNUSED) -{ - /* Assume delimiter is part of expression. */ - /* BSD4.2 as fails with delightful bug, so we are not being - incompatible here. */ - new_logical_line (NULL, (int) (get_absolute_expression ())); - demand_empty_rest_of_line (); -} - -void -obj_read_begin_hook (void) -{ -} - -void -obj_crawl_symbol_chain (object_headers *headers) -{ - symbolS **symbolPP; - symbolS *symbolP; - int symbol_number = 0; - - tc_crawl_symbol_chain (headers); - - symbolPP = &symbol_rootP; /* -> last symbol chain link. */ - while ((symbolP = *symbolPP) != NULL) - { - if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA)) - { - S_SET_SEGMENT (symbolP, SEG_TEXT); - } - - resolve_symbol_value (symbolP); - - /* Skip symbols which were equated to undefined or common - symbols. */ - if (symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))) - { - *symbolPP = symbol_next (symbolP); - continue; - } - - /* OK, here is how we decide which symbols go out into the - brave new symtab. Symbols that do are: - - * symbols with no name (stabd's?) - * symbols with debug info in their N_TYPE - - Symbols that don't are: - * symbols that are registers - * symbols with \1 as their 3rd character (numeric labels) - * "local labels" as defined by S_LOCAL_NAME(name) - if the -L switch was passed to gas. - - All other symbols are output. We complain if a deleted - symbol was marked external. */ - - if (1 - && !S_IS_REGISTER (symbolP) - && (!S_GET_NAME (symbolP) - || S_IS_DEBUG (symbolP) -#ifdef TC_I960 - /* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */ - || !S_IS_DEFINED (symbolP) - || S_IS_EXTERNAL (symbolP) -#endif - || (S_GET_NAME (symbolP)[0] != '\001' - && (flag_keep_locals || !S_LOCAL_NAME (symbolP))))) - { - symbolP->sy_number = symbol_number++; - - /* The + 1 after strlen account for the \0 at the end of - each string. */ - if (!S_IS_STABD (symbolP)) - { - /* Ordinary case. */ - symbolP->sy_name_offset = string_byte_count; - string_byte_count += strlen (S_GET_NAME (symbolP)) + 1; - } - else /* .Stabd case. */ - symbolP->sy_name_offset = 0; - symbolPP = &(symbolP->sy_next); - } - else - { - if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP)) - as_bad (_("Local symbol %s never defined"), - S_GET_NAME (symbolP)); - - /* Unhook it from the chain. */ - *symbolPP = symbol_next (symbolP); - } - } - - H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number); -} - -/* Find strings by crawling along symbol table chain. */ - -void -obj_emit_strings (char **where) -{ - symbolS *symbolP; - - md_number_to_chars (*where, string_byte_count, 4); - *where += 4; - - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - if (S_GET_NAME (symbolP)) - append (where, S_GET_NAME (symbolP), - (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1)); -} - -const pseudo_typeS obj_pseudo_table[] = -{ - {"line", obj_bout_line, 0}, /* Source code line number. */ - - /* COFF debugging directives. Currently ignored silently. */ - {"def", s_ignore, 0}, - {"dim", s_ignore, 0}, - {"endef", s_ignore, 0}, - {"ln", s_ignore, 0}, - {"scl", s_ignore, 0}, - {"size", s_ignore, 0}, - {"tag", s_ignore, 0}, - {"type", s_ignore, 0}, - {"val", s_ignore, 0}, - - /* Other stuff we don't handle. */ - {"ABORT", s_ignore, 0}, - {"ident", s_ignore, 0}, - - {NULL, NULL, 0} -}; - diff --git a/gas/config/obj-bout.h b/gas/config/obj-bout.h deleted file mode 100644 index 36e5754..0000000 --- a/gas/config/obj-bout.h +++ /dev/null @@ -1,310 +0,0 @@ -/* b.out object file format - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, - 2002, 2003, 2005 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 2, - 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, 51 Franklin Street - Fifth Floor, Cambridge, MA - 02139, USA. */ - -/* This file is a modified version of 'a.out.h'. It is to be used in all GNU - tools modified to support the i80960 b.out format (or tools that operate on - object files created by such tools). - - All i80960 development is done in a CROSS-DEVELOPMENT environment. I.e., - object code is generated on, and executed under the direction of a symbolic - debugger running on, a host system. We do not want to be subject to the - vagaries of which host it is or whether it supports COFF or a.out format, or - anything else. We DO want to: - - o always generate the same format object files, regardless of host. - - o have an 'a.out' header that we can modify for our own purposes - (the 80960 is typically an embedded processor and may require - enhanced linker support that the normal a.out.h header can't - accommodate). - - As for byte-ordering, the following rules apply: - - o Text and data that is actually downloaded to the target is always - in i80960 (little-endian) order. - - o All other numbers (in the header, symbols, relocation directives) - are in host byte-order: object files CANNOT be lifted from a - little-end host and used on a big-endian (or vice versa) without - modification. - ==> This is no longer true using BFD. We can generate any byte order - for the header, and read any byte order. Preference would be to - use little-endian byte order throughout, regardless of host. <== - - o The downloader ('comm960') takes care to generate a pseudo-header - with correct (i80960) byte-ordering before shipping text and data - off to the NINDY monitor in the target systems. Symbols and - relocation info are never sent to the target. */ - -#define OBJ_BOUT 1 - -#define OUTPUT_FLAVOR bfd_target_aout_flavour - -#include "targ-cpu.h" - -#define OBJ_DEFAULT_OUTPUT_FILE_NAME "b.out" - -extern const short seg_N_TYPE[]; -extern const segT N_TYPE_seg[]; - -#define BMAGIC 0415 -/* We don't accept the following (see N_BADMAG macro). - They're just here so GNU code will compile. */ -#define OMAGIC 0407 /* Old impure format. */ -#define NMAGIC 0410 /* Read-only text. */ -#define ZMAGIC 0413 /* Demand load format. */ - -#ifndef DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE BMAGIC -#endif - -/* File header: - All 'lengths' are given as a number of bytes. - All 'alignments' are for relinkable files only; an alignment of - 'n' indicates the corresponding segment must begin at an - address that is a multiple of (2**n). */ -struct exec -{ - /* Standard stuff. */ - unsigned long a_magic; /* Identifies this as a b.out file. */ - unsigned long a_text; /* Length of text. */ - unsigned long a_data; /* Length of data. */ - unsigned long a_bss; /* Length of runtime uninitialized data area. */ - unsigned long a_syms; /* Length of symbol table. */ - unsigned long a_entry; /* Runtime start address. */ - unsigned long a_trsize; /* Length of text relocation info. */ - unsigned long a_drsize; /* Length of data relocation info. */ - - /* Added for i960 */ - unsigned long a_tload; /* Text runtime load address. */ - unsigned long a_dload; /* Data runtime load address. */ - unsigned char a_talign; /* Alignment of text segment. */ - unsigned char a_dalign; /* Alignment of data segment. */ - unsigned char a_balign; /* Alignment of bss segment. */ - unsigned char a_relaxable; /* Contains enough info to relax. */ -}; - -#define EXEC_BYTES_SIZE (10 * 4 + 4 * 1) - -#define N_BADMAG(x) (((x).a_magic) != BMAGIC) -#define N_TXTOFF(x) EXEC_BYTES_SIZE -#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) -#define N_TROFF(x) ( N_DATOFF(x) + (x).a_data ) -#define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize ) -#define N_SYMOFF(x) ( N_DROFF(x) + (x).a_drsize ) -#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms ) - -/* A single entry in the symbol table. */ -struct nlist - { - union - { - char *n_name; - struct nlist *n_next; - long n_strx; /* Index into string table. */ - } - n_un; - unsigned char n_type; /* See below. */ - char n_other; /* Used in i80960 support -- see below. */ - short n_desc; - unsigned long n_value; - }; - -typedef struct nlist obj_symbol_type; - -/* Legal values of n_type. */ -#define N_UNDF 0 /* Undefined symbol. */ -#define N_ABS 2 /* Absolute symbol. */ -#define N_TEXT 4 /* Text symbol. */ -#define N_DATA 6 /* Data symbol. */ -#define N_BSS 8 /* BSS symbol. */ -#define N_FN 31 /* Filename symbol. */ - -#define N_EXT 1 /* External symbol (OR'd in with one of above). */ -#define N_TYPE 036 /* Mask for all the type bits. */ -#define N_STAB 0340 /* Mask for all bits used for SDB entries. */ - -#ifndef CUSTOM_RELOC_FORMAT -struct relocation_info - { - int r_address; /* File address of item to be relocated. */ - unsigned - r_index:24, /* Index of symbol on which relocation is based. */ - r_pcrel:1, /* 1 => relocate PC-relative; else absolute - On i960, pc-relative implies 24-bit - address, absolute implies 32-bit. */ - r_length:2, /* Number of bytes to relocate: - 0 => 1 byte - 1 => 2 bytes - 2 => 4 bytes -- only value used for i960. */ - r_extern:1, r_bsr:1, /* Something for the GNU NS32K assembler. */ - r_disp:1, /* Something for the GNU NS32K assembler. */ - r_callj:1, /* 1 if relocation target is an i960 'callj'. */ - nuthin:1; /* Unused. */ - }; - -#endif /* CUSTOM_RELOC_FORMAT */ - -/* Macros to extract information from a symbol table entry. - This syntactic indirection allows independence regarding a.out or coff. - The argument (s) of all these macros is a pointer to a symbol table entry. */ - -/* Predicates. */ -/* True if the symbol is external. */ -#define S_IS_EXTERNAL(s) ((s)->sy_symbol.n_type & N_EXT) - -/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT. */ -#define S_IS_DEFINED(s) ((S_GET_TYPE(s) != N_UNDF) || (S_GET_DESC(s) != 0)) - -/* Return true for symbols that should not be reduced to section - symbols or eliminated from expressions, because they may be - overridden by the linker. */ -#define S_FORCE_RELOC(s, strict) \ - (!SEG_NORMAL (S_GET_SEGMENT (s))) - -#define S_IS_COMMON(s) \ - (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0) - -#define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER) - -/* True if a debug special symbol entry. */ -#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB) -/* True if a symbol is local symbol name. */ -#define S_IS_LOCAL(s) \ - ((S_GET_NAME (s) \ - && !S_IS_DEBUG (s) \ - && (strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL \ - || (S_LOCAL_NAME(s) && !flag_keep_locals))) \ - || (flag_strip_local_absolute \ - && !S_IS_EXTERNAL(s) \ - && S_GET_SEGMENT(s) == absolute_section)) -/* True if the symbol has been generated because of a .stabd directive. */ -#define S_IS_STABD(s) (S_GET_NAME(s) == NULL) - -/* Accessors. */ -/* The name of the symbol. */ -#define S_GET_NAME(s) ((s)->sy_symbol.n_un.n_name) -/* The pointer to the string table. */ -#define S_GET_OFFSET(s) ((s)->sy_symbol.n_un.n_strx) -/* The type of the symbol. */ -#define S_GET_TYPE(s) ((s)->sy_symbol.n_type & N_TYPE) -/* The numeric value of the segment. */ -#define S_GET_SEGMENT(s) (N_TYPE_seg[S_GET_TYPE(s)]) -/* The n_other expression value. */ -#define S_GET_OTHER(s) ((s)->sy_symbol.n_other) -/* The n_desc expression value. */ -#define S_GET_DESC(s) ((s)->sy_symbol.n_desc) - -/* Modifiers. */ -/* Assume that a symbol cannot be simultaneously in more than on segment. */ -/* Set segment. */ -#define S_SET_SEGMENT(s,seg) ((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type |= SEGMENT_TO_SYMBOL_TYPE (seg)) -/* The symbol is external. */ -#define S_SET_EXTERNAL(s) ((s)->sy_symbol.n_type |= N_EXT) -/* The symbol is not external. */ -#define S_CLEAR_EXTERNAL(s) ((s)->sy_symbol.n_type &= ~N_EXT) -/* Set the name of the symbol. */ -#define S_SET_NAME(s,v) ((s)->sy_symbol.n_un.n_name = (v)) -/* Set the offset in the string table. */ -#define S_SET_OFFSET(s,v) ((s)->sy_symbol.n_un.n_strx = (v)) -/* Set the n_other expression value. */ -#define S_SET_OTHER(s,v) ((s)->sy_symbol.n_other = (v)) -/* Set the n_desc expression value. */ -#define S_SET_DESC(s,v) ((s)->sy_symbol.n_desc = (v)) -/* Set the n_type value. */ -#define S_SET_TYPE(s,v) ((s)->sy_symbol.n_type = (v)) - -/* File header macro and type definition. */ - -#define H_GET_FILE_SIZE(h) (EXEC_BYTES_SIZE \ - + H_GET_TEXT_SIZE (h) \ - + H_GET_DATA_SIZE(h) \ - + H_GET_SYMBOL_TABLE_SIZE (h) \ - + H_GET_TEXT_RELOCATION_SIZE (h) \ - + H_GET_DATA_RELOCATION_SIZE (h) \ - + (h)->string_table_size) - -#define H_GET_HEADER_SIZE(h) EXEC_BYTES_SIZE -#define H_GET_TEXT_SIZE(h) ((h)->header.a_text) -#define H_GET_DATA_SIZE(h) ((h)->header.a_data) -#define H_GET_BSS_SIZE(h) ((h)->header.a_bss) -#define H_GET_TEXT_RELOCATION_SIZE(h) ((h)->header.a_trsize) -#define H_GET_DATA_RELOCATION_SIZE(h) ((h)->header.a_drsize) -#define H_GET_SYMBOL_TABLE_SIZE(h) ((h)->header.a_syms) -#define H_GET_MAGIC_NUMBER(h) ((h)->header.a_info) -#define H_GET_ENTRY_POINT(h) ((h)->header.a_entry) -#define H_GET_STRING_SIZE(h) ((h)->string_table_size) -#define H_GET_LINENO_SIZE(h) (0) - -#ifdef EXEC_MACHINE_TYPE -#define H_GET_MACHINE_TYPE(h) ((h)->header.a_machtype) -#endif /* EXEC_MACHINE_TYPE. */ -#ifdef EXEC_VERSION -#define H_GET_VERSION(h) ((h)->header.a_version) -#endif /* EXEC_VERSION. */ - -#define H_SET_TEXT_SIZE(h,v) ((h)->header.a_text = (v)) -#define H_SET_DATA_SIZE(h,v) ((h)->header.a_data = (v)) -#define H_SET_BSS_SIZE(h,v) ((h)->header.a_bss = (v)) - -#define H_SET_RELOCATION_SIZE(h,t,d) (H_SET_TEXT_RELOCATION_SIZE((h),(t)),\ - H_SET_DATA_RELOCATION_SIZE((h),(d))) - -#define H_SET_TEXT_RELOCATION_SIZE(h,v) ((h)->header.a_trsize = (v)) -#define H_SET_DATA_RELOCATION_SIZE(h,v) ((h)->header.a_drsize = (v)) -#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * 12) - -#define H_SET_MAGIC_NUMBER(h,v) ((h)->header.a_magic = (v)) - -#define H_SET_ENTRY_POINT(h,v) ((h)->header.a_entry = (v)) -#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) -#ifdef EXEC_MACHINE_TYPE -#define H_SET_MACHINE_TYPE(h,v) ((h)->header.a_machtype = (v)) -#endif /* EXEC_MACHINE_TYPE. */ -#ifdef EXEC_VERSION -#define H_SET_VERSION(h,v) ((h)->header.a_version = (v)) -#endif /* EXEC_VERSION. */ - -typedef struct - { - struct exec header; /* a.out header. */ - long string_table_size; /* names + '\0' + sizeof (int). */ - } - -object_headers; - -/* Unused hooks. */ -#define OBJ_EMIT_LINENO(a, b, c) {;} -#define obj_pre_write_hook(a) {;} - -#if WORDS_BIGENDIAN -#define host_number_to_chars number_to_chars_bigendian -#else -#define host_number_to_chars number_to_chars_littleendian -#endif - -struct fix; - -extern void tc_aout_fix_to_chars (char *, struct fix *, relax_addressT); -extern void tc_bout_fix_to_chars (char *, struct fix *, relax_addressT); - -#define AOUT_STABS diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 6054726..98b901b 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -38,9 +38,9 @@ #define KEEP_RELOC_INFO #endif -/* The BFD_ASSEMBLER version of obj_coff_section will use this macro to set - a new section's attributes when a directive has no valid flags or the - "w" flag is used. This default should be appropriate for most. */ +/* obj_coff_section will use this macro to set a new section's + attributes when a directive has no valid flags or the "w" flag is + used. This default should be appropriate for most. */ #ifndef TC_COFF_SECTION_DEFAULT_ATTRIBUTES #define TC_COFF_SECTION_DEFAULT_ATTRIBUTES (SEC_LOAD | SEC_DATA) #endif @@ -151,9 +151,7 @@ tag_find_or_make (char *name) 0, &zero_address_frag); tag_insert (S_GET_NAME (symbolP), symbolP); -#ifdef BFD_ASSEMBLER symbol_table_insert (symbolP); -#endif } return symbolP; @@ -171,8 +169,6 @@ obj_coff_bss (int ignore ATTRIBUTE_UNUSED) s_lcomm (0); } -#ifdef BFD_ASSEMBLER - #define GET_FILENAME_STRING(X) \ ((char *) (&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1]) @@ -1087,10 +1083,7 @@ obj_coff_weak (int ignore ATTRIBUTE_UNUSED) symbolP = symbol_find_or_make (name); *input_line_pointer = c; SKIP_WHITESPACE (); - -#if defined BFD_ASSEMBLER || defined S_SET_WEAK S_SET_WEAK (symbolP); -#endif #ifdef TE_PE /* See _Microsoft Portable Executable and Common Object @@ -1127,10 +1120,8 @@ void coff_obj_read_begin_hook (void) { /* These had better be the same. Usually 18 bytes. */ -#ifndef BFD_HEADERS know (sizeof (SYMENT) == sizeof (AUXENT)); know (SYMESZ == AUXESZ); -#endif tag_init (); } @@ -1703,2711 +1694,6 @@ symbol_dump (void) #endif /* DEBUG */ -#else /* not BFD_ASSEMBLER */ - -#include "frags.h" -/* This is needed because we include internal bfd things. */ -#include <time.h> - -#include "libbfd.h" -#include "libcoff.h" - -/* The NOP_OPCODE is for the alignment fill value. Fill with nop so - that we can stick sections together without causing trouble. */ -#ifndef NOP_OPCODE -#define NOP_OPCODE 0x00 -#endif - -/* The zeroes if symbol name is longer than 8 chars */ -#define S_SET_ZEROES(s,v) ((s)->sy_symbol.ost_entry.n_zeroes = (v)) - -#define MIN(a,b) ((a) < (b)? (a) : (b)) - -/* This vector is used to turn a gas internal segment number into a - section number suitable for insertion into a coff symbol table. - This must correspond to seg_info_off_by_4. */ - -const short seg_N_TYPE[] = -{ /* in: segT out: N_TYPE bits */ - C_ABS_SECTION, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - C_UNDEF_SECTION, /* SEG_UNKNOWN */ - C_UNDEF_SECTION, /* SEG_GOOF */ - C_UNDEF_SECTION, /* SEG_EXPR */ - C_DEBUG_SECTION, /* SEG_DEBUG */ - C_NTV_SECTION, /* SEG_NTV */ - C_PTV_SECTION, /* SEG_PTV */ - C_REGISTER_SECTION, /* SEG_REGISTER */ -}; - -int function_lineoff = -1; /* Offset in line#s where the last function - started (the odd entry for line #0) */ - -/* Structure used to keep the filenames which - are too long around so that we can stick them - into the string table. */ -struct filename_list -{ - const char *filename; - struct filename_list *next; -}; - -static struct filename_list *filename_list_head; -static struct filename_list *filename_list_tail; - -static symbolS *last_line_symbol; - -/* Add 4 to the real value to get the index and compensate the - negatives. This vector is used by S_GET_SEGMENT to turn a coff - section number into a segment number. */ - -bfd *abfd; -static symbolS *previous_file_symbol; -static int line_base; - -/* When not using BFD_ASSEMBLER, we permit up to 40 sections. - - This array maps a COFF section number into a gas section number. - Because COFF uses negative section numbers, you must add 4 to the - COFF section number when indexing into this array; this is done via - the SEG_INFO_FROM_SECTION_NUMBER macro. This must correspond to - seg_N_TYPE. */ - -static const segT seg_info_off_by_4[] = -{ - SEG_PTV, - SEG_NTV, - SEG_DEBUG, - SEG_ABSOLUTE, - SEG_UNKNOWN, - SEG_E0, SEG_E1, SEG_E2, SEG_E3, SEG_E4, - SEG_E5, SEG_E6, SEG_E7, SEG_E8, SEG_E9, - SEG_E10, SEG_E11, SEG_E12, SEG_E13, SEG_E14, - SEG_E15, SEG_E16, SEG_E17, SEG_E18, SEG_E19, - SEG_E20, SEG_E21, SEG_E22, SEG_E23, SEG_E24, - SEG_E25, SEG_E26, SEG_E27, SEG_E28, SEG_E29, - SEG_E30, SEG_E31, SEG_E32, SEG_E33, SEG_E34, - SEG_E35, SEG_E36, SEG_E37, SEG_E38, SEG_E39, - (segT) 40, - (segT) 41, - (segT) 42, - (segT) 43, - (segT) 44, - (segT) 45, - (segT) 0, - (segT) 0, - (segT) 0, - SEG_REGISTER -}; - -#define SEG_INFO_FROM_SECTION_NUMBER(x) (seg_info_off_by_4[(x)+4]) - -static relax_addressT -relax_align (relax_addressT address, long alignment) -{ - relax_addressT mask; - relax_addressT new_address; - - mask = ~((~0) << alignment); - new_address = (address + mask) & (~mask); - - return new_address - address; -} - -segT -s_get_segment (symbolS * x) -{ - return SEG_INFO_FROM_SECTION_NUMBER (x->sy_symbol.ost_entry.n_scnum); -} - -/* Calculate the size of the frag chain and fill in the section header - to contain all of it, also fill in the addr of the sections. */ - -static unsigned int -size_section (bfd *abfd ATTRIBUTE_UNUSED, unsigned int idx) -{ - unsigned int size = 0; - fragS *frag = segment_info[idx].frchainP->frch_root; - - while (frag) - { - size = frag->fr_address; - if (frag->fr_address != size) - { - fprintf (stderr, _("Out of step\n")); - size = frag->fr_address; - } - - switch (frag->fr_type) - { -#ifdef TC_COFF_SIZEMACHDEP - case rs_machine_dependent: - size += TC_COFF_SIZEMACHDEP (frag); - break; -#endif - case rs_space: - case rs_fill: - case rs_org: - size += frag->fr_fix; - size += frag->fr_offset * frag->fr_var; - break; - case rs_align: - case rs_align_code: - case rs_align_test: - { - addressT off; - - size += frag->fr_fix; - off = relax_align (size, frag->fr_offset); - if (frag->fr_subtype != 0 && off > frag->fr_subtype) - off = 0; - size += off; - } - break; - default: - BAD_CASE (frag->fr_type); - break; - } - frag = frag->fr_next; - } - segment_info[idx].scnhdr.s_size = size; - return size; -} - -static unsigned int -count_entries_in_chain (unsigned int idx) -{ - unsigned int nrelocs; - fixS *fixup_ptr; - - /* Count the relocations. */ - fixup_ptr = segment_info[idx].fix_root; - nrelocs = 0; - while (fixup_ptr != (fixS *) NULL) - { - if (fixup_ptr->fx_done == 0 && TC_COUNT_RELOC (fixup_ptr)) - { -#if defined(TC_A29K) || defined(TC_OR32) - if (fixup_ptr->fx_r_type == RELOC_CONSTH) - nrelocs += 2; - else - nrelocs++; -#else - nrelocs++; -#endif - } - - fixup_ptr = fixup_ptr->fx_next; - } - return nrelocs; -} - -#ifdef TE_AUX - -/* AUX's ld expects relocations to be sorted. */ - -static int -compare_external_relocs (const void * x, const void * y) -{ - struct external_reloc *a = (struct external_reloc *) x; - struct external_reloc *b = (struct external_reloc *) y; - bfd_vma aadr = bfd_getb32 (a->r_vaddr); - bfd_vma badr = bfd_getb32 (b->r_vaddr); - - return (aadr < badr ? -1 : badr < aadr ? 1 : 0); -} - -#endif - -/* Output all the relocations for a section. */ - -static void -do_relocs_for (bfd * abfd, object_headers * h, unsigned long *file_cursor) -{ - unsigned int nrelocs; - unsigned int idx; - unsigned long reloc_start = *file_cursor; - - for (idx = SEG_E0; idx < SEG_LAST; idx++) - { - if (segment_info[idx].scnhdr.s_name[0]) - { - struct external_reloc *ext_ptr; - struct external_reloc *external_reloc_vec; - unsigned int external_reloc_size; - unsigned int base = segment_info[idx].scnhdr.s_paddr; - fixS *fix_ptr = segment_info[idx].fix_root; - - nrelocs = count_entries_in_chain (idx); - - if (nrelocs) - /* Bypass this stuff if no relocs. This also incidentally - avoids a SCO bug, where free(malloc(0)) tends to crash. */ - { - external_reloc_size = nrelocs * RELSZ; - external_reloc_vec = malloc (external_reloc_size); - - ext_ptr = external_reloc_vec; - - /* Fill in the internal coff style reloc struct from the - internal fix list. */ - while (fix_ptr) - { - struct internal_reloc intr; - - /* Only output some of the relocations. */ - if (fix_ptr->fx_done == 0 && TC_COUNT_RELOC (fix_ptr)) - { -#ifdef TC_RELOC_MANGLE - TC_RELOC_MANGLE (&segment_info[idx], fix_ptr, &intr, - base); -#else - symbolS *dot; - symbolS *symbol_ptr = fix_ptr->fx_addsy; - - intr.r_type = TC_COFF_FIX2RTYPE (fix_ptr); - intr.r_vaddr = - base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where; - -#ifdef TC_KEEP_FX_OFFSET - intr.r_offset = fix_ptr->fx_offset; -#else - intr.r_offset = 0; -#endif - - while (symbol_ptr->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (symbol_ptr) - || S_IS_COMMON (symbol_ptr))) - { - symbolS *n; - - /* We must avoid looping, as that can occur - with a badly written program. */ - n = symbol_ptr->sy_value.X_add_symbol; - if (n == symbol_ptr) - break; - symbol_ptr = n; - } - - /* Turn the segment of the symbol into an offset. */ - if (symbol_ptr) - { - resolve_symbol_value (symbol_ptr); - if (! symbol_ptr->sy_resolved) - { - char *file; - unsigned int line; - - if (expr_symbol_where (symbol_ptr, &file, &line)) - as_bad_where (file, line, - _("unresolved relocation")); - else - as_bad (_("bad relocation: symbol `%s' not in symbol table"), - S_GET_NAME (symbol_ptr)); - } - - dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot; - if (dot) - intr.r_symndx = dot->sy_number; - else - intr.r_symndx = symbol_ptr->sy_number; - } - else - intr.r_symndx = -1; -#endif - (void) bfd_coff_swap_reloc_out (abfd, &intr, ext_ptr); - ext_ptr++; -#if defined(TC_A29K) - /* The 29k has a special kludge for the high 16 bit - reloc. Two relocations are emitted, R_IHIHALF, - and R_IHCONST. The second one doesn't contain a - symbol, but uses the value for offset. */ - if (intr.r_type == R_IHIHALF) - { - /* Now emit the second bit. */ - intr.r_type = R_IHCONST; - intr.r_symndx = fix_ptr->fx_addnumber; - (void) bfd_coff_swap_reloc_out (abfd, &intr, ext_ptr); - ext_ptr++; - } -#endif -#if defined(TC_OR32) - /* The or32 has a special kludge for the high 16 bit - reloc. Two relocations are emitted, R_IHIHALF, - and R_IHCONST. The second one doesn't contain a - symbol, but uses the value for offset. */ - if (intr.r_type == R_IHIHALF) - { - /* Now emit the second bit. */ - intr.r_type = R_IHCONST; - intr.r_symndx = fix_ptr->fx_addnumber; - (void) bfd_coff_swap_reloc_out (abfd, & intr, ext_ptr); - ext_ptr ++; - } -#endif - } - - fix_ptr = fix_ptr->fx_next; - } -#ifdef TE_AUX - /* Sort the reloc table. */ - qsort ((void *) external_reloc_vec, nrelocs, - sizeof (struct external_reloc), compare_external_relocs); -#endif - /* Write out the reloc table. */ - bfd_bwrite ((void *) external_reloc_vec, - (bfd_size_type) external_reloc_size, abfd); - free (external_reloc_vec); - - /* Fill in section header info. */ - segment_info[idx].scnhdr.s_relptr = *file_cursor; - *file_cursor += external_reloc_size; - segment_info[idx].scnhdr.s_nreloc = nrelocs; - } - else - { - /* No relocs. */ - segment_info[idx].scnhdr.s_relptr = 0; - } - } - } - - /* Set relocation_size field in file headers. */ - H_SET_RELOCATION_SIZE (h, *file_cursor - reloc_start, 0); -} - -/* Run through a frag chain and write out the data to go with it, fill - in the scnhdrs with the info on the file positions. */ - -static void -fill_section (bfd * abfd, - object_headers *h ATTRIBUTE_UNUSED, - unsigned long *file_cursor) -{ - unsigned int i; - unsigned int paddr = 0; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - unsigned int offset = 0; - struct internal_scnhdr *s = &(segment_info[i].scnhdr); - - PROGRESS (1); - - if (s->s_name[0]) - { - fragS *frag = segment_info[i].frchainP->frch_root; - char *buffer = NULL; - - if (s->s_size == 0) - s->s_scnptr = 0; - else - { - buffer = xmalloc (s->s_size); - s->s_scnptr = *file_cursor; - } - know (s->s_paddr == paddr); - - if (streq (s->s_name, ".text")) - s->s_flags |= STYP_TEXT; - else if (streq (s->s_name, ".data")) - s->s_flags |= STYP_DATA; - else if (streq (s->s_name, ".bss")) - { - s->s_scnptr = 0; - s->s_flags |= STYP_BSS; - - /* @@ Should make the i386 and a29k coff targets define - COFF_NOLOAD_PROBLEM, and have only one test here. */ -#ifndef TC_I386 -#ifndef TC_A29K -#ifndef TC_OR32 -#ifndef COFF_NOLOAD_PROBLEM - /* Apparently the SVR3 linker (and exec syscall) and UDI - mondfe progrem are confused by noload sections. */ - s->s_flags |= STYP_NOLOAD; -#endif -#endif -#endif -#endif - } - else if (streq (s->s_name, ".lit")) - s->s_flags = STYP_LIT | STYP_TEXT; - else if (streq (s->s_name, ".init")) - s->s_flags |= STYP_TEXT; - else if (streq (s->s_name, ".fini")) - s->s_flags |= STYP_TEXT; - else if (strneq (s->s_name, ".comment", 8)) - s->s_flags |= STYP_INFO; - - while (frag) - { - unsigned int fill_size; - - switch (frag->fr_type) - { - case rs_machine_dependent: - if (frag->fr_fix) - { - memcpy (buffer + frag->fr_address, - frag->fr_literal, - (unsigned int) frag->fr_fix); - offset += frag->fr_fix; - } - - break; - case rs_space: - case rs_fill: - case rs_align: - case rs_align_code: - case rs_align_test: - case rs_org: - if (frag->fr_fix) - { - memcpy (buffer + frag->fr_address, - frag->fr_literal, - (unsigned int) frag->fr_fix); - offset += frag->fr_fix; - } - - fill_size = frag->fr_var; - if (fill_size && frag->fr_offset > 0) - { - unsigned int count; - unsigned int off = frag->fr_fix; - - for (count = frag->fr_offset; count; count--) - { - if (fill_size + frag->fr_address + off <= s->s_size) - { - memcpy (buffer + frag->fr_address + off, - frag->fr_literal + frag->fr_fix, - fill_size); - off += fill_size; - offset += fill_size; - } - } - } - break; - case rs_broken_word: - break; - default: - abort (); - } - frag = frag->fr_next; - } - - if (s->s_size != 0) - { - if (s->s_scnptr != 0) - { - bfd_bwrite (buffer, s->s_size, abfd); - *file_cursor += s->s_size; - } - free (buffer); - } - paddr += s->s_size; - } - } -} - -/* Coff file generation & utilities. */ - -static void -coff_header_append (bfd * abfd, object_headers * h) -{ - unsigned int i; - char buffer[1000]; - char buffero[1000]; -#ifdef COFF_LONG_SECTION_NAMES - unsigned long string_size = 4; -#endif - - bfd_seek (abfd, 0, 0); - -#ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER - H_SET_MAGIC_NUMBER (h, COFF_MAGIC); - H_SET_VERSION_STAMP (h, 0); - H_SET_ENTRY_POINT (h, 0); - H_SET_TEXT_START (h, segment_info[SEG_E0].frchainP->frch_root->fr_address); - H_SET_DATA_START (h, segment_info[SEG_E1].frchainP->frch_root->fr_address); - H_SET_SIZEOF_OPTIONAL_HEADER (h, bfd_coff_swap_aouthdr_out (abfd, &h->aouthdr, - buffero)); -#else /* defined (OBJ_COFF_OMIT_OPTIONAL_HEADER) */ - H_SET_SIZEOF_OPTIONAL_HEADER (h, 0); -#endif /* defined (OBJ_COFF_OMIT_OPTIONAL_HEADER) */ - - i = bfd_coff_swap_filehdr_out (abfd, &h->filehdr, buffer); - - bfd_bwrite (buffer, (bfd_size_type) i, abfd); - bfd_bwrite (buffero, (bfd_size_type) H_GET_SIZEOF_OPTIONAL_HEADER (h), abfd); - - for (i = SEG_E0; i < SEG_LAST; i++) - { - if (segment_info[i].scnhdr.s_name[0]) - { - unsigned int size; - -#ifdef COFF_LONG_SECTION_NAMES - /* Support long section names as found in PE. This code - must coordinate with that in write_object_file and - w_strings. */ - if (strlen (segment_info[i].name) > SCNNMLEN) - { - memset (segment_info[i].scnhdr.s_name, 0, SCNNMLEN); - sprintf (segment_info[i].scnhdr.s_name, "/%lu", string_size); - string_size += strlen (segment_info[i].name) + 1; - } -#endif - size = bfd_coff_swap_scnhdr_out (abfd, - &(segment_info[i].scnhdr), - buffer); - if (size == 0) - as_bad (_("bfd_coff_swap_scnhdr_out failed")); - bfd_bwrite (buffer, (bfd_size_type) size, abfd); - } - } -} - -static char * -symbol_to_chars (bfd * abfd, char * where, symbolS * symbolP) -{ - unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux; - unsigned int i; - valueT val; - - /* Turn any symbols with register attributes into abs symbols. */ - if (S_GET_SEGMENT (symbolP) == reg_section) - S_SET_SEGMENT (symbolP, absolute_section); - - /* At the same time, relocate all symbols to their output value. */ -#ifndef TE_PE - val = (segment_info[S_GET_SEGMENT (symbolP)].scnhdr.s_paddr - + S_GET_VALUE (symbolP)); -#else - val = S_GET_VALUE (symbolP); -#endif - - S_SET_VALUE (symbolP, val); - - symbolP->sy_symbol.ost_entry.n_value = val; - - where += bfd_coff_swap_sym_out (abfd, &symbolP->sy_symbol.ost_entry, - where); - - for (i = 0; i < numaux; i++) - { - where += bfd_coff_swap_aux_out (abfd, - &symbolP->sy_symbol.ost_auxent[i], - S_GET_DATA_TYPE (symbolP), - S_GET_STORAGE_CLASS (symbolP), - i, numaux, where); - } - - return where; -} - -void -coff_obj_symbol_new_hook (symbolS *symbolP) -{ - char underscore = 0; /* Symbol has leading _ */ - - /* Effective symbol. */ - /* Store the pointer in the offset. */ - S_SET_ZEROES (symbolP, 0L); - S_SET_DATA_TYPE (symbolP, T_NULL); - S_SET_STORAGE_CLASS (symbolP, 0); - S_SET_NUMBER_AUXILIARY (symbolP, 0); - /* Additional information. */ - symbolP->sy_symbol.ost_flags = 0; - /* Auxiliary entries. */ - memset ((char *) &symbolP->sy_symbol.ost_auxent[0], 0, AUXESZ); - - if (S_IS_STRING (symbolP)) - SF_SET_STRING (symbolP); - if (!underscore && S_IS_LOCAL (symbolP)) - SF_SET_LOCAL (symbolP); -} - -static int -c_line_new (symbolS * symbol, long paddr, int line_number, fragS * frag) -{ - struct lineno_list *new_line = xmalloc (sizeof (* new_line)); - - segment_info_type *s = segment_info + now_seg; - new_line->line.l_lnno = line_number; - - if (line_number == 0) - { - last_line_symbol = symbol; - new_line->line.l_addr.l_symndx = (long) symbol; - } - else - { - new_line->line.l_addr.l_paddr = paddr; - } - - new_line->frag = (char *) frag; - new_line->next = NULL; - - if (s->lineno_list_head == NULL) - s->lineno_list_head = new_line; - else - s->lineno_list_tail->next = new_line; - - s->lineno_list_tail = new_line; - return LINESZ * s->scnhdr.s_nlnno++; -} - -/* Handle .ln directives. */ - -static void -obj_coff_ln (int appline) -{ - int l; - - if (! appline && def_symbol_in_progress != NULL) - { - /* Wrong context. */ - as_warn (_(".ln pseudo-op inside .def/.endef: ignored.")); - demand_empty_rest_of_line (); - return; - } - - l = get_absolute_expression (); - c_line_new (0, frag_now_fix (), l, frag_now); - - if (appline) - new_logical_line ((char *) NULL, l - 1); - -#ifndef NO_LISTING - { - extern int listing; - - if (listing) - { - if (! appline) - l += line_base - 1; - listing_source_line ((unsigned int) l); - } - } -#endif - demand_empty_rest_of_line (); -} - -/* Handle .def directives. - - One might ask : why can't we symbol_new if the symbol does not - already exist and fill it with debug information. Because of - the C_EFCN special symbol. It would clobber the value of the - function symbol before we have a chance to notice that it is - a C_EFCN. And a second reason is that the code is more clear this - way. (at least I think it is :-). */ - -#define SKIP_SEMI_COLON() while (*input_line_pointer++ != ';') -#define SKIP_WHITESPACES() while (*input_line_pointer == ' ' || \ - *input_line_pointer == '\t') \ - input_line_pointer++; - -static void -obj_coff_def (int what ATTRIBUTE_UNUSED) -{ - char name_end; /* Char after the end of name. */ - char *symbol_name; /* Name of the debug symbol. */ - char *symbol_name_copy; /* Temporary copy of the name. */ - unsigned int symbol_name_length; - - if (def_symbol_in_progress != NULL) - { - as_warn (_(".def pseudo-op used inside of .def/.endef: ignored.")); - demand_empty_rest_of_line (); - return; - } - - SKIP_WHITESPACES (); - - def_symbol_in_progress = obstack_alloc (¬es, sizeof (*def_symbol_in_progress)); - memset (def_symbol_in_progress, 0, sizeof (*def_symbol_in_progress)); - - symbol_name = input_line_pointer; - name_end = get_symbol_end (); - symbol_name_length = strlen (symbol_name); - symbol_name_copy = xmalloc (symbol_name_length + 1); - strcpy (symbol_name_copy, symbol_name); -#ifdef tc_canonicalize_symbol_name - symbol_name_copy = tc_canonicalize_symbol_name (symbol_name_copy); -#endif - - /* Initialize the new symbol. */ - S_SET_NAME (def_symbol_in_progress, symbol_name_copy); - /* free(symbol_name_copy); */ - def_symbol_in_progress->sy_name_offset = (unsigned long) ~0; - def_symbol_in_progress->sy_number = ~0; - def_symbol_in_progress->sy_frag = &zero_address_frag; - S_SET_VALUE (def_symbol_in_progress, 0); - - if (S_IS_STRING (def_symbol_in_progress)) - SF_SET_STRING (def_symbol_in_progress); - - *input_line_pointer = name_end; - - demand_empty_rest_of_line (); -} - -static void -c_symbol_merge (symbolS *debug, symbolS *normal) -{ - S_SET_DATA_TYPE (normal, S_GET_DATA_TYPE (debug)); - S_SET_STORAGE_CLASS (normal, S_GET_STORAGE_CLASS (debug)); - - if (S_GET_NUMBER_AUXILIARY (debug) > S_GET_NUMBER_AUXILIARY (normal)) - S_SET_NUMBER_AUXILIARY (normal, S_GET_NUMBER_AUXILIARY (debug)); - - if (S_GET_NUMBER_AUXILIARY (debug) > 0) - memcpy ((char *) &normal->sy_symbol.ost_auxent[0], - (char *) &debug->sy_symbol.ost_auxent[0], - (unsigned int) (S_GET_NUMBER_AUXILIARY (debug) * AUXESZ)); - - /* Move the debug flags. */ - SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug)); -} - -static unsigned int dim_index; - -static void -obj_coff_endef (int ignore ATTRIBUTE_UNUSED) -{ - symbolS *symbolP = 0; - - dim_index = 0; - if (def_symbol_in_progress == NULL) - { - as_warn (_(".endef pseudo-op used outside of .def/.endef: ignored.")); - demand_empty_rest_of_line (); - return; - } - - /* Set the section number according to storage class. */ - switch (S_GET_STORAGE_CLASS (def_symbol_in_progress)) - { - case C_STRTAG: - case C_ENTAG: - case C_UNTAG: - SF_SET_TAG (def_symbol_in_progress); - /* Fall through. */ - - case C_FILE: - case C_TPDEF: - SF_SET_DEBUG (def_symbol_in_progress); - S_SET_SEGMENT (def_symbol_in_progress, SEG_DEBUG); - break; - - case C_EFCN: - /* Do not emit this symbol. */ - SF_SET_LOCAL (def_symbol_in_progress); - /* Fall through. */ - - case C_BLOCK: - /* Will need processing before writing. */ - SF_SET_PROCESS (def_symbol_in_progress); - /* Fall through. */ - - case C_FCN: - S_SET_SEGMENT (def_symbol_in_progress, SEG_E0); - - if (streq (S_GET_NAME (def_symbol_in_progress), ".bf")) - { - if (function_lineoff < 0) - fprintf (stderr, _("`.bf' symbol without preceding function\n")); - - SA_GET_SYM_LNNOPTR (last_line_symbol) = function_lineoff; - - SF_SET_PROCESS (last_line_symbol); - SF_SET_ADJ_LNNOPTR (last_line_symbol); - SF_SET_PROCESS (def_symbol_in_progress); - function_lineoff = -1; - } - - /* Value is always set to . */ - def_symbol_in_progress->sy_frag = frag_now; - S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ()); - break; - -#ifdef C_AUTOARG - case C_AUTOARG: -#endif /* C_AUTOARG */ - case C_AUTO: - case C_REG: - case C_MOS: - case C_MOE: - case C_MOU: - case C_ARG: - case C_REGPARM: - case C_FIELD: - case C_EOS: - SF_SET_DEBUG (def_symbol_in_progress); - S_SET_SEGMENT (def_symbol_in_progress, absolute_section); - break; - - case C_EXT: - case C_WEAKEXT: -#ifdef TE_PE - case C_NT_WEAK: -#endif - case C_STAT: - case C_LABEL: - /* Valid but set somewhere else (s_comm, s_lcomm, colon). */ - break; - - case C_USTATIC: - case C_EXTDEF: - case C_ULABEL: - as_warn (_("unexpected storage class %d"), S_GET_STORAGE_CLASS (def_symbol_in_progress)); - break; - } - - /* Now that we have built a debug symbol, try to find if we should - merge with an existing symbol or not. If a symbol is C_EFCN or - absolute_section or untagged SEG_DEBUG it never merges. We also - don't merge labels, which are in a different namespace, nor - symbols which have not yet been defined since they are typically - unique, nor do we merge tags with non-tags. */ - - /* Two cases for functions. Either debug followed by definition or - definition followed by debug. For definition first, we will - merge the debug symbol into the definition. For debug first, the - lineno entry MUST point to the definition function or else it - will point off into space when crawl_symbols() merges the debug - symbol into the real symbol. Therefor, let's presume the debug - symbol is a real function reference. */ - - /* FIXME-SOON If for some reason the definition label/symbol is - never seen, this will probably leave an undefined symbol at link - time. */ - - if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN - || S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL - || (S_GET_SEGMENT (def_symbol_in_progress) == SEG_DEBUG - && !SF_GET_TAG (def_symbol_in_progress)) - || S_GET_SEGMENT (def_symbol_in_progress) == absolute_section - || def_symbol_in_progress->sy_value.X_op != O_constant - || (symbolP = symbol_find (S_GET_NAME (def_symbol_in_progress))) == NULL - || (SF_GET_TAG (def_symbol_in_progress) != SF_GET_TAG (symbolP))) - { - symbol_append (def_symbol_in_progress, symbol_lastP, &symbol_rootP, - &symbol_lastP); - } - else - { - /* This symbol already exists, merge the newly created symbol - into the old one. This is not mandatory. The linker can - handle duplicate symbols correctly. But I guess that it save - a *lot* of space if the assembly file defines a lot of - symbols. [loic] */ - - /* The debug entry (def_symbol_in_progress) is merged into the - previous definition. */ - - c_symbol_merge (def_symbol_in_progress, symbolP); - /* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */ - def_symbol_in_progress = symbolP; - - if (SF_GET_FUNCTION (def_symbol_in_progress) - || SF_GET_TAG (def_symbol_in_progress) - || S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_STAT) - { - /* For functions, and tags, and static symbols, the symbol - *must* be where the debug symbol appears. Move the - existing symbol to the current place. */ - /* If it already is at the end of the symbol list, do nothing. */ - if (def_symbol_in_progress != symbol_lastP) - { - symbol_remove (def_symbol_in_progress, &symbol_rootP, - &symbol_lastP); - symbol_append (def_symbol_in_progress, symbol_lastP, - &symbol_rootP, &symbol_lastP); - } - } - } - - if (SF_GET_TAG (def_symbol_in_progress)) - { - symbolS *oldtag; - - oldtag = symbol_find (S_GET_NAME (def_symbol_in_progress)); - if (oldtag == NULL || ! SF_GET_TAG (oldtag)) - tag_insert (S_GET_NAME (def_symbol_in_progress), - def_symbol_in_progress); - } - - if (SF_GET_FUNCTION (def_symbol_in_progress)) - { - know (sizeof (def_symbol_in_progress) <= sizeof (long)); - function_lineoff - = c_line_new (def_symbol_in_progress, 0, 0, &zero_address_frag); - - SF_SET_PROCESS (def_symbol_in_progress); - - if (symbolP == NULL) - /* That is, if this is the first time we've seen the function. */ - symbol_table_insert (def_symbol_in_progress); - } - - def_symbol_in_progress = NULL; - demand_empty_rest_of_line (); -} - -static void -obj_coff_dim (int ignore ATTRIBUTE_UNUSED) -{ - int dim_index; - - if (def_symbol_in_progress == NULL) - { - as_warn (_(".dim pseudo-op used outside of .def/.endef: ignored.")); - demand_empty_rest_of_line (); - return; - } - - S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); - - for (dim_index = 0; dim_index < DIMNUM; dim_index++) - { - SKIP_WHITESPACES (); - SA_SET_SYM_DIMEN (def_symbol_in_progress, dim_index, - get_absolute_expression ()); - - switch (*input_line_pointer) - { - case ',': - input_line_pointer++; - break; - - default: - as_warn (_("badly formed .dim directive ignored")); - /* Fall through. */ - - case '\n': - case ';': - dim_index = DIMNUM; - break; - } - } - - demand_empty_rest_of_line (); -} - -static void -obj_coff_line (int ignore ATTRIBUTE_UNUSED) -{ - int this_base; - const char *name; - - if (def_symbol_in_progress == NULL) - { - obj_coff_ln (0); - return; - } - - name = S_GET_NAME (def_symbol_in_progress); - this_base = get_absolute_expression (); - - /* Only .bf symbols indicate the use of a new base line number; the - line numbers associated with .ef, .bb, .eb are relative to the - start of the containing function. */ - if (streq (".bf", name)) - { - line_base = this_base; - -#ifndef NO_LISTING - { - extern int listing; - if (listing) - listing_source_line ((unsigned int) line_base); - } -#endif - } - - S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); - SA_SET_SYM_LNNO (def_symbol_in_progress, this_base); - - demand_empty_rest_of_line (); -} - -static void -obj_coff_size (int ignore ATTRIBUTE_UNUSED) -{ - if (def_symbol_in_progress == NULL) - { - as_warn (_(".size pseudo-op used outside of .def/.endef ignored.")); - demand_empty_rest_of_line (); - return; - } - - S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); - SA_SET_SYM_SIZE (def_symbol_in_progress, get_absolute_expression ()); - demand_empty_rest_of_line (); -} - -static void -obj_coff_scl (int ignore ATTRIBUTE_UNUSED) -{ - if (def_symbol_in_progress == NULL) - { - as_warn (_(".scl pseudo-op used outside of .def/.endef ignored.")); - demand_empty_rest_of_line (); - return; - } - - S_SET_STORAGE_CLASS (def_symbol_in_progress, get_absolute_expression ()); - demand_empty_rest_of_line (); -} - -static void -obj_coff_tag (int ignore ATTRIBUTE_UNUSED) -{ - char *symbol_name; - char name_end; - - if (def_symbol_in_progress == NULL) - { - as_warn (_(".tag pseudo-op used outside of .def/.endef ignored.")); - demand_empty_rest_of_line (); - return; - } - - S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); - symbol_name = input_line_pointer; - name_end = get_symbol_end (); -#ifdef tc_canonicalize_symbol_name - symbol_name = tc_canonicalize_symbol_name (symbol_name); -#endif - - /* Assume that the symbol referred to by .tag is always defined. - This was a bad assumption. I've added find_or_make. xoxorich. */ - SA_SET_SYM_TAGNDX (def_symbol_in_progress, - (long) tag_find_or_make (symbol_name)); - if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L) - as_warn (_("tag not found for .tag %s"), symbol_name); - - SF_SET_TAGGED (def_symbol_in_progress); - *input_line_pointer = name_end; - - demand_empty_rest_of_line (); -} - -static void -obj_coff_type (int ignore ATTRIBUTE_UNUSED) -{ - if (def_symbol_in_progress == NULL) - { - as_warn (_(".type pseudo-op used outside of .def/.endef ignored.")); - demand_empty_rest_of_line (); - return; - } - - S_SET_DATA_TYPE (def_symbol_in_progress, get_absolute_expression ()); - - if (ISFCN (S_GET_DATA_TYPE (def_symbol_in_progress)) && - S_GET_STORAGE_CLASS (def_symbol_in_progress) != C_TPDEF) - SF_SET_FUNCTION (def_symbol_in_progress); - - demand_empty_rest_of_line (); -} - -static void -obj_coff_val (int ignore ATTRIBUTE_UNUSED) -{ - if (def_symbol_in_progress == NULL) - { - as_warn (_(".val pseudo-op used outside of .def/.endef ignored.")); - demand_empty_rest_of_line (); - return; - } - - if (is_name_beginner (*input_line_pointer)) - { - char *symbol_name = input_line_pointer; - char name_end = get_symbol_end (); - -#ifdef tc_canonicalize_symbol_name - symbol_name = tc_canonicalize_symbol_name (symbol_name); -#endif - - if (streq (symbol_name, ".")) - { - def_symbol_in_progress->sy_frag = frag_now; - S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ()); - /* If the .val is != from the .def (e.g. statics). */ - } - else if (! streq (S_GET_NAME (def_symbol_in_progress), symbol_name)) - { - def_symbol_in_progress->sy_value.X_op = O_symbol; - def_symbol_in_progress->sy_value.X_add_symbol = - symbol_find_or_make (symbol_name); - def_symbol_in_progress->sy_value.X_op_symbol = NULL; - def_symbol_in_progress->sy_value.X_add_number = 0; - - /* If the segment is undefined when the forward reference is - resolved, then copy the segment id from the forward - symbol. */ - SF_SET_GET_SEGMENT (def_symbol_in_progress); - - /* FIXME: gcc can generate address expressions here in - unusual cases (search for "obscure" in sdbout.c). We - just ignore the offset here, thus generating incorrect - debugging information. We ignore the rest of the line - just below. */ - } - /* Otherwise, it is the name of a non debug symbol and - its value will be calculated later. */ - *input_line_pointer = name_end; - - /* FIXME: this is to avoid an error message in the - FIXME case mentioned just above. */ - while (! is_end_of_line[(unsigned char) *input_line_pointer]) - ++input_line_pointer; - } - else - { - S_SET_VALUE (def_symbol_in_progress, - (valueT) get_absolute_expression ()); - } - - demand_empty_rest_of_line (); -} - -#ifdef TE_PE - -/* Handle the .linkonce pseudo-op. This is parsed by s_linkonce in - read.c, which then calls this object file format specific routine. */ - -void -obj_coff_pe_handle_link_once (enum linkonce_type type) -{ - seg_info (now_seg)->scnhdr.s_flags |= IMAGE_SCN_LNK_COMDAT; - - /* We store the type in the seg_info structure, and use it to set up - the auxiliary entry for the section symbol in c_section_symbol. */ - seg_info (now_seg)->linkonce = type; -} - -#endif /* TE_PE */ - -void -coff_obj_read_begin_hook (void) -{ - /* These had better be the same. Usually 18 bytes. */ -#ifndef BFD_HEADERS - know (sizeof (SYMENT) == sizeof (AUXENT)); - know (SYMESZ == AUXESZ); -#endif - tag_init (); -} - -/* This function runs through the symbol table and puts all the - externals onto another chain. */ - -/* The chain of globals. */ -symbolS *symbol_globalP; -symbolS *symbol_global_lastP; - -/* The chain of externals. */ -symbolS *symbol_externP; -symbolS *symbol_extern_lastP; - -stack *block_stack; -symbolS *last_functionP; -static symbolS *last_bfP; -symbolS *last_tagP; - -static unsigned int -yank_symbols (void) -{ - symbolS *symbolP; - unsigned int symbol_number = 0; - unsigned int last_file_symno = 0; - struct filename_list *filename_list_scan = filename_list_head; - - for (symbolP = symbol_rootP; - symbolP; - symbolP = symbolP ? symbol_next (symbolP) : symbol_rootP) - { - if (symbolP->sy_mri_common) - { - if (S_GET_STORAGE_CLASS (symbolP) == C_EXT -#ifdef TE_PE - || S_GET_STORAGE_CLASS (symbolP) == C_NT_WEAK -#endif - || S_GET_STORAGE_CLASS (symbolP) == C_WEAKEXT) - as_bad (_("%s: global symbols not supported in common sections"), - S_GET_NAME (symbolP)); - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - continue; - } - - if (!SF_GET_DEBUG (symbolP)) - { - /* Debug symbols do not need all this rubbish. */ - symbolS *real_symbolP; - - /* L* and C_EFCN symbols never merge. */ - if (!SF_GET_LOCAL (symbolP) - && !SF_GET_STATICS (symbolP) - && S_GET_STORAGE_CLASS (symbolP) != C_LABEL - && symbolP->sy_value.X_op == O_constant - && (real_symbolP = symbol_find (S_GET_NAME (symbolP))) - && real_symbolP != symbolP) - { - /* FIXME-SOON: where do dups come from? - Maybe tag references before definitions? xoxorich. */ - /* Move the debug data from the debug symbol to the - real symbol. Do NOT do the opposite (i.e. move from - real symbol to debug symbol and remove real symbol from the - list.) Because some pointers refer to the real symbol - whereas no pointers refer to the debug symbol. */ - c_symbol_merge (symbolP, real_symbolP); - /* Replace the current symbol by the real one. */ - /* The symbols will never be the last or the first - because : 1st symbol is .file and 3 last symbols are - .text, .data, .bss. */ - symbol_remove (real_symbolP, &symbol_rootP, &symbol_lastP); - symbol_insert (real_symbolP, symbolP, &symbol_rootP, &symbol_lastP); - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - symbolP = real_symbolP; - } - - if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_E1)) - S_SET_SEGMENT (symbolP, SEG_E0); - - resolve_symbol_value (symbolP); - - if (S_GET_STORAGE_CLASS (symbolP) == C_NULL) - { - if (!S_IS_DEFINED (symbolP) && !SF_GET_LOCAL (symbolP)) - S_SET_EXTERNAL (symbolP); - - else if (S_GET_SEGMENT (symbolP) == SEG_E0) - S_SET_STORAGE_CLASS (symbolP, C_LABEL); - - else - S_SET_STORAGE_CLASS (symbolP, C_STAT); - } - - /* Mainly to speed up if not -g. */ - if (SF_GET_PROCESS (symbolP)) - { - /* Handle the nested blocks auxiliary info. */ - if (S_GET_STORAGE_CLASS (symbolP) == C_BLOCK) - { - if (streq (S_GET_NAME (symbolP), ".bb")) - stack_push (block_stack, (char *) &symbolP); - else - { - /* .eb */ - symbolS *begin_symbolP; - - begin_symbolP = *(symbolS **) stack_pop (block_stack); - if (begin_symbolP == NULL) - as_warn (_("mismatched .eb")); - else - SA_SET_SYM_ENDNDX (begin_symbolP, symbol_number + 2); - } - } - - /* If we are able to identify the type of a function, and we - are out of a function (last_functionP == 0) then, the - function symbol will be associated with an auxiliary - entry. */ - if (last_functionP == NULL && SF_GET_FUNCTION (symbolP)) - { - last_functionP = symbolP; - - if (S_GET_NUMBER_AUXILIARY (symbolP) < 1) - S_SET_NUMBER_AUXILIARY (symbolP, 1); - } - - if (S_GET_STORAGE_CLASS (symbolP) == C_FCN) - { - if (streq (S_GET_NAME (symbolP), ".bf")) - { - if (last_bfP != NULL) - SA_SET_SYM_ENDNDX (last_bfP, symbol_number); - last_bfP = symbolP; - } - } - else if (S_GET_STORAGE_CLASS (symbolP) == C_EFCN) - { - /* I don't even know if this is needed for sdb. But - the standard assembler generates it, so... */ - if (last_functionP == NULL) - as_fatal (_("C_EFCN symbol out of scope")); - SA_SET_SYM_FSIZE (last_functionP, - (long) (S_GET_VALUE (symbolP) - - S_GET_VALUE (last_functionP))); - SA_SET_SYM_ENDNDX (last_functionP, symbol_number); - last_functionP = NULL; - } - } - } - else if (SF_GET_TAG (symbolP)) - /* First descriptor of a structure must point to - the first slot after the structure description. */ - last_tagP = symbolP; - - else if (S_GET_STORAGE_CLASS (symbolP) == C_EOS) - /* +2 take in account the current symbol. */ - SA_SET_SYM_ENDNDX (last_tagP, symbol_number + 2); - - else if (S_GET_STORAGE_CLASS (symbolP) == C_FILE) - { - /* If the filename was too long to fit in the - auxent, put it in the string table. */ - if (SA_GET_FILE_FNAME_ZEROS (symbolP) == 0 - && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0) - { - SA_SET_FILE_FNAME_OFFSET (symbolP, string_byte_count); - string_byte_count += strlen (filename_list_scan->filename) + 1; - filename_list_scan = filename_list_scan->next; - } - if (S_GET_VALUE (symbolP)) - { - S_SET_VALUE (symbolP, last_file_symno); - last_file_symno = symbol_number; - } - } - -#ifdef tc_frob_coff_symbol - tc_frob_coff_symbol (symbolP); -#endif - - /* We must put the external symbols apart. The loader - does not bomb if we do not. But the references in - the endndx field for a .bb symbol are not corrected - if an external symbol is removed between .bb and .be. - I.e in the following case : - [20] .bb endndx = 22 - [21] foo external - [22] .be - ld will move the symbol 21 to the end of the list but - endndx will still be 22 instead of 21. */ - - if (SF_GET_LOCAL (symbolP)) - /* Remove C_EFCN and LOCAL (L...) symbols. */ - /* Next pointer remains valid. */ - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - - else if (symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))) - /* Skip symbols which were equated to undefined or common - symbols. */ - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - - else if (!S_IS_DEFINED (symbolP) - && !S_IS_DEBUG (symbolP) - && !SF_GET_STATICS (symbolP) - && (S_GET_STORAGE_CLASS (symbolP) == C_EXT -#ifdef TE_PE - || S_GET_STORAGE_CLASS (symbolP) == C_NT_WEAK -#endif - || S_GET_STORAGE_CLASS (symbolP) == C_WEAKEXT)) - { - /* If external, Remove from the list. */ - symbolS *hold = symbol_previous (symbolP); - - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - symbol_clear_list_pointers (symbolP); - symbol_append (symbolP, symbol_extern_lastP, &symbol_externP, &symbol_extern_lastP); - symbolP = hold; - } - else if (! S_IS_DEBUG (symbolP) - && ! SF_GET_STATICS (symbolP) - && ! SF_GET_FUNCTION (symbolP) - && (S_GET_STORAGE_CLASS (symbolP) == C_EXT -#ifdef TE_PE - || S_GET_STORAGE_CLASS (symbolP) == C_NT_WEAK -#endif - || S_GET_STORAGE_CLASS (symbolP) == C_NT_WEAK)) - { - symbolS *hold = symbol_previous (symbolP); - - /* The O'Reilly COFF book says that defined global symbols - come at the end of the symbol table, just before - undefined global symbols. */ - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - symbol_clear_list_pointers (symbolP); - symbol_append (symbolP, symbol_global_lastP, &symbol_globalP, - &symbol_global_lastP); - symbolP = hold; - } - else - { - if (SF_GET_STRING (symbolP)) - { - symbolP->sy_name_offset = string_byte_count; - string_byte_count += strlen (S_GET_NAME (symbolP)) + 1; - } - else - symbolP->sy_name_offset = 0; - - symbolP->sy_number = symbol_number; - symbol_number += 1 + S_GET_NUMBER_AUXILIARY (symbolP); - } - } - - return symbol_number; -} - -static unsigned int -glue_symbols (symbolS **head, symbolS **tail) -{ - unsigned int symbol_number = 0; - - while (*head != NULL) - { - symbolS *tmp = *head; - - /* Append. */ - symbol_remove (tmp, head, tail); - symbol_append (tmp, symbol_lastP, &symbol_rootP, &symbol_lastP); - - /* Process. */ - if (SF_GET_STRING (tmp)) - { - tmp->sy_name_offset = string_byte_count; - string_byte_count += strlen (S_GET_NAME (tmp)) + 1; - } - else - /* Fix "long" names. */ - tmp->sy_name_offset = 0; - - tmp->sy_number = symbol_number; - symbol_number += 1 + S_GET_NUMBER_AUXILIARY (tmp); - } - - return symbol_number; -} - -static unsigned int -tie_tags (void) -{ - unsigned int symbol_number = 0; - symbolS *symbolP; - - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - { - symbolP->sy_number = symbol_number; - - if (SF_GET_TAGGED (symbolP)) - { - SA_SET_SYM_TAGNDX - (symbolP, - ((symbolS *) SA_GET_SYM_TAGNDX (symbolP))->sy_number); - } - - symbol_number += 1 + S_GET_NUMBER_AUXILIARY (symbolP); - } - - return symbol_number; -} - - -/* Build a 'section static' symbol. */ - -static symbolS * -c_section_symbol (char *name, int idx) -{ - symbolS *symbolP; - - symbolP = symbol_find (name); - if (symbolP == NULL) - symbolP = symbol_new (name, idx, 0, &zero_address_frag); - else - { - /* Mmmm. I just love violating interfaces. Makes me feel...dirty. */ - S_SET_SEGMENT (symbolP, idx); - symbolP->sy_frag = &zero_address_frag; - } - - S_SET_STORAGE_CLASS (symbolP, C_STAT); - S_SET_NUMBER_AUXILIARY (symbolP, 1); - - SF_SET_STATICS (symbolP); - -#ifdef TE_DELTA - /* manfred@s-direktnet.de: section symbols *must* have the LOCAL bit cleared, - which is set by the new definition of LOCAL_LABEL in tc-m68k.h. */ - SF_CLEAR_LOCAL (symbolP); -#endif -#ifdef TE_PE - /* If the .linkonce pseudo-op was used for this section, we must - store the information in the auxiliary entry for the section - symbol. */ - if (segment_info[idx].linkonce != LINKONCE_UNSET) - { - int type; - - switch (segment_info[idx].linkonce) - { - default: - abort (); - case LINKONCE_DISCARD: - type = IMAGE_COMDAT_SELECT_ANY; - break; - case LINKONCE_ONE_ONLY: - type = IMAGE_COMDAT_SELECT_NODUPLICATES; - break; - case LINKONCE_SAME_SIZE: - type = IMAGE_COMDAT_SELECT_SAME_SIZE; - break; - case LINKONCE_SAME_CONTENTS: - type = IMAGE_COMDAT_SELECT_EXACT_MATCH; - break; - } - - SYM_AUXENT (symbolP)->x_scn.x_comdat = type; - } -#endif /* TE_PE */ - - return symbolP; -} - -static void -crawl_symbols (object_headers *h, bfd *abfd ATTRIBUTE_UNUSED) -{ - unsigned int i; - - /* Initialize the stack used to keep track of the matching .bb .be. */ - block_stack = stack_init (512, sizeof (symbolS *)); - - /* The symbol list should be ordered according to the following sequence - order : - . .file symbol - . debug entries for functions - . fake symbols for the sections, including .text .data and .bss - . defined symbols - . undefined symbols - But this is not mandatory. The only important point is to put the - undefined symbols at the end of the list. */ - - /* Is there a .file symbol ? If not insert one at the beginning. */ - if (symbol_rootP == NULL - || S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE) - c_dot_file_symbol ("fake", 0); - - /* Build up static symbols for the sections, they are filled in later. */ - for (i = SEG_E0; i < SEG_LAST; i++) - if (segment_info[i].scnhdr.s_name[0]) - segment_info[i].dot = c_section_symbol ((char *) segment_info[i].name, - i - SEG_E0 + 1); - - /* Take all the externals out and put them into another chain. */ - H_SET_SYMBOL_TABLE_SIZE (h, yank_symbols ()); - /* Take the externals and glue them onto the end. */ - H_SET_SYMBOL_TABLE_SIZE (h, - (H_GET_SYMBOL_COUNT (h) - + glue_symbols (&symbol_globalP, - &symbol_global_lastP) - + glue_symbols (&symbol_externP, - &symbol_extern_lastP))); - - H_SET_SYMBOL_TABLE_SIZE (h, tie_tags ()); - know (symbol_globalP == NULL); - know (symbol_global_lastP == NULL); - know (symbol_externP == NULL); - know (symbol_extern_lastP == NULL); -} - -/* Find strings by crawling along symbol table chain. */ - -static void -w_strings (char *where) -{ - symbolS *symbolP; - struct filename_list *filename_list_scan = filename_list_head; - - /* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK. */ - md_number_to_chars (where, (valueT) string_byte_count, 4); - where += 4; - -#ifdef COFF_LONG_SECTION_NAMES - /* Support long section names as found in PE. This code must - coordinate with that in coff_header_append and write_object_file. */ - { - unsigned int i; - - for (i = SEG_E0; i < SEG_LAST; i++) - { - if (segment_info[i].scnhdr.s_name[0] - && strlen (segment_info[i].name) > SCNNMLEN) - { - unsigned int size; - - size = strlen (segment_info[i].name) + 1; - memcpy (where, segment_info[i].name, size); - where += size; - } - } - } -#endif /* COFF_LONG_SECTION_NAMES */ - - for (symbolP = symbol_rootP; - symbolP; - symbolP = symbol_next (symbolP)) - { - unsigned int size; - - if (SF_GET_STRING (symbolP)) - { - size = strlen (S_GET_NAME (symbolP)) + 1; - memcpy (where, S_GET_NAME (symbolP), size); - where += size; - } - if (S_GET_STORAGE_CLASS (symbolP) == C_FILE - && SA_GET_FILE_FNAME_ZEROS (symbolP) == 0 - && SA_GET_FILE_FNAME_OFFSET (symbolP) != 0) - { - size = strlen (filename_list_scan->filename) + 1; - memcpy (where, filename_list_scan->filename, size); - filename_list_scan = filename_list_scan ->next; - where += size; - } - } -} - -static void -do_linenos_for (bfd * abfd, - object_headers * h, - unsigned long *file_cursor) -{ - unsigned int idx; - unsigned long start = *file_cursor; - - for (idx = SEG_E0; idx < SEG_LAST; idx++) - { - segment_info_type *s = segment_info + idx; - - if (s->scnhdr.s_nlnno != 0) - { - struct lineno_list *line_ptr; - struct external_lineno *buffer = xmalloc (s->scnhdr.s_nlnno * LINESZ); - struct external_lineno *dst = buffer; - - /* Run through the table we've built and turn it into its external - form, take this chance to remove duplicates. */ - - for (line_ptr = s->lineno_list_head; - line_ptr != (struct lineno_list *) NULL; - line_ptr = line_ptr->next) - { - if (line_ptr->line.l_lnno == 0) - { - /* Turn a pointer to a symbol into the symbols' index, - provided that it has been initialised. */ - if (line_ptr->line.l_addr.l_symndx) - line_ptr->line.l_addr.l_symndx = - ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; - } - else - line_ptr->line.l_addr.l_paddr += ((struct frag *) (line_ptr->frag))->fr_address; - - (void) bfd_coff_swap_lineno_out (abfd, &(line_ptr->line), dst); - dst++; - } - - s->scnhdr.s_lnnoptr = *file_cursor; - - bfd_bwrite (buffer, (bfd_size_type) s->scnhdr.s_nlnno * LINESZ, abfd); - free (buffer); - - *file_cursor += s->scnhdr.s_nlnno * LINESZ; - } - } - - H_SET_LINENO_SIZE (h, *file_cursor - start); -} - -/* Now we run through the list of frag chains in a segment and - make all the subsegment frags appear at the end of the - list, as if the seg 0 was extra long. */ - -static void -remove_subsegs (void) -{ - unsigned int i; - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - frchainS *head = segment_info[i].frchainP; - fragS dummy; - fragS *prev_frag = &dummy; - - while (head && head->frch_seg == i) - { - prev_frag->fr_next = head->frch_root; - prev_frag = head->frch_last; - head = head->frch_next; - } - prev_frag->fr_next = 0; - } -} - -unsigned long machine; -int coff_flags; - -#ifndef SUB_SEGMENT_ALIGN -#ifdef HANDLE_ALIGN -/* The last subsegment gets an alignment corresponding to the alignment - of the section. This allows proper nop-filling at the end of - code-bearing sections. */ -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ - (!(FRCHAIN)->frch_next || (FRCHAIN)->frch_next->frch_seg != (SEG) \ - ? get_recorded_alignment (SEG) : 0) -#else -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 1 -#endif -#endif - -static void -w_symbols (bfd * abfd, char *where, symbolS * symbol_rootP) -{ - symbolS *symbolP; - unsigned int i; - - /* First fill in those values we have only just worked out. */ - for (i = SEG_E0; i < SEG_LAST; i++) - { - symbolP = segment_info[i].dot; - if (symbolP) - { - SA_SET_SCN_SCNLEN (symbolP, segment_info[i].scnhdr.s_size); - SA_SET_SCN_NRELOC (symbolP, segment_info[i].scnhdr.s_nreloc); - SA_SET_SCN_NLINNO (symbolP, segment_info[i].scnhdr.s_nlnno); - } - } - - /* Emit all symbols left in the symbol chain. */ - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - { - /* Used to save the offset of the name. It is used to point - to the string in memory but must be a file offset. */ - char *temp; - - /* We can't fix the lnnoptr field in yank_symbols with the other - adjustments, because we have to wait until we know where they - go in the file. */ - if (SF_GET_ADJ_LNNOPTR (symbolP)) - SA_GET_SYM_LNNOPTR (symbolP) += - segment_info[S_GET_SEGMENT (symbolP)].scnhdr.s_lnnoptr; - - tc_coff_symbol_emit_hook (symbolP); - - temp = S_GET_NAME (symbolP); - if (SF_GET_STRING (symbolP)) - { - S_SET_OFFSET (symbolP, symbolP->sy_name_offset); - S_SET_ZEROES (symbolP, 0); - } - else - { - memset (symbolP->sy_symbol.ost_entry.n_name, 0, SYMNMLEN); - strncpy (symbolP->sy_symbol.ost_entry.n_name, temp, SYMNMLEN); - } - where = symbol_to_chars (abfd, where, symbolP); - S_SET_NAME (symbolP, temp); - } -} - -static void -fixup_mdeps (fragS *frags, - object_headers *h ATTRIBUTE_UNUSED, - segT this_segment) -{ - subseg_change (this_segment, 0); - - while (frags) - { - switch (frags->fr_type) - { - case rs_align: - case rs_align_code: - case rs_align_test: - case rs_org: -#ifdef HANDLE_ALIGN - HANDLE_ALIGN (frags); -#endif - frags->fr_type = rs_fill; - frags->fr_offset = - ((frags->fr_next->fr_address - frags->fr_address - frags->fr_fix) - / frags->fr_var); - break; - case rs_machine_dependent: - md_convert_frag (h, this_segment, frags); - frag_wane (frags); - break; - default: - ; - } - frags = frags->fr_next; - } -} - -#ifndef TC_FORCE_RELOCATION -#define TC_FORCE_RELOCATION(fix) 0 -#endif - -static void -fixup_segment (segment_info_type * segP, segT this_segment_type) -{ - fixS * fixP; - symbolS *add_symbolP; - symbolS *sub_symbolP; - long add_number; - int size; - char *place; - long where; - char pcrel; - fragS *fragP; - segT add_symbol_segment = absolute_section; - - for (fixP = segP->fix_root; fixP; fixP = fixP->fx_next) - { - fragP = fixP->fx_frag; - know (fragP); - where = fixP->fx_where; - place = fragP->fr_literal + where; - size = fixP->fx_size; - add_symbolP = fixP->fx_addsy; - sub_symbolP = fixP->fx_subsy; - add_number = fixP->fx_offset; - pcrel = fixP->fx_pcrel; - - /* We want function-relative stabs to work on systems which - may use a relaxing linker; thus we must handle the sym1-sym2 - fixups function-relative stabs generates. - - Of course, if you actually enable relaxing in the linker, the - line and block scoping information is going to be incorrect - in some cases. The only way to really fix this is to support - a reloc involving the difference of two symbols. */ - if (linkrelax - && (!sub_symbolP || pcrel)) - continue; - -#ifdef TC_I960 - if (fixP->fx_tcbit && SF_GET_CALLNAME (add_symbolP)) - { - /* Relocation should be done via the associated 'bal' entry - point symbol. */ - if (!SF_GET_BALNAME (tc_get_bal_of_call (add_symbolP))) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("No 'bal' entry point for leafproc %s"), - S_GET_NAME (add_symbolP)); - continue; - } - fixP->fx_addsy = add_symbolP = tc_get_bal_of_call (add_symbolP); - } -#endif - - /* Make sure the symbols have been resolved; this may not have - happened if these are expression symbols. */ - if (add_symbolP != NULL && ! add_symbolP->sy_resolved) - resolve_symbol_value (add_symbolP); - - if (add_symbolP != NULL) - { - /* If this fixup is against a symbol which has been equated - to another symbol, convert it to the other symbol. */ - if (add_symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (add_symbolP) - || S_IS_COMMON (add_symbolP))) - { - while (add_symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (add_symbolP) - || S_IS_COMMON (add_symbolP))) - { - symbolS *n; - - /* We must avoid looping, as that can occur with a - badly written program. */ - n = add_symbolP->sy_value.X_add_symbol; - if (n == add_symbolP) - break; - add_number += add_symbolP->sy_value.X_add_number; - add_symbolP = n; - } - fixP->fx_addsy = add_symbolP; - fixP->fx_offset = add_number; - } - } - - if (sub_symbolP != NULL && ! sub_symbolP->sy_resolved) - resolve_symbol_value (sub_symbolP); - - if (add_symbolP != NULL - && add_symbolP->sy_mri_common) - { - add_number += S_GET_VALUE (add_symbolP); - fixP->fx_offset = add_number; - add_symbolP = fixP->fx_addsy = add_symbolP->sy_value.X_add_symbol; - } - - if (add_symbolP) - add_symbol_segment = S_GET_SEGMENT (add_symbolP); - - if (sub_symbolP) - { - if (add_symbolP == NULL || add_symbol_segment == absolute_section) - { - if (add_symbolP != NULL) - { - add_number += S_GET_VALUE (add_symbolP); - add_symbolP = NULL; - fixP->fx_addsy = NULL; - } - - /* It's just -sym. */ - if (S_GET_SEGMENT (sub_symbolP) == absolute_section) - { - add_number -= S_GET_VALUE (sub_symbolP); - fixP->fx_subsy = 0; - fixP->fx_done = 1; - } - else - { -#ifndef TC_M68K - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Negative of non-absolute symbol %s"), - S_GET_NAME (sub_symbolP)); -#endif - add_number -= S_GET_VALUE (sub_symbolP); - } /* not absolute */ - - /* If sub_symbol is in the same segment that add_symbol - and add_symbol is either in DATA, TEXT, BSS or ABSOLUTE. */ - } - else if (S_GET_SEGMENT (sub_symbolP) == add_symbol_segment - && SEG_NORMAL (add_symbol_segment)) - { - /* Difference of 2 symbols from same segment. Can't - make difference of 2 undefineds: 'value' means - something different for N_UNDF. */ -#ifdef TC_I960 - /* Makes no sense to use the difference of 2 arbitrary symbols - as the target of a call instruction. */ - if (fixP->fx_tcbit) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("callj to difference of 2 symbols")); -#endif /* TC_I960 */ - add_number += S_GET_VALUE (add_symbolP) - - S_GET_VALUE (sub_symbolP); - add_symbolP = NULL; - - if (!TC_FORCE_RELOCATION (fixP)) - { - fixP->fx_addsy = NULL; - fixP->fx_subsy = NULL; - fixP->fx_done = 1; -#ifdef TC_M68K /* FIXME: Is this right? */ - pcrel = 0; - fixP->fx_pcrel = 0; -#endif - } - } - else - { - /* Different segments in subtraction. */ - know (!(S_IS_EXTERNAL (sub_symbolP) && (S_GET_SEGMENT (sub_symbolP) == absolute_section))); - - if ((S_GET_SEGMENT (sub_symbolP) == absolute_section)) - add_number -= S_GET_VALUE (sub_symbolP); - -#ifdef DIFF_EXPR_OK - else if (S_GET_SEGMENT (sub_symbolP) == this_segment_type) - { - /* Make it pc-relative. */ - add_number += (md_pcrel_from (fixP) - - S_GET_VALUE (sub_symbolP)); - pcrel = 1; - fixP->fx_pcrel = 1; - sub_symbolP = 0; - fixP->fx_subsy = 0; - } -#endif - else - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld."), - segment_name (S_GET_SEGMENT (sub_symbolP)), - S_GET_NAME (sub_symbolP), - (long) (fragP->fr_address + where)); - } - } - } - - if (add_symbolP) - { - if (add_symbol_segment == this_segment_type && pcrel) - { - /* This fixup was made when the symbol's segment was - SEG_UNKNOWN, but it is now in the local segment. - So we know how to do the address without relocation. */ -#ifdef TC_I960 - /* reloc_callj() may replace a 'call' with a 'calls' or a 'bal', - in which cases it modifies *fixP as appropriate. In the case - of a 'calls', no further work is required, and *fixP has been - set up to make the rest of the code below a no-op. */ - reloc_callj (fixP); -#endif - - add_number += S_GET_VALUE (add_symbolP); - add_number -= md_pcrel_from (fixP); - - /* We used to do - add_number -= segP->scnhdr.s_vaddr; - if defined (TC_I386) || defined (TE_LYNX). I now - think that was an error propagated from the case when - we are going to emit the relocation. If we are not - going to emit the relocation, then we just want to - set add_number to the difference between the symbols. - This is a case that would only arise when there is a - PC relative reference from a section other than .text - to a symbol defined in the same section, and the - reference is not relaxed. Since jump instructions on - the i386 are relaxed, this could only arise with a - call instruction. */ - - /* Lie. Don't want further pcrel processing. */ - pcrel = 0; - if (!TC_FORCE_RELOCATION (fixP)) - { - fixP->fx_addsy = NULL; - fixP->fx_done = 1; - } - } - else - { - switch (add_symbol_segment) - { - case absolute_section: -#ifdef TC_I960 - /* See comment about reloc_callj() above. */ - reloc_callj (fixP); -#endif /* TC_I960 */ - add_number += S_GET_VALUE (add_symbolP); - add_symbolP = NULL; - - if (!TC_FORCE_RELOCATION (fixP)) - { - fixP->fx_addsy = NULL; - fixP->fx_done = 1; - } - break; - default: - -#if defined(TC_A29K) || (defined(TE_PE) && defined(TC_I386)) || defined(TC_M88K) || defined(TC_OR32) - /* This really should be handled in the linker, but - backward compatibility forbids. */ - add_number += S_GET_VALUE (add_symbolP); -#else - add_number += S_GET_VALUE (add_symbolP) + - segment_info[S_GET_SEGMENT (add_symbolP)].scnhdr.s_paddr; -#endif - break; - - case SEG_UNKNOWN: -#ifdef TC_I960 - if ((int) fixP->fx_bit_fixP == 13) - { - /* This is a COBR instruction. They have only a - 13-bit displacement and are only to be used - for local branches: flag as error, don't generate - relocation. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("can't use COBR format with external label")); - fixP->fx_addsy = NULL; - fixP->fx_done = 1; - continue; - } -#endif /* TC_I960 */ -#if ((defined (TC_I386) || defined (TE_LYNX) || defined (TE_AUX)) && !defined(TE_PE)) || defined (COFF_COMMON_ADDEND) - /* 386 COFF uses a peculiar format in which the - value of a common symbol is stored in the .text - segment (I've checked this on SVR3.2 and SCO - 3.2.2) Ian Taylor <ian@cygnus.com>. */ - /* This is also true for 68k COFF on sysv machines - (Checked on Motorola sysv68 R3V6 and R3V7.1, and also on - UNIX System V/M68000, Release 1.0 from ATT/Bell Labs) - Philippe De Muyter <phdm@info.ucl.ac.be>. */ - if (S_IS_COMMON (add_symbolP)) - add_number += S_GET_VALUE (add_symbolP); -#endif - break; - - } - } - } - - if (pcrel) - { -#if !defined(TC_M88K) && !(defined(TE_PE) && defined(TC_I386)) && !defined(TC_A29K) && !defined(TC_OR32) - /* This adjustment is not correct on the m88k, for which the - linker does all the computation. */ - add_number -= md_pcrel_from (fixP); -#endif - if (add_symbolP == 0) - fixP->fx_addsy = &abs_symbol; -#if defined (TC_I386) || defined (TE_LYNX) || defined (TC_I960) || defined (TC_M68K) - /* On the 386 we must adjust by the segment vaddr as well. - Ian Taylor. - - I changed the i960 to work this way as well. This is - compatible with the current GNU linker behaviour. I do - not know what other i960 COFF assemblers do. This is not - a common case: normally, only assembler code will contain - a PC relative reloc, and only branches which do not - originate in the .text section will have a non-zero - address. - - I changed the m68k to work this way as well. This will - break existing PC relative relocs from sections which do - not start at address 0, but it will make ld -r work. - Ian Taylor, 4 Oct 96. */ - - add_number -= segP->scnhdr.s_vaddr; -#endif - } - - md_apply_fix (fixP, (valueT *) & add_number, this_segment_type); - - if (!fixP->fx_bit_fixP && ! fixP->fx_no_overflow) - { -#ifndef TC_M88K - /* The m88k uses the offset field of the reloc to get around - this problem. */ - if ((size == 1 - && ((add_number & ~0xFF) - || (fixP->fx_signed && (add_number & 0x80))) - && ((add_number & ~0xFF) != (-1 & ~0xFF) - || (add_number & 0x80) == 0)) - || (size == 2 - && ((add_number & ~0xFFFF) - || (fixP->fx_signed && (add_number & 0x8000))) - && ((add_number & ~0xFFFF) != (-1 & ~0xFFFF) - || (add_number & 0x8000) == 0))) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Value of %ld too large for field of %d bytes at 0x%lx"), - (long) add_number, size, - (unsigned long) (fragP->fr_address + where)); - } -#endif -#ifdef WARN_SIGNED_OVERFLOW_WORD - /* Warn if a .word value is too large when treated as a - signed number. We already know it is not too negative. - This is to catch over-large switches generated by gcc on - the 68k. */ - if (!flag_signed_overflow_ok - && size == 2 - && add_number > 0x7fff) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Signed .word overflow; switch may be too large; %ld at 0x%lx"), - (long) add_number, - (unsigned long) (fragP->fr_address + where)); -#endif - } - } -} - -/* Fill in the counts in the first entry in a .stab section. */ - -static void -adjust_stab_section (bfd *abfd, segT seg) -{ - segT stabstrseg = SEG_UNKNOWN; - const char *secname, *name2; - char *name; - char *p = NULL; - int i, strsz = 0, nsyms; - fragS *frag = segment_info[seg].frchainP->frch_root; - - /* Look for the associated string table section. */ - - secname = segment_info[seg].name; - name = alloca (strlen (secname) + 4); - strcpy (name, secname); - strcat (name, "str"); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - name2 = segment_info[i].name; - if (name2 != NULL && strneq (name2, name, 8)) - { - stabstrseg = i; - break; - } - } - - /* If we found the section, get its size. */ - if (stabstrseg != SEG_UNKNOWN) - strsz = size_section (abfd, stabstrseg); - - nsyms = size_section (abfd, seg) / 12 - 1; - - /* Look for the first frag of sufficient size for the initial stab - symbol, and collect a pointer to it. */ - while (frag && frag->fr_fix < 12) - frag = frag->fr_next; - assert (frag != 0); - p = frag->fr_literal; - assert (p != 0); - - /* Write in the number of stab symbols and the size of the string - table. */ - bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6); - bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8); -} - -void -write_object_file (void) -{ - int i; - const char *name; - struct frchain *frchain_ptr; - object_headers headers; - unsigned long file_cursor; - bfd *abfd; - unsigned int addr; - abfd = bfd_openw (out_file_name, TARGET_FORMAT); - - if (abfd == 0) - { - as_perror (_("FATAL: Can't create %s"), out_file_name); - exit (EXIT_FAILURE); - } - bfd_set_format (abfd, bfd_object); - bfd_set_arch_mach (abfd, BFD_ARCH, machine); - - string_byte_count = 4; - - /* Run through all the sub-segments and align them up. Also - close any open frags. We tack a .fill onto the end of the - frag chain so that any .align's size can be worked by looking - at the next frag. */ - for (frchain_ptr = frchain_root; - frchain_ptr != (struct frchain *) NULL; - frchain_ptr = frchain_ptr->frch_next) - { - int alignment; - - subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg); - - alignment = SUB_SEGMENT_ALIGN (now_seg, frchain_ptr); - -#ifdef md_do_align - md_do_align (alignment, NULL, 0, 0, alignment_done); -#endif - if (subseg_text_p (now_seg)) - frag_align_code (alignment, 0); - else - frag_align (alignment, 0, 0); - -#ifdef md_do_align - alignment_done: -#endif - - frag_wane (frag_now); - frag_now->fr_fix = 0; - know (frag_now->fr_next == NULL); - } - - remove_subsegs (); - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - relax_segment (segment_info[i].frchainP->frch_root, i); - - /* Relaxation has completed. Freeze all syms. */ - finalize_syms = 1; - - H_SET_NUMBER_OF_SECTIONS (&headers, 0); - - /* Find out how big the sections are, and set the addresses. */ - addr = 0; - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - long size; - - segment_info[i].scnhdr.s_paddr = addr; - segment_info[i].scnhdr.s_vaddr = addr; - - if (segment_info[i].scnhdr.s_name[0]) - { - H_SET_NUMBER_OF_SECTIONS (&headers, - H_GET_NUMBER_OF_SECTIONS (&headers) + 1); - -#ifdef COFF_LONG_SECTION_NAMES - /* Support long section names as found in PE. This code - must coordinate with that in coff_header_append and - w_strings. */ - { - unsigned int len; - - len = strlen (segment_info[i].name); - if (len > SCNNMLEN) - string_byte_count += len + 1; - } -#endif /* COFF_LONG_SECTION_NAMES */ - } - - size = size_section (abfd, (unsigned int) i); - addr += size; - - /* I think the section alignment is only used on the i960; the - i960 needs it, and it should do no harm on other targets. */ -#ifdef ALIGNMENT_IN_S_FLAGS - segment_info[i].scnhdr.s_flags |= (section_alignment[i] & 0xF) << 8; -#else - segment_info[i].scnhdr.s_align = 1 << section_alignment[i]; -#endif - - if (i == SEG_E0) - H_SET_TEXT_SIZE (&headers, size); - else if (i == SEG_E1) - H_SET_DATA_SIZE (&headers, size); - else if (i == SEG_E2) - H_SET_BSS_SIZE (&headers, size); - } - - /* Turn the gas native symbol table shape into a coff symbol table. */ - crawl_symbols (&headers, abfd); - - if (string_byte_count == 4) - string_byte_count = 0; - - H_SET_STRING_SIZE (&headers, string_byte_count); - -#ifdef tc_frob_file - tc_frob_file (); -#endif - - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - fixup_mdeps (segment_info[i].frchainP->frch_root, &headers, i); - fixup_segment (&segment_info[i], i); - } - - /* Look for ".stab" segments and fill in their initial symbols - correctly. */ - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - name = segment_info[i].name; - - if (name != NULL - && strneq (".stab", name, 5) - && ! strneq (".stabstr", name, 8)) - adjust_stab_section (abfd, i); - } - - file_cursor = H_GET_TEXT_FILE_OFFSET (&headers); - - bfd_seek (abfd, (file_ptr) file_cursor, 0); - - /* Plant the data. */ - fill_section (abfd, &headers, &file_cursor); - - do_relocs_for (abfd, &headers, &file_cursor); - - do_linenos_for (abfd, &headers, &file_cursor); - - H_SET_FILE_MAGIC_NUMBER (&headers, COFF_MAGIC); -#ifndef OBJ_COFF_OMIT_TIMESTAMP - H_SET_TIME_STAMP (&headers, (long) time (NULL)); -#else - H_SET_TIME_STAMP (&headers, 0); -#endif -#ifdef TC_COFF_SET_MACHINE - TC_COFF_SET_MACHINE (&headers); -#endif - -#ifndef COFF_FLAGS -#define COFF_FLAGS 0 -#endif - -#ifdef KEEP_RELOC_INFO - H_SET_FLAGS (&headers, ((H_GET_LINENO_SIZE (&headers) ? 0 : F_LNNO) | - COFF_FLAGS | coff_flags)); -#else - H_SET_FLAGS (&headers, ((H_GET_LINENO_SIZE (&headers) ? 0 : F_LNNO) | - (H_GET_RELOCATION_SIZE (&headers) ? 0 : F_RELFLG) | - COFF_FLAGS | coff_flags)); -#endif - - { - unsigned int symtable_size = H_GET_SYMBOL_TABLE_SIZE (&headers); - char *buffer1 = xmalloc (symtable_size + string_byte_count + 1); - - H_SET_SYMBOL_TABLE_POINTER (&headers, bfd_tell (abfd)); - w_symbols (abfd, buffer1, symbol_rootP); - if (string_byte_count > 0) - w_strings (buffer1 + symtable_size); - bfd_bwrite (buffer1, (bfd_size_type) symtable_size + string_byte_count, - abfd); - free (buffer1); - } - - coff_header_append (abfd, &headers); - - { - extern bfd *stdoutput; - stdoutput = abfd; - } -} - -/* Add a new segment. This is called from subseg_new via the - obj_new_segment macro. */ - -segT -obj_coff_add_segment (const char *name) -{ - unsigned int i; - -#ifndef COFF_LONG_SECTION_NAMES - char buf[SCNNMLEN + 1]; - - strncpy (buf, name, SCNNMLEN); - buf[SCNNMLEN] = '\0'; - name = buf; -#endif - - for (i = SEG_E0; i < SEG_LAST && segment_info[i].scnhdr.s_name[0]; i++) - if (streq (name, segment_info[i].name)) - return (segT) i; - - if (i == SEG_LAST) - { - as_bad (_("Too many new sections; can't add \"%s\""), name); - return now_seg; - } - - /* Add a new section. */ - strncpy (segment_info[i].scnhdr.s_name, name, - sizeof (segment_info[i].scnhdr.s_name)); - segment_info[i].scnhdr.s_flags = STYP_REG; - segment_info[i].name = xstrdup (name); - - return (segT) i; -} - -/* Implement the .section pseudo op: - .section name {, "flags"} - ^ ^ - | +--- optional flags: 'b' for bss - | 'i' for info - +-- section name 'l' for lib - 'n' for noload - 'o' for over - 'w' for data - 'd' (apparently m88k for data) - 'x' for text - 'r' for read-only data - But if the argument is not a quoted string, treat it as a - subsegment number. */ - -void -obj_coff_section (int ignore ATTRIBUTE_UNUSED) -{ - /* Strip out the section name. */ - char *section_name, *name; - char c; - unsigned int exp; - long flags; - - if (flag_mri) - { - char type; - - s_mri_sect (&type); - flags = 0; - if (type == 'C') - flags = STYP_TEXT; - else if (type == 'D') - flags = STYP_DATA; - segment_info[now_seg].scnhdr.s_flags |= flags; - - return; - } - - section_name = input_line_pointer; - c = get_symbol_end (); - - name = xmalloc (input_line_pointer - section_name + 1); - strcpy (name, section_name); - - *input_line_pointer = c; - - exp = 0; - flags = 0; - - SKIP_WHITESPACE (); - if (*input_line_pointer == ',') - { - ++input_line_pointer; - SKIP_WHITESPACE (); - - if (*input_line_pointer != '"') - exp = get_absolute_expression (); - else - { - ++input_line_pointer; - while (*input_line_pointer != '"' - && ! is_end_of_line[(unsigned char) *input_line_pointer]) - { - switch (*input_line_pointer) - { - case 'b': flags |= STYP_BSS; break; - case 'i': flags |= STYP_INFO; break; - case 'l': flags |= STYP_LIB; break; - case 'n': flags |= STYP_NOLOAD; break; - case 'o': flags |= STYP_OVER; break; - case 'd': - case 'w': flags |= STYP_DATA; break; - case 'x': flags |= STYP_TEXT; break; - case 'r': flags |= STYP_LIT; break; - default: - as_warn (_("unknown section attribute '%c'"), - *input_line_pointer); - break; - } - ++input_line_pointer; - } - if (*input_line_pointer == '"') - ++input_line_pointer; - } - } - - subseg_new (name, (subsegT) exp); - - segment_info[now_seg].scnhdr.s_flags |= flags; - - demand_empty_rest_of_line (); -} - -static void -obj_coff_text (int ignore ATTRIBUTE_UNUSED) -{ - subseg_new (".text", get_absolute_expression ()); -} - -static void -obj_coff_data (int ignore ATTRIBUTE_UNUSED) -{ - if (flag_readonly_data_in_text) - subseg_new (".text", get_absolute_expression () + 1000); - else - subseg_new (".data", get_absolute_expression ()); -} - -static void -obj_coff_ident (int ignore ATTRIBUTE_UNUSED) -{ - segT current_seg = now_seg; /* Save current seg. */ - subsegT current_subseg = now_subseg; - - subseg_new (".comment", 0); /* .comment seg. */ - stringer (1); /* Read string. */ - subseg_set (current_seg, current_subseg); /* Restore current seg. */ -} - -void -c_dot_file_symbol (const char *filename, int appfile ATTRIBUTE_UNUSED) -{ - symbolS *symbolP; - - symbolP = symbol_new (".file", SEG_DEBUG, 0, & zero_address_frag); - - S_SET_STORAGE_CLASS (symbolP, C_FILE); - S_SET_NUMBER_AUXILIARY (symbolP, 1); - - if (strlen (filename) > FILNMLEN) - { - /* Filename is too long to fit into an auxent, - we stick it into the string table instead. We keep - a linked list of the filenames we find so we can emit - them later. */ - struct filename_list *f = xmalloc (sizeof (* f)); - - f->filename = filename; - f->next = 0; - - SA_SET_FILE_FNAME_ZEROS (symbolP, 0); - SA_SET_FILE_FNAME_OFFSET (symbolP, 1); - - if (filename_list_tail) - filename_list_tail->next = f; - else - filename_list_head = f; - filename_list_tail = f; - } - else - SA_SET_FILE_FNAME (symbolP, filename); - -#ifndef NO_LISTING - { - extern int listing; - if (listing) - listing_source_file (filename); - } -#endif - - SF_SET_DEBUG (symbolP); - S_SET_VALUE (symbolP, (valueT) previous_file_symbol); - - previous_file_symbol = symbolP; - - /* Make sure that the symbol is first on the symbol chain. */ - if (symbol_rootP != symbolP) - { - symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); - symbol_insert (symbolP, symbol_rootP, &symbol_rootP, &symbol_lastP); - } -} - -static void -obj_coff_lcomm (int ignore ATTRIBUTE_UNUSED) -{ - s_lcomm (0); - return; -} - -/* The first entry in a .stab section is special. */ - -void -obj_coff_init_stab_section (segT seg) -{ - char *file; - char *p; - char *stabstr_name; - unsigned int stroff; - - /* Make space for this first symbol. */ - p = frag_more (12); - /* Zero it out. */ - memset (p, 0, 12); - as_where (&file, (unsigned int *) NULL); - stabstr_name = alloca (strlen (segment_info[seg].name) + 4); - strcpy (stabstr_name, segment_info[seg].name); - strcat (stabstr_name, "str"); - stroff = get_stab_string_offset (file, stabstr_name); - know (stroff == 1); - md_number_to_chars (p, stroff, 4); -} - -#endif /* not BFD_ASSEMBLER */ - const pseudo_typeS coff_pseudo_table[] = { {"ABORT", s_abort, 0}, @@ -4432,24 +1718,16 @@ const pseudo_typeS coff_pseudo_table[] = {"type", obj_coff_type, 0}, {"val", obj_coff_val, 0}, {"version", s_ignore, 0}, -#ifdef BFD_ASSEMBLER {"loc", obj_coff_loc, 0}, {"optim", s_ignore, 0}, /* For sun386i cc (?) */ {"weak", obj_coff_weak, 0}, -#else - {"data", obj_coff_data, 0}, - {"lcomm", obj_coff_lcomm, 0}, - {"text", obj_coff_text, 0}, - {"use", obj_coff_section, 0}, -#endif -#if defined TC_M88K || defined TC_TIC4X - /* The m88k and tic4x uses sdef instead of def. */ +#if defined TC_TIC4X + /* The tic4x uses sdef instead of def. */ {"sdef", obj_coff_def, 0}, #endif {NULL, NULL, 0} }; -#ifdef BFD_ASSEMBLER /* Support for a COFF emulation. */ @@ -4498,5 +1776,3 @@ const struct format_ops coff_format_ops = coff_obj_read_begin_hook, coff_obj_symbol_new_hook }; - -#endif diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 4d6434d..c6b4e63 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -25,16 +25,6 @@ #define OBJ_COFF 1 -#ifndef BFD_ASSEMBLER - -#define WORKING_DOT_WORD -#define WARN_SIGNED_OVERFLOW_WORD -#define OBJ_COFF_OMIT_OPTIONAL_HEADER -#define BFD_HEADERS -#define BFD - -#endif - #include "targ-cpu.h" #include "bfd.h" @@ -85,11 +75,6 @@ #endif #endif -#ifdef TC_A29K -#include "coff/a29k.h" -#define TARGET_FORMAT "coff-a29k-big" -#endif - #ifdef TC_OR32 #include "coff/or32.h" #define TARGET_FORMAT "coff-or32-big" @@ -147,16 +132,6 @@ #define TARGET_FORMAT "pe-mips" #endif -#ifdef TC_M88K -#include "coff/m88k.h" -#define TARGET_FORMAT "coff-m88kbcs" -#endif - -#ifdef TC_W65 -#include "coff/w65.h" -#define TARGET_FORMAT "coff-w65" -#endif - #ifdef TC_TIC30 #include "coff/tic30.h" #define TARGET_FORMAT "coff-tic30" @@ -172,12 +147,6 @@ #define TARGET_FORMAT "coff1-c54x" #endif -#ifdef TC_TIC80 -#include "coff/tic80.h" -#define TARGET_FORMAT "coff-tic80" -#define ALIGNMENT_IN_S_FLAGS 1 -#endif - #ifdef TC_MCORE #include "coff/mcore.h" #ifndef TARGET_FORMAT @@ -190,11 +159,6 @@ #define USE_UNIQUE 1 #endif -/* Targets may also set this. Also, if BFD_ASSEMBLER is defined, this - will already have been defined. */ -#undef SYMBOLS_NEED_BACKPOINTERS -#define SYMBOLS_NEED_BACKPOINTERS 1 - #ifndef OBJ_COFF_MAX_AUXENTRIES #define OBJ_COFF_MAX_AUXENTRIES 1 #endif @@ -202,44 +166,6 @@ #define obj_symbol_new_hook coff_obj_symbol_new_hook #define obj_read_begin_hook coff_obj_read_begin_hook -/* This file really contains two implementations of the COFF back end. - They are in the process of being merged, but this is only a - preliminary, mechanical merging. Many definitions that are - identical between the two are still found in both versions. - - The first version, with BFD_ASSEMBLER defined, uses high-level BFD - interfaces and data structures. The second version, with - BFD_ASSEMBLER not defined, also uses BFD, but mostly for swapping - data structures and for doing the actual I/O. The latter defines - the preprocessor symbols BFD and BFD_HEADERS. Try not to let this - confuse you. - - These two are in the process of being merged, and eventually the - BFD_ASSEMBLER version should take over completely. Release timing - issues and namespace problems convinced me to merge the two - together in this fashion, a little sooner than I would have liked. - The real merge should be much better done by the time the next - release comes out. - - For now, the structure of this file is: - <common> - #ifdef BFD_ASSEMBLER - <one version> - #else - <other version> - #endif - <common> - Unfortunately, the common portions are very small at the moment, - and many declarations or definitions are duplicated. The structure - of obj-coff.c is similar. - - See doc/internals.texi for a brief discussion of the history, if - you care. - - Ken Raeburn, 5 May 1994. */ - -#ifdef BFD_ASSEMBLER - #include "bfd/libcoff.h" #define OUTPUT_FLAVOR bfd_target_coff_flavour @@ -414,422 +340,6 @@ hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on i #endif /* no C_LEAFSTAT */ #endif /* TC_I960 */ -#else /* not BFD_ASSEMBLER */ - -#if defined TC_A29K || defined TC_OR32 -/* Allow translate from aout relocs to coff relocs. */ -#define NO_RELOC 20 -#define RELOC_32 1 -#define RELOC_8 2 -#define RELOC_CONST 3 -#define RELOC_CONSTH 4 -#define RELOC_JUMPTARG 5 -#define RELOC_BASE22 6 -#define RELOC_HI22 7 -#define RELOC_LO10 8 -#define RELOC_BASE13 9 -#define RELOC_WDISP22 10 -#define RELOC_WDISP30 11 -#endif - -extern const segT N_TYPE_seg[]; - -/* Magic number of paged executable. */ -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300 - -/* SYMBOL TABLE */ - -/* Symbol table entry data type. */ - -typedef struct -{ - /* Basic symbol. */ - struct internal_syment ost_entry; - /* Auxiliary entry. */ - union internal_auxent ost_auxent[OBJ_COFF_MAX_AUXENTRIES]; - /* obj_coff internal use only flags. */ - unsigned int ost_flags; -} obj_symbol_type; - -/* Symbol table macros and constants. */ - -/* Possible and useful section number in symbol table - The values of TEXT, DATA and BSS may not be portable. */ - -#define C_ABS_SECTION N_ABS -#define C_UNDEF_SECTION N_UNDEF -#define C_DEBUG_SECTION N_DEBUG -#define C_NTV_SECTION N_TV -#define C_PTV_SECTION P_TV -#define C_REGISTER_SECTION 50 - -/* Macros to extract information from a symbol table entry. - This syntactic indirection allows independence regarding a.out or coff. - The argument (s) of all these macros is a pointer to a symbol table entry. */ - -/* Predicates. */ -/* True if the symbol is external. */ -#define S_IS_EXTERNAL(s) \ - ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION) - -/* True if symbol has been defined, ie : - section > 0 (DATA, TEXT or BSS) - section == 0 and value > 0 (external bss symbol). */ -#define S_IS_DEFINED(s) \ - ((s)->sy_symbol.ost_entry.n_scnum > C_UNDEF_SECTION \ - || ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION \ - && S_GET_VALUE (s) > 0) \ - || ((s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION)) - -/* Return true for symbols that should not be reduced to section - symbols or eliminated from expressions, because they may be - overridden by the linker. */ -#define S_FORCE_RELOC(s, strict) \ - (!SEG_NORMAL (S_GET_SEGMENT (s)) || (strict && S_IS_WEAK (s))) - -/* True if a debug special symbol entry. */ -#define S_IS_DEBUG(s) \ - ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION) - -/* True if a symbol is local symbol name. */ -/* A symbol name whose name includes ^A is a gas internal pseudo symbol. */ -#define S_IS_LOCAL(s) \ - ((s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION \ - || (S_LOCAL_NAME(s) && ! flag_keep_locals && ! S_IS_DEBUG (s)) \ - || strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL \ - || (flag_strip_local_absolute \ - && !S_IS_EXTERNAL (s) \ - && (s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION)) - -/* True if a symbol can be multiply defined (bss symbols have this def - though it is bad practice). */ -#define S_IS_COMMON(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \ - && S_GET_VALUE (s) != 0) - -/* True if a symbol name is in the string table, i.e. its length is > 8. */ -#define S_IS_STRING(s) (strlen (S_GET_NAME (s)) > 8 ? 1 : 0) - -/* True if a symbol is defined as weak. */ -#ifdef TE_PE -#define S_IS_WEAK(s) \ - ( (s)->sy_symbol.ost_entry.n_sclass == C_NT_WEAK \ - || (s)->sy_symbol.ost_entry.n_sclass == C_WEAKEXT) -#else -#define S_IS_WEAK(s) \ - ((s)->sy_symbol.ost_entry.n_sclass == C_WEAKEXT) -#endif - -/* Accessors. */ -/* The name of the symbol. */ -#define S_GET_NAME(s) ((char *) (s)->sy_symbol.ost_entry.n_offset) - -/* The pointer to the string table. */ -#define S_GET_OFFSET(s) ((s)->sy_symbol.ost_entry.n_offset) - -/* The numeric value of the segment. */ -#define S_GET_SEGMENT(s) s_get_segment (s) - -/* The data type. */ -#define S_GET_DATA_TYPE(s) ((s)->sy_symbol.ost_entry.n_type) - -/* The storage class. */ -#define S_GET_STORAGE_CLASS(s) ((s)->sy_symbol.ost_entry.n_sclass) - -/* The number of auxiliary entries. */ -#define S_GET_NUMBER_AUXILIARY(s) ((s)->sy_symbol.ost_entry.n_numaux) - -/* Modifiers. */ -/* Set the name of the symbol. */ -#define S_SET_NAME(s, v) \ - ((s)->sy_symbol.ost_entry.n_offset = (unsigned long) (v)) - -/* Set the offset of the symbol. */ -#define S_SET_OFFSET(s, v) \ - ((s)->sy_symbol.ost_entry.n_offset = (v)) - -/* The numeric value of the segment. */ -#define S_SET_SEGMENT(s, v) \ - ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE (v)) - -/* The data type. */ -#define S_SET_DATA_TYPE(s, v) \ - ((s)->sy_symbol.ost_entry.n_type = (v)) - -/* The storage class. */ -#define S_SET_STORAGE_CLASS(s, v) \ - ((s)->sy_symbol.ost_entry.n_sclass = (v)) - -/* The number of auxiliary entries. */ -#define S_SET_NUMBER_AUXILIARY(s, v) \ - ((s)->sy_symbol.ost_entry.n_numaux = (v)) - -/* Additional modifiers. */ -/* The symbol is external (does not mean undefined). */ -#define S_SET_EXTERNAL(s) \ - do \ - { \ - S_SET_STORAGE_CLASS (s, C_EXT); \ - SF_CLEAR_LOCAL (s); \ - } \ - while (0) - -/* Auxiliary entry macros. SA_ stands for symbol auxiliary. */ -/* Omit the tv related fields. */ -/* Accessors. */ -#define SYM_AUXENT(S) (&(S)->sy_symbol.ost_auxent[0]) - -#define SA_GET_SYM_TAGNDX(s) (SYM_AUXENT (s)->x_sym.x_tagndx.l) -#define SA_GET_SYM_LNNO(s) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno) -#define SA_GET_SYM_SIZE(s) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size) -#define SA_GET_SYM_FSIZE(s) (SYM_AUXENT (s)->x_sym.x_misc.x_fsize) -#define SA_GET_SYM_LNNOPTR(s) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr) -#define SA_GET_SYM_ENDNDX(s) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_endndx.l) -#define SA_GET_SYM_DIMEN(s,i) (SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)]) -#define SA_GET_FILE_FNAME(s) (SYM_AUXENT (s)->x_file.x_fname) -#define SA_GET_FILE_FNAME_OFFSET(s) (SYM_AUXENT (s)->x_file.x_n.x_offset) -#define SA_GET_FILE_FNAME_ZEROS(s) (SYM_AUXENT (s)->x_file.x_n.x_zeroes) -#define SA_GET_SCN_SCNLEN(s) (SYM_AUXENT (s)->x_scn.x_scnlen) -#define SA_GET_SCN_NRELOC(s) (SYM_AUXENT (s)->x_scn.x_nreloc) -#define SA_GET_SCN_NLINNO(s) (SYM_AUXENT (s)->x_scn.x_nlinno) - -/* Modifiers. */ -#define SA_SET_SYM_TAGNDX(s,v) (SYM_AUXENT (s)->x_sym.x_tagndx.l = (v)) -#define SA_SET_SYM_LNNO(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno = (v)) -#define SA_SET_SYM_SIZE(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size = (v)) -#define SA_SET_SYM_FSIZE(s,v) (SYM_AUXENT (s)->x_sym.x_misc.x_fsize = (v)) -#define SA_SET_SYM_LNNOPTR(s,v) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr = (v)) -#define SA_SET_SYM_ENDNDX(s,v) (SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_endndx.l = (v)) -#define SA_SET_SYM_DIMEN(s,i,v) (SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)] = (v)) -#define SA_SET_FILE_FNAME(s,v) strncpy (SYM_AUXENT (s)->x_file.x_fname,(v),FILNMLEN) -#define SA_SET_FILE_FNAME_OFFSET(s,v) (SYM_AUXENT (s)->x_file.x_n.x_offset = (v)) -#define SA_SET_FILE_FNAME_ZEROS(s,v) (SYM_AUXENT (s)->x_file.x_n.x_zeroes = (v)) -#define SA_SET_SCN_SCNLEN(s,v) (SYM_AUXENT (s)->x_scn.x_scnlen = (v)) -#define SA_SET_SCN_NRELOC(s,v) (SYM_AUXENT (s)->x_scn.x_nreloc = (v)) -#define SA_SET_SCN_NLINNO(s,v) (SYM_AUXENT (s)->x_scn.x_nlinno = (v)) - -/* Internal use only definitions. SF_ stands for symbol flags. - - These values can be assigned to sy_symbol.ost_flags field of a symbolS. - - You'll break i960 if you shift the SYSPROC bits anywhere else. for - more on the balname/callname hack, see tc-i960.h. b.out is done - differently. */ - -#define SF_I960_MASK 0x000001ff /* Bits 0-8 are used by the i960 port. */ -#define SF_SYSPROC 0x0000003f /* bits 0-5 are used to store the sysproc number. */ -#define SF_IS_SYSPROC 0x00000040 /* bit 6 marks symbols that are sysprocs. */ -#define SF_BALNAME 0x00000080 /* bit 7 marks BALNAME symbols. */ -#define SF_CALLNAME 0x00000100 /* bit 8 marks CALLNAME symbols. */ - -#define SF_NORMAL_MASK 0x0000ffff /* bits 12-15 are general purpose. */ - -#define SF_STATICS 0x00001000 /* Mark the .text & all symbols. */ -#define SF_DEFINED 0x00002000 /* Symbol is defined in this file. */ -#define SF_STRING 0x00004000 /* Symbol name length > 8. */ -#define SF_LOCAL 0x00008000 /* Symbol must not be emitted. */ - -#define SF_DEBUG_MASK 0xffff0000 /* bits 16-31 are debug info. */ - -#define SF_FUNCTION 0x00010000 /* The symbol is a function. */ -#define SF_PROCESS 0x00020000 /* Process symbol before write. */ -#define SF_TAGGED 0x00040000 /* Is associated with a tag. */ -#define SF_TAG 0x00080000 /* Is a tag. */ -#define SF_DEBUG 0x00100000 /* Is in debug or abs section. */ -#define SF_GET_SEGMENT 0x00200000 /* Get the section of the forward symbol. */ -#define SF_ADJ_LNNOPTR 0x00400000 /* Has a lnnoptr. */ -/* All other bits are unused. */ - -/* Accessors. */ -#define SF_GET(s) ((s)->sy_symbol.ost_flags) -#define SF_GET_NORMAL_FIELD(s) (SF_GET (s) & SF_NORMAL_MASK) -#define SF_GET_DEBUG_FIELD(s) (SF_GET (s) & SF_DEBUG_MASK) -#define SF_GET_FILE(s) (SF_GET (s) & SF_FILE) -#define SF_GET_STATICS(s) (SF_GET (s) & SF_STATICS) -#define SF_GET_DEFINED(s) (SF_GET (s) & SF_DEFINED) -#define SF_GET_STRING(s) (SF_GET (s) & SF_STRING) -#define SF_GET_LOCAL(s) (SF_GET (s) & SF_LOCAL) -#define SF_GET_FUNCTION(s) (SF_GET (s) & SF_FUNCTION) -#define SF_GET_PROCESS(s) (SF_GET (s) & SF_PROCESS) -#define SF_GET_DEBUG(s) (SF_GET (s) & SF_DEBUG) -#define SF_GET_TAGGED(s) (SF_GET (s) & SF_TAGGED) -#define SF_GET_TAG(s) (SF_GET (s) & SF_TAG) -#define SF_GET_GET_SEGMENT(s) (SF_GET (s) & SF_GET_SEGMENT) -#define SF_GET_ADJ_LNNOPTR(s) (SF_GET (s) & SF_ADJ_LNNOPTR) -#define SF_GET_I960(s) (SF_GET (s) & SF_I960_MASK) /* Used by i960. */ -#define SF_GET_BALNAME(s) (SF_GET (s) & SF_BALNAME) /* Used by i960. */ -#define SF_GET_CALLNAME(s) (SF_GET (s) & SF_CALLNAME) /* Used by i960. */ -#define SF_GET_IS_SYSPROC(s) (SF_GET (s) & SF_IS_SYSPROC) /* Used by i960. */ -#define SF_GET_SYSPROC(s) (SF_GET (s) & SF_SYSPROC) /* Used by i960. */ - -/* Modifiers. */ -#define SF_SET(s,v) (SF_GET (s) = (v)) -#define SF_SET_NORMAL_FIELD(s,v)(SF_GET (s) |= ((v) & SF_NORMAL_MASK)) -#define SF_SET_DEBUG_FIELD(s,v) (SF_GET (s) |= ((v) & SF_DEBUG_MASK)) -#define SF_SET_FILE(s) (SF_GET (s) |= SF_FILE) -#define SF_SET_STATICS(s) (SF_GET (s) |= SF_STATICS) -#define SF_SET_DEFINED(s) (SF_GET (s) |= SF_DEFINED) -#define SF_SET_STRING(s) (SF_GET (s) |= SF_STRING) -#define SF_SET_LOCAL(s) (SF_GET (s) |= SF_LOCAL) -#define SF_CLEAR_LOCAL(s) (SF_GET (s) &= ~SF_LOCAL) -#define SF_SET_FUNCTION(s) (SF_GET (s) |= SF_FUNCTION) -#define SF_SET_PROCESS(s) (SF_GET (s) |= SF_PROCESS) -#define SF_SET_DEBUG(s) (SF_GET (s) |= SF_DEBUG) -#define SF_SET_TAGGED(s) (SF_GET (s) |= SF_TAGGED) -#define SF_SET_TAG(s) (SF_GET (s) |= SF_TAG) -#define SF_SET_GET_SEGMENT(s) (SF_GET (s) |= SF_GET_SEGMENT) -#define SF_SET_ADJ_LNNOPTR(s) (SF_GET (s) |= SF_ADJ_LNNOPTR) -#define SF_SET_I960(s,v) (SF_GET (s) |= ((v) & SF_I960_MASK)) /* Used by i960. */ -#define SF_SET_BALNAME(s) (SF_GET (s) |= SF_BALNAME) /* Used by i960. */ -#define SF_SET_CALLNAME(s) (SF_GET (s) |= SF_CALLNAME) /* Used by i960. */ -#define SF_SET_IS_SYSPROC(s) (SF_GET (s) |= SF_IS_SYSPROC) /* Used by i960. */ -#define SF_SET_SYSPROC(s,v) (SF_GET (s) |= ((v) & SF_SYSPROC)) /* Used by i960. */ - -/* File header macro and type definition. */ - -/* File position calculators. Beware to use them when all the - appropriate fields are set in the header. */ - -#ifdef OBJ_COFF_OMIT_OPTIONAL_HEADER -#define OBJ_COFF_AOUTHDRSZ (0) -#else -#define OBJ_COFF_AOUTHDRSZ (AOUTHDRSZ) -#endif - -#define H_GET_TEXT_FILE_OFFSET(h) \ - (long) (FILHSZ \ - + OBJ_COFF_AOUTHDRSZ \ - + H_GET_NUMBER_OF_SECTIONS (h) * SCNHSZ) - -#define H_GET_DATA_FILE_OFFSET(h) \ - (long) (H_GET_TEXT_FILE_OFFSET (h) \ - + H_GET_TEXT_SIZE (h)) - -#define H_GET_BSS_FILE_OFFSET(h) 0 - -#define H_GET_RELOCATION_FILE_OFFSET(h) \ - (long) (H_GET_DATA_FILE_OFFSET (h) \ - + H_GET_DATA_SIZE (h)) - -#define H_GET_LINENO_FILE_OFFSET(h) \ - (long) (H_GET_RELOCATION_FILE_OFFSET (h) \ - + H_GET_RELOCATION_SIZE (h)) - -#define H_GET_SYMBOL_TABLE_FILE_OFFSET(h) \ - (long) (H_GET_LINENO_FILE_OFFSET (h) \ - + H_GET_LINENO_SIZE (h)) - -#define H_GET_FILE_SIZE(h) \ - (long) (H_GET_SYMBOL_TABLE_FILE_OFFSET (h) \ - + H_GET_SYMBOL_TABLE_SIZE (h) \ - + (h)->string_table_size) - -/* Accessors. */ -/* aouthdr. */ -#define H_GET_MAGIC_NUMBER(h) ((h)->aouthdr.magic) -#define H_GET_VERSION_STAMP(h) ((h)->aouthdr.vstamp) -#define H_GET_TEXT_SIZE(h) ((h)->aouthdr.tsize) -#define H_GET_DATA_SIZE(h) ((h)->aouthdr.dsize) -#define H_GET_BSS_SIZE(h) ((h)->aouthdr.bsize) -#define H_GET_ENTRY_POINT(h) ((h)->aouthdr.entry) -#define H_GET_TEXT_START(h) ((h)->aouthdr.text_start) -#define H_GET_DATA_START(h) ((h)->aouthdr.data_start) -/* filehdr. */ -#define H_GET_FILE_MAGIC_NUMBER(h) ((h)->filehdr.f_magic) -#define H_GET_NUMBER_OF_SECTIONS(h) ((h)->filehdr.f_nscns) -#define H_GET_TIME_STAMP(h) ((h)->filehdr.f_timdat) -#define H_GET_SYMBOL_TABLE_POINTER(h) ((h)->filehdr.f_symptr) -#define H_GET_SYMBOL_COUNT(h) ((h)->filehdr.f_nsyms) -#define H_GET_SYMBOL_TABLE_SIZE(h) (H_GET_SYMBOL_COUNT(h) * SYMESZ) -#define H_GET_SIZEOF_OPTIONAL_HEADER(h) ((h)->filehdr.f_opthdr) -#define H_GET_FLAGS(h) ((h)->filehdr.f_flags) -/* Extra fields to achieve bsd a.out compatibility and for convenience. */ -#define H_GET_RELOCATION_SIZE(h) ((h)->relocation_size) -#define H_GET_STRING_SIZE(h) ((h)->string_table_size) -#define H_GET_LINENO_SIZE(h) ((h)->lineno_size) - -#ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER -#define H_GET_HEADER_SIZE(h) (sizeof (FILHDR) \ - + sizeof (AOUTHDR)\ - + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) -#else /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ -#define H_GET_HEADER_SIZE(h) (sizeof (FILHDR) \ - + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) -#endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ - -#define H_GET_TEXT_RELOCATION_SIZE(h) (text_section_header.s_nreloc * RELSZ) -#define H_GET_DATA_RELOCATION_SIZE(h) (data_section_header.s_nreloc * RELSZ) - -/* Modifiers. */ -/* aouthdr. */ -#define H_SET_MAGIC_NUMBER(h,v) ((h)->aouthdr.magic = (v)) -#define H_SET_VERSION_STAMP(h,v) ((h)->aouthdr.vstamp = (v)) -#define H_SET_TEXT_SIZE(h,v) ((h)->aouthdr.tsize = (v)) -#define H_SET_DATA_SIZE(h,v) ((h)->aouthdr.dsize = (v)) -#define H_SET_BSS_SIZE(h,v) ((h)->aouthdr.bsize = (v)) -#define H_SET_ENTRY_POINT(h,v) ((h)->aouthdr.entry = (v)) -#define H_SET_TEXT_START(h,v) ((h)->aouthdr.text_start = (v)) -#define H_SET_DATA_START(h,v) ((h)->aouthdr.data_start = (v)) -/* filehdr. */ -#define H_SET_FILE_MAGIC_NUMBER(h,v) ((h)->filehdr.f_magic = (v)) -#define H_SET_NUMBER_OF_SECTIONS(h,v) ((h)->filehdr.f_nscns = (v)) -#define H_SET_TIME_STAMP(h,v) ((h)->filehdr.f_timdat = (v)) -#define H_SET_SYMBOL_TABLE_POINTER(h,v) ((h)->filehdr.f_symptr = (v)) -#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->filehdr.f_nsyms = (v)) -#define H_SET_SIZEOF_OPTIONAL_HEADER(h,v) ((h)->filehdr.f_opthdr = (v)) -#define H_SET_FLAGS(h,v) ((h)->filehdr.f_flags = (v)) -/* Extra fields to achieve bsd a.out compatibility and for convenience. */ -#define H_SET_RELOCATION_SIZE(h,t,d) ((h)->relocation_size = (t)+(d)) -#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) -#define H_SET_LINENO_SIZE(h,v) ((h)->lineno_size = (v)) - -/* Segment flipping. */ - -typedef struct -{ - struct internal_aouthdr aouthdr; /* a.out header. */ - struct internal_filehdr filehdr; /* File header, not machine dep. */ - long string_table_size; /* names + '\0' + sizeof (int). */ - long relocation_size; /* Cumulated size of relocation - information for all sections in - bytes. */ - long lineno_size; /* Size of the line number information - table in bytes. */ -} object_headers; - -struct lineno_list -{ - struct bfd_internal_lineno line; - char *frag; /* Frag to which the line number is related. */ - struct lineno_list *next; /* Forward chain pointer. */ -}; - -#define obj_segment_name(i) (segment_info[(int) (i)].scnhdr.s_name) - -#define obj_add_segment(s) obj_coff_add_segment (s) - -/* Sanity check. */ -#ifdef TC_I960 -#ifndef C_LEAFSTAT -hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on it. -#endif /* no C_LEAFSTAT */ -#endif /* TC_I960 */ - -extern struct internal_scnhdr data_section_header; -extern struct internal_scnhdr text_section_header; - -/* Forward the segment of a forwarded symbol. */ -#define OBJ_COPY_SYMBOL_ATTRIBUTES(dest,src) \ - (SF_GET_GET_SEGMENT (dest) \ - ? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \ - : 0) - -#ifdef TE_PE -#define obj_handle_link_once(t) obj_coff_pe_handle_link_once (t) -#endif - -#endif /* not BFD_ASSEMBLER */ - extern const pseudo_typeS coff_pseudo_table[]; #ifndef obj_pop_insert @@ -861,7 +371,6 @@ extern const pseudo_typeS coff_pseudo_table[]; #define obj_app_file(name, app) c_dot_file_symbol (name, app) -#ifdef BFD_ASSEMBLER extern int S_SET_DATA_TYPE (symbolS *, int); extern int S_SET_STORAGE_CLASS (symbolS *, int); extern int S_GET_STORAGE_CLASS (symbolS *); @@ -873,9 +382,6 @@ extern void coff_adjust_symtab (void); extern void coff_frob_section (segT); extern void coff_adjust_section_syms (bfd *, asection *, void *); extern void coff_frob_file_after_relocs (void); -#else -extern void obj_extra_stuff (object_headers *); -#endif extern void coff_obj_symbol_new_hook (symbolS *); extern void coff_obj_read_begin_hook (void); extern void obj_coff_section (int); diff --git a/gas/config/obj-evax.h b/gas/config/obj-evax.h index 39ac7a1..413a837 100644 --- a/gas/config/obj-evax.h +++ b/gas/config/obj-evax.h @@ -1,5 +1,5 @@ /* This file is obj-evax.h - Copyright 1996, 2000 Free Software Foundation, Inc. + Copyright 1996, 2000, 2005 Free Software Foundation, Inc. Contributed by Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany. @@ -31,9 +31,7 @@ /* include whatever target cpu is appropriate. */ #include "targ-cpu.h" -#ifdef BFD_ASSEMBLER #define OUTPUT_FLAVOR bfd_target_evax_flavour -#endif /* * SYMBOLS @@ -58,8 +56,6 @@ obj_symbol_type; /* should be the format's symbol structure */ typedef void *object_headers; -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ - #define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ #define obj_symbol_new_hook(s) {;} diff --git a/gas/config/obj-hp300.c b/gas/config/obj-hp300.c deleted file mode 100644 index c6fdf1e..0000000 --- a/gas/config/obj-hp300.c +++ /dev/null @@ -1,54 +0,0 @@ -/* This file is obj-hp300.h - Copyright 1993, 2000, 2005 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "config/obj-aout.c" - -/* Aout file generation & utilities */ -void -hp300_header_append (where, headers) - char **where; - object_headers *headers; -{ - tc_headers_hook (headers); - -#define DO(FIELD) \ - { \ - md_number_to_chars (*where, headers->header.FIELD, \ - sizeof (((struct exec_bytes *) 0)->FIELD)); \ - *where += sizeof (((struct exec_bytes *) 0)->FIELD); \ - } - - DO (a_info); - DO (a_spare1); - DO (a_spare2); - DO (a_text); - DO (a_data); - DO (a_bss); - DO (a_trsize); - DO (a_drsize); - DO (a_spare3); - DO (a_spare4); - DO (a_spare5); - DO (a_entry); - DO (a_spare6); - DO (a_spare7); - DO (a_syms); - DO (a_spare8); -} diff --git a/gas/config/obj-hp300.h b/gas/config/obj-hp300.h deleted file mode 100644 index 5cd178a..0000000 --- a/gas/config/obj-hp300.h +++ /dev/null @@ -1,72 +0,0 @@ -/* This file is obj-hp300.h - Copyright 1993, 2000, 2005 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define __STRUCT_EXEC_OVERRIDE__ - -struct exec_bytes -{ - unsigned char a_info[4]; /* a_machtype/a_magic */ - unsigned char a_spare1[4]; - unsigned char a_spare2[4]; - unsigned char a_text[4]; /* length of text, in bytes */ - unsigned char a_data[4]; /* length of data, in bytes */ - unsigned char a_bss[4]; /* length of uninitialized data area for file, in bytes */ - unsigned char a_trsize[4]; /* length of relocation info for text, in bytes */ - unsigned char a_drsize[4]; /* length of relocation info for data, in bytes */ - unsigned char a_spare3[4]; /* HP = pascal interface size */ - unsigned char a_spare4[4]; /* HP = symbol table size */ - unsigned char a_spare5[4]; /* HP = debug name table size */ - unsigned char a_entry[4]; /* start address */ - unsigned char a_spare6[4]; /* HP = source line table size */ - unsigned char a_spare7[4]; /* HP = value table size */ - unsigned char a_syms[4]; /* length of symbol table data in file, in bytes */ - unsigned char a_spare8[4]; -}; - -/* How big the "struct exec" is on disk */ -#define EXEC_BYTES_SIZE (16 * 4) - -struct exec -{ - unsigned long a_info; - unsigned long a_spare1; - unsigned long a_spare2; - unsigned long a_text; - unsigned long a_data; - unsigned long a_bss; - unsigned long a_trsize; - unsigned long a_drsize; - unsigned long a_spare3; - unsigned long a_spare4; - unsigned long a_spare5; - unsigned long a_entry; - unsigned long a_spare6; - unsigned long a_spare7; - unsigned long a_syms; - unsigned long a_spare8; -}; - -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (OMAGIC) -#define AOUT_VERSION 0x02 -#define AOUT_MACHTYPE 0x0c -#define OMAGIC 0x106 - -#define obj_header_append hp300_header_append -#include "config/obj-aout.h" diff --git a/gas/config/obj-ieee.h b/gas/config/obj-ieee.h index 4446e38..2965429 100644 --- a/gas/config/obj-ieee.h +++ b/gas/config/obj-ieee.h @@ -19,8 +19,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#define BFD 1 - #include "bfd.h" typedef struct @@ -43,8 +41,6 @@ typedef struct } object_headers; -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 1 - int lineno_rootP; #define IEEE_STYLE diff --git a/gas/config/tc-a29k.c b/gas/config/tc-a29k.c deleted file mode 100644 index 26b02ca..0000000 --- a/gas/config/tc-a29k.c +++ /dev/null @@ -1,1187 +0,0 @@ -/* tc-a29k.c -- Assemble for the AMD 29000. - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2001, - 2002, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* John Gilmore has reorganized this module somewhat, to make it easier - to convert it to new machines' assemblers as desired. There was too - much bloody rewriting required before. There still probably is. */ - -#include "as.h" -#include "safe-ctype.h" - -#include "opcode/a29k.h" - -/* Make it easier to clone this machine desc into another one. */ -#define machine_opcode a29k_opcode -#define machine_opcodes a29k_opcodes -#define machine_ip a29k_ip -#define machine_it a29k_it - -#define IMMEDIATE_BIT 0x01000000 /* Turns RB into Immediate. */ -#define ABSOLUTE_BIT 0x01000000 /* Turns PC-relative to Absolute. */ -#define CE_BIT 0x00800000 /* Coprocessor enable in LOAD. */ -#define UI_BIT 0x00000080 /* Unsigned integer in CONVERT. */ - -/* handle of the OPCODE hash table. */ -static struct hash_control *op_hash = NULL; - -struct machine_it -{ - char *error; - unsigned long opcode; - struct nlist *nlistp; - expressionS exp; - int pcrel; - int reloc_offset; /* Offset of reloc within insn. */ - int reloc; -} -the_insn; - -#if defined(BFD_HEADERS) -#ifdef RELSZ -const int md_reloc_size = RELSZ; /* Coff headers. */ -#else -const int md_reloc_size = 12; /* Something else headers. */ -#endif -#else -const int md_reloc_size = 12; /* Not bfdized. */ -#endif - -/* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful. */ -const char comment_chars[] = ";"; - -/* This array holds the chars that only start a comment at the beginning of - a line. If the line seems to have the form '# 123 filename' - .line and .file directives will appear in the pre-processed output. */ -/* Note that input_file.c hand checks for '#' at the beginning of the - first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ -/* Also note that comments like this one will always work. */ -const char line_comment_chars[] = "#"; - -/* We needed an unused char for line separation to work around the - lack of macros, using sed and such. */ -const char line_separator_chars[] = "@"; - -/* Chars that can be used to separate mant from exp in floating point nums. */ -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant. - As in 0f12.456 - or 0d1.2345e12. */ -const char FLT_CHARS[] = "rRsSfFdDxXpP"; - -/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be - changed in read.c. Ideally it shouldn't have to know about it at - all, but nothing is ideal around here. */ - -/* anull bit - causes the branch delay slot instructions to not be executed. */ -#define ANNUL (1 << 29) - -#ifndef OBJ_COFF - -static void -s_use (int ignore) -{ - if (strncmp (input_line_pointer, ".text", 5) == 0) - { - input_line_pointer += 5; - s_text (0); - return; - } - if (strncmp (input_line_pointer, ".data", 5) == 0) - { - input_line_pointer += 5; - s_data (0); - return; - } - if (strncmp (input_line_pointer, ".data1", 6) == 0) - { - input_line_pointer += 6; - s_data1 (); - return; - } - /* Literals can't go in the text segment because you can't read from - instruction memory on some 29k's. So, into initialized data. */ - if (strncmp (input_line_pointer, ".lit", 4) == 0) - { - input_line_pointer += 4; - subseg_set (SEG_DATA, 200); - demand_empty_rest_of_line (); - return; - } - - as_bad (_("Unknown segment type")); - demand_empty_rest_of_line (); -} - -static void -s_data1 (void) -{ - subseg_set (SEG_DATA, 1); - demand_empty_rest_of_line (); -} - -#endif /* OBJ_COFF */ - -/* Install symbol definition that maps REGNAME to REGNO. - FIXME-SOON: These are not recognized in mixed case. */ - -static void -insert_sreg (char *regname, int regnum) -{ - /* FIXME-SOON, put something in these syms so they won't be output - to the symbol table of the resulting object file. */ - - /* Must be large enough to hold the names of the special registers. */ - char buf[80]; - int i; - - symbol_table_insert (symbol_new (regname, SEG_REGISTER, (valueT) regnum, - &zero_address_frag)); - for (i = 0; regname[i]; i++) - buf[i] = TOUPPER (regname[i]); - buf[i] = '\0'; - - symbol_table_insert (symbol_new (buf, SEG_REGISTER, (valueT) regnum, - &zero_address_frag)); -} - -/* Install symbol definitions for assorted special registers. - See ASM29K Ref page 2-9. */ - -static void -define_some_regs (void) -{ -#define SREG 256 - - /* Protected special-purpose register names. */ - insert_sreg ("vab", SREG + 0); - insert_sreg ("ops", SREG + 1); - insert_sreg ("cps", SREG + 2); - insert_sreg ("cfg", SREG + 3); - insert_sreg ("cha", SREG + 4); - insert_sreg ("chd", SREG + 5); - insert_sreg ("chc", SREG + 6); - insert_sreg ("rbp", SREG + 7); - insert_sreg ("tmc", SREG + 8); - insert_sreg ("tmr", SREG + 9); - insert_sreg ("pc0", SREG + 10); - insert_sreg ("pc1", SREG + 11); - insert_sreg ("pc2", SREG + 12); - insert_sreg ("mmu", SREG + 13); - insert_sreg ("lru", SREG + 14); - - /* Additional protected special-purpose registers for the 29050. */ - insert_sreg ("rsn", SREG + 15); - insert_sreg ("rma0", SREG + 16); - insert_sreg ("rmc0", SREG + 17); - insert_sreg ("rma1", SREG + 18); - insert_sreg ("rmc1", SREG + 19); - insert_sreg ("spc0", SREG + 20); - insert_sreg ("spc1", SREG + 21); - insert_sreg ("spc2", SREG + 22); - insert_sreg ("iba0", SREG + 23); - insert_sreg ("ibc0", SREG + 24); - insert_sreg ("iba1", SREG + 25); - insert_sreg ("ibc1", SREG + 26); - - /* Additional registers for the 29040. */ - insert_sreg ("dba", SREG + 27); - insert_sreg ("dbc", SREG + 28); - insert_sreg ("cir", SREG + 29); - insert_sreg ("cdr", SREG + 30); - - /* Unprotected special-purpose register names. */ - insert_sreg ("ipc", SREG + 128); - insert_sreg ("ipa", SREG + 129); - insert_sreg ("ipb", SREG + 130); - insert_sreg ("q", SREG + 131); - insert_sreg ("alu", SREG + 132); - insert_sreg ("bp", SREG + 133); - insert_sreg ("fc", SREG + 134); - insert_sreg ("cr", SREG + 135); - insert_sreg ("fpe", SREG + 160); - insert_sreg ("inte", SREG + 161); - insert_sreg ("fps", SREG + 162); - /* "", SREG+163); Reserved */ - insert_sreg ("exop", SREG + 164); -} - -/* This function is called once, at assembler startup time. It should - set up all the tables, etc., that the MD part of the assembler will - need. */ - -void -md_begin (void) -{ - const char *retval = NULL; - int lose = 0; - int skipnext = 0; - unsigned int i; - char *strend, *strend2; - - /* Hash up all the opcodes for fast use later. */ - - op_hash = hash_new (); - - for (i = 0; i < num_opcodes; i++) - { - const char *name = machine_opcodes[i].name; - - if (skipnext) - { - skipnext = 0; - continue; - } - - /* Hack to avoid multiple opcode entries. We pre-locate all the - variations (b/i field and P/A field) and handle them. */ - if (!strcmp (name, machine_opcodes[i + 1].name)) - { - if ((machine_opcodes[i].opcode & 0x01000000) != 0 - || (machine_opcodes[i + 1].opcode & 0x01000000) == 0 - || ((machine_opcodes[i].opcode | 0x01000000) - != machine_opcodes[i + 1].opcode)) - goto bad_table; - - strend = machine_opcodes[i].args + strlen (machine_opcodes[i].args) - 1; - strend2 = machine_opcodes[i + 1].args + strlen (machine_opcodes[i + 1].args) - 1; - - switch (*strend) - { - case 'b': - if (*strend2 != 'i') - goto bad_table; - break; - - case 'P': - if (*strend2 != 'A') - goto bad_table; - break; - - default: - bad_table: - fprintf (stderr, "internal error: can't handle opcode %s\n", - name); - lose = 1; - } - - /* OK, this is an i/b or A/P pair. We skip the - higher-valued one, and let the code for operand checking - handle OR-ing in the bit. */ - skipnext = 1; - } - - retval = hash_insert (op_hash, name, (void *) &machine_opcodes[i]); - if (retval != NULL) - { - fprintf (stderr, "internal error: can't hash `%s': %s\n", - machine_opcodes[i].name, retval); - lose = 1; - } - } - - if (lose) - as_fatal (_("Broken assembler. No assembly attempted.")); - - define_some_regs (); -} - -static char * -parse_operand (char *s, expressionS *operandp, int opt) -{ - char *save = input_line_pointer; - char *new; - - input_line_pointer = s; - expression (operandp); - if (operandp->X_op == O_absent && ! opt) - as_bad (_("missing operand")); - new = input_line_pointer; - input_line_pointer = save; - return new; -} - -/* Instruction parsing. Takes a string containing the opcode. - Operands are at input_line_pointer. Output is in the_insn. - Warnings or errors are generated. */ - -static void -machine_ip (char *str) -{ - char *s; - const char *args; - struct machine_opcode *insn; - char *argsStart; - unsigned long opcode; - expressionS the_operand; - expressionS *operand = &the_operand; - unsigned int reg; - - /* Must handle `div0' opcode. */ - s = str; - if (ISALPHA (*s)) - for (; ISALNUM (*s); ++s) - *s = TOLOWER (*s); - - switch (*s) - { - case '\0': - break; - - case ' ': /* FIXME-SOMEDAY more whitespace. */ - *s++ = '\0'; - break; - - default: - as_bad (_("Unknown opcode: `%s'"), str); - return; - } - if ((insn = (struct machine_opcode *) hash_find (op_hash, str)) == NULL) - { - as_bad (_("Unknown opcode `%s'."), str); - return; - } - argsStart = s; - opcode = insn->opcode; - memset (&the_insn, '\0', sizeof (the_insn)); - the_insn.reloc = NO_RELOC; - - /* Build the opcode, checking as we go to make sure that the - operands match. - - If an operand matches, we modify the_insn or opcode appropriately, - and do a "continue". If an operand fails to match, we "break". */ - if (insn->args[0] != '\0') - /* Prime the pump. */ - s = parse_operand (s, operand, insn->args[0] == 'I'); - - for (args = insn->args;; ++args) - { - switch (*args) - { - case '\0': - if (*s == '\0') - { - /* We are truly done. */ - the_insn.opcode = opcode; - return; - } - as_bad (_("Too many operands: %s"), s); - break; - - case ',': - if (*s++ == ',') - { - /* Parse next operand. */ - s = parse_operand (s, operand, args[1] == 'I'); - continue; - } - break; - - case 'v': - /* Trap numbers (immediate field). */ - if (operand->X_op == O_constant) - { - if (operand->X_add_number < 256) - opcode |= (operand->X_add_number << 16); - else - as_bad (_("Immediate value of %ld is too large"), - (long) operand->X_add_number); - continue; - } - the_insn.reloc = RELOC_8; - /* BIG-ENDIAN Byte 1 of insn. */ - the_insn.reloc_offset = 1; - the_insn.exp = *operand; - continue; - - case 'b': /* A general register or 8-bit immediate. */ - case 'i': - /* We treat the two cases identically since we mashed - them together in the opcode table. */ - if (operand->X_op == O_register) - goto general_reg; - - /* Make sure the 'i' case really exists. */ - if ((insn->opcode | IMMEDIATE_BIT) != (insn + 1)->opcode) - break; - - opcode |= IMMEDIATE_BIT; - if (operand->X_op == O_constant) - { - if (operand->X_add_number < 256) - opcode |= operand->X_add_number; - else - as_bad (_("Immediate value of %ld is too large"), - (long) operand->X_add_number); - continue; - } - the_insn.reloc = RELOC_8; - the_insn.reloc_offset = 3; /* BIG-ENDIAN Byte 3 of insn. */ - the_insn.exp = *operand; - continue; - - case 'a': /* Next operand must be a register. */ - case 'c': - general_reg: - /* lrNNN or grNNN or %%expr or a user-def register name. */ - if (operand->X_op != O_register) - break; - know (operand->X_add_symbol == 0); - know (operand->X_op_symbol == 0); - reg = operand->X_add_number; - if (reg >= SREG) - break; - - /* Got the register, now figure out where it goes in the - opcode. */ - switch (*args) - { - case 'a': - opcode |= reg << 8; - continue; - - case 'b': - case 'i': - opcode |= reg; - continue; - - case 'c': - opcode |= reg << 16; - continue; - } - as_fatal (_("failed sanity check.")); - break; - - case 'x': /* 16 bit constant, zero-extended. */ - case 'X': /* 16 bit constant, one-extended. */ - if (operand->X_op == O_constant) - { - opcode |= (operand->X_add_number & 0xFF) << 0 - | ((operand->X_add_number & 0xFF00) << 8); - continue; - } - the_insn.reloc = RELOC_CONST; - the_insn.exp = *operand; - continue; - - case 'h': - if (operand->X_op == O_constant) - { - opcode |= (operand->X_add_number & 0x00FF0000) >> 16 - | (((unsigned long) operand->X_add_number - /* Avoid sign ext. */ & 0xFF000000) >> 8); - continue; - } - the_insn.reloc = RELOC_CONSTH; - the_insn.exp = *operand; - continue; - - case 'P': /* PC-relative jump address. */ - case 'A': /* Absolute jump address. */ - /* These two are treated together since we folded the - opcode table entries together. */ - if (operand->X_op == O_constant) - { - /* Make sure the 'A' case really exists. */ - if ((insn->opcode | ABSOLUTE_BIT) != (insn + 1)->opcode) - break; - - { - bfd_vma v, mask; - - mask = 0x1ffff; - v = operand->X_add_number & ~ mask; - if (v) - as_bad ("call/jmp target out of range"); - } - - opcode |= ABSOLUTE_BIT - | (operand->X_add_number & 0x0003FC00) << 6 - | ((operand->X_add_number & 0x000003FC) >> 2); - continue; - } - - the_insn.reloc = RELOC_JUMPTARG; - the_insn.exp = *operand; - the_insn.pcrel = 1; /* Assume PC-relative jump. */ - /* FIXME-SOON, Do we figure out whether abs later, after - know sym val? */ - continue; - - case 'e': /* Coprocessor enable bit for LOAD/STORE insn. */ - if (operand->X_op == O_constant) - { - if (operand->X_add_number == 0) - continue; - if (operand->X_add_number == 1) - { - opcode |= CE_BIT; - continue; - } - } - break; - - case 'n': /* Control bits for LOAD/STORE instructions. */ - if (operand->X_op == O_constant - && operand->X_add_number < 128) - { - opcode |= (operand->X_add_number << 16); - continue; - } - break; - - case 's': /* Special register number. */ - if (operand->X_op != O_register) - break; - if (operand->X_add_number < SREG) - break; - opcode |= (operand->X_add_number & 0xFF) << 8; - continue; - - case 'u': /* UI bit of CONVERT. */ - if (operand->X_op == O_constant) - { - if (operand->X_add_number == 0) - continue; - if (operand->X_add_number == 1) - { - opcode |= UI_BIT; - continue; - } - } - break; - - case 'r': /* RND bits of CONVERT. */ - if (operand->X_op == O_constant - && operand->X_add_number < 8) - { - opcode |= operand->X_add_number << 4; - continue; - } - break; - - case 'I': /* ID bits of INV and IRETINV. */ - /* This operand is optional. */ - if (operand->X_op == O_absent) - continue; - else if (operand->X_op == O_constant - && operand->X_add_number < 4) - { - opcode |= operand->X_add_number << 16; - continue; - } - break; - - case 'd': /* FD bits of CONVERT. */ - if (operand->X_op == O_constant - && operand->X_add_number < 4) - { - opcode |= operand->X_add_number << 2; - continue; - } - break; - - case 'f': /* FS bits of CONVERT. */ - if (operand->X_op == O_constant - && operand->X_add_number < 4) - { - opcode |= operand->X_add_number << 0; - continue; - } - break; - - case 'C': - if (operand->X_op == O_constant - && operand->X_add_number < 4) - { - opcode |= operand->X_add_number << 16; - continue; - } - break; - - case 'F': - if (operand->X_op == O_constant - && operand->X_add_number < 16) - { - opcode |= operand->X_add_number << 18; - continue; - } - break; - - default: - BAD_CASE (*args); - } - /* Types or values of args don't match. */ - as_bad ("Invalid operands"); - return; - } -} - -/* Assemble a single instruction. Its label has already been handled - by the generic front end. We just parse opcode and operands, and - produce the bytes of data and relocation. */ - -void -md_assemble (char *str) -{ - char *toP; - - know (str); - machine_ip (str); - toP = frag_more (4); - /* Put out the opcode. */ - md_number_to_chars (toP, the_insn.opcode, 4); - - /* Put out the symbol-dependent stuff. */ - if (the_insn.reloc != NO_RELOC) - fix_new_exp (frag_now, - (toP - frag_now->fr_literal + the_insn.reloc_offset), - 4, & the_insn.exp, the_insn.pcrel, the_insn.reloc); -} - -/* This is identical to the md_atof in m68k.c. I think this is right, - but I'm not sure. - - Turn a string in input_line_pointer into a floating point constant - of type TYPE, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. */ - -/* Equal to MAX_PRECISION in atof-ieee.c */ -#define MAX_LITTLENUMS 6 - -char * -md_atof (int type, char *litP, int *sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return "Bad call to MD_ATOF()"; - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; -} - -/* Write out big-endian. */ - -void -md_number_to_chars (char *buf, valueT val, int n) -{ - number_to_chars_bigendian (buf, val, n); -} - -void -md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) -{ - valueT val = *valP; - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - - fixP->fx_addnumber = val; /* Remember value for emit_reloc. */ - - know (fixP->fx_size == 4); - know (fixP->fx_r_type < NO_RELOC); - - /* This is a hack. There should be a better way to handle this. */ - if (fixP->fx_r_type == RELOC_WDISP30 && fixP->fx_addsy) - val += fixP->fx_where + fixP->fx_frag->fr_address; - - switch (fixP->fx_r_type) - { - case RELOC_32: - buf[0] = val >> 24; - buf[1] = val >> 16; - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_8: - buf[0] = val; - break; - - case RELOC_WDISP30: - val = (val >> 2) + 1; - buf[0] |= (val >> 24) & 0x3f; - buf[1] = (val >> 16); - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_HI22: - buf[1] |= (val >> 26) & 0x3f; - buf[2] = val >> 18; - buf[3] = val >> 10; - break; - - case RELOC_LO10: - buf[2] |= (val >> 8) & 0x03; - buf[3] = val; - break; - - case RELOC_BASE13: - buf[2] |= (val >> 8) & 0x1f; - buf[3] = val; - break; - - case RELOC_WDISP22: - val = (val >> 2) + 1; - /* FALLTHROUGH */ - case RELOC_BASE22: - buf[1] |= (val >> 16) & 0x3f; - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_JUMPTARG: /* 00XX00XX pattern in a word. */ - if (!fixP->fx_done) - { - /* The linker tries to support both AMD and old GNU style - R_IREL relocs. That means that if the addend is exactly - the negative of the address within the section, the - linker will not handle it correctly. */ - if (fixP->fx_pcrel - && val != 0 - && val == - (fixP->fx_frag->fr_address + fixP->fx_where)) - as_bad_where - (fixP->fx_file, fixP->fx_line, - "the linker will not handle this relocation correctly"); - } - else if (fixP->fx_pcrel) - { - if (val + 0x20000 > 0x3ffff) - as_bad_where (fixP->fx_file, fixP->fx_line, - "call/jmp target out of range"); - } - else - /* This case was supposed to be handled in machine_ip. */ - abort (); - - buf[1] = val >> 10; /* Holds bits 0003FFFC of address. */ - buf[3] = val >> 2; - break; - - case RELOC_CONST: /* 00XX00XX pattern in a word. */ - buf[1] = val >> 8; /* Holds bits 0000XXXX. */ - buf[3] = val; - break; - - case RELOC_CONSTH: /* 00XX00XX pattern in a word. */ - buf[1] = val >> 24; /* Holds bits XXXX0000. */ - buf[3] = val >> 16; - break; - - case NO_RELOC: - default: - as_bad (_("bad relocation type: 0x%02x"), fixP->fx_r_type); - break; - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -#ifdef OBJ_COFF -short -tc_coff_fix2rtype (fixS *fixP) -{ - switch (fixP->fx_r_type) - { - case RELOC_32: return R_WORD; - case RELOC_8: return R_BYTE; - case RELOC_CONST: return R_ILOHALF; - case RELOC_CONSTH: return R_IHIHALF; - case RELOC_JUMPTARG: return R_IREL; - default: - printf (_("need %o3\n"), fixP->fx_r_type); - abort (); - } - - return 0; -} - -#endif /* OBJ_COFF */ - -/* Should never be called for 29k. */ - -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - fragS *fragP ATTRIBUTE_UNUSED) -{ - as_fatal (_("a29k_convert_frag\n")); -} - -/* Should never be called for a29k. */ - -int -md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, - segT segtype ATTRIBUTE_UNUSED) -{ - as_fatal (_("a29k_estimate_size_before_relax\n")); - return 0; -} - -/* Translate internal representation of relocation info to target format. - - On sparc/29k: first 4 bytes are normal unsigned long address, next three - bytes are index, most sig. byte first. Byte 7 is broken up with - bit 7 as external, bits 6 & 5 unused, and the lower - five bits as relocation type. Next 4 bytes are long addend. */ - -/* Thanx and a tip of the hat to Michael Bloom, mb@ttidca.tti.com. */ - -#ifdef OBJ_AOUT - -void -tc_aout_fix_to_chars (char *where, - fixS *fixP, - relax_addressT segment_address_in_file) -{ - long r_symbolnum; - - know (fixP->fx_r_type < NO_RELOC); - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - where[4] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[6] = r_symbolnum & 0x0ff; - where[7] = (((!S_IS_DEFINED (fixP->fx_addsy)) << 7) & 0x80) | (0 & 0x60) | (fixP->fx_r_type & 0x1F); - - /* Also easy. */ - md_number_to_chars (&where[8], fixP->fx_addnumber, 4); -} - -#endif /* OBJ_AOUT */ - -const char *md_shortopts = ""; - -struct option md_longopts[] = -{ - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) -{ - return 0; -} - -void -md_show_usage (FILE *stream ATTRIBUTE_UNUSED) -{ -} - -/* This is called when a line is unrecognized. This is used to handle - definitions of a29k style local labels. */ - -int -a29k_unrecognized_line (int c) -{ - int lab; - char *s; - - if (c != '$' - || ! ISDIGIT (input_line_pointer[0])) - return 0; - - s = input_line_pointer; - - lab = 0; - while (ISDIGIT (*s)) - { - lab = lab * 10 + *s - '0'; - ++s; - } - - if (*s != ':') - { - /* Not a label definition. */ - return 0; - } - - if (dollar_label_defined (lab)) - { - as_bad (_("label \"$%d\" redefined"), lab); - return 0; - } - - define_dollar_label (lab); - colon (dollar_label_name (lab, 0)); - input_line_pointer = s + 1; - - return 1; -} - -/* Default the values of symbols known that should be "predefined". We - don't bother to predefine them unless you actually use one, since there - are a lot of them. */ - -symbolS * -md_undefined_symbol (char *name) -{ - long regnum; - char testbuf[5 + /*SLOP*/ 5]; - - if (name[0] == 'g' || name[0] == 'G' - || name[0] == 'l' || name[0] == 'L' - || name[0] == 's' || name[0] == 'S') - { - /* Perhaps a global or local register name. */ - if (name[1] == 'r' || name[1] == 'R') - { - long maxreg; - - /* Parse the number, make sure it has no extra zeroes or - trailing chars. */ - regnum = atol (&name[2]); - - if (name[0] == 's' || name[0] == 'S') - maxreg = 255; - else - maxreg = 127; - if (regnum > maxreg) - return NULL; - - sprintf (testbuf, "%ld", regnum); - if (strcmp (testbuf, &name[2]) != 0) - return NULL; /* gr007 or lr7foo or whatever. */ - - /* We have a wiener! Define and return a new symbol for it. */ - if (name[0] == 'l' || name[0] == 'L') - regnum += 128; - else if (name[0] == 's' || name[0] == 'S') - regnum += SREG; - return (symbol_new (name, SEG_REGISTER, (valueT) regnum, - &zero_address_frag)); - } - } - - return NULL; -} - -/* Parse an operand that is machine-specific. */ - -void -md_operand (expressionS *expressionP) -{ - if (input_line_pointer[0] == '%' && input_line_pointer[1] == '%') - { - /* We have a numeric register expression. No biggy. */ - input_line_pointer += 2; /* Skip %% */ - (void) expression (expressionP); - if (expressionP->X_op != O_constant - || expressionP->X_add_number > 255) - as_bad (_("Invalid expression after %%%%\n")); - expressionP->X_op = O_register; - } - else if (input_line_pointer[0] == '&') - { - /* We are taking the 'address' of a register...this one is not - in the manual, but it *is* in traps/fpsymbol.h! What they - seem to want is the register number, as an absolute number. */ - input_line_pointer++; /* Skip & */ - (void) expression (expressionP); - if (expressionP->X_op != O_register) - as_bad (_("Invalid register in & expression")); - else - expressionP->X_op = O_constant; - } - else if (input_line_pointer[0] == '$' - && ISDIGIT (input_line_pointer[1])) - { - long lab; - char *name; - symbolS *sym; - - /* This is a local label. */ - ++input_line_pointer; - lab = (long) get_absolute_expression (); - if (dollar_label_defined (lab)) - { - name = dollar_label_name (lab, 0); - sym = symbol_find (name); - } - else - { - name = dollar_label_name (lab, 1); - sym = symbol_find_or_make (name); - } - - expressionP->X_op = O_symbol; - expressionP->X_add_symbol = sym; - expressionP->X_add_number = 0; - } - else if (input_line_pointer[0] == '$') - { - char *s; - char type; - int fieldnum, fieldlimit; - LITTLENUM_TYPE floatbuf[8]; - - /* $float(), $doubleN(), or $extendN() convert floating values - to integers. */ - - s = input_line_pointer; - - ++s; - - fieldnum = 0; - if (strncmp (s, "double", sizeof "double" - 1) == 0) - { - s += sizeof "double" - 1; - type = 'd'; - fieldlimit = 2; - } - else if (strncmp (s, "float", sizeof "float" - 1) == 0) - { - s += sizeof "float" - 1; - type = 'f'; - fieldlimit = 1; - } - else if (strncmp (s, "extend", sizeof "extend" - 1) == 0) - { - s += sizeof "extend" - 1; - type = 'x'; - fieldlimit = 4; - } - else - return; - - if (ISDIGIT (*s)) - { - fieldnum = *s - '0'; - ++s; - } - - if (fieldnum >= fieldlimit) - return; - - SKIP_WHITESPACE (); - if (*s != '(') - return; - ++s; - SKIP_WHITESPACE (); - - s = atof_ieee (s, type, floatbuf); - if (s == NULL) - return; - s = s; - - SKIP_WHITESPACE (); - if (*s != ')') - return; - ++s; - SKIP_WHITESPACE (); - - input_line_pointer = s; - expressionP->X_op = O_constant; - expressionP->X_unsigned = 1; - expressionP->X_add_number = ((floatbuf[fieldnum * 2] - << LITTLENUM_NUMBER_OF_BITS) - + floatbuf[fieldnum * 2 + 1]); - } -} - -/* Round up a section size to the appropriate boundary. */ - -valueT -md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) -{ - return size; /* Byte alignment is fine. */ -} - -/* Exactly what point is a PC-relative offset relative TO? - On the 29000, they're relative to the address of the instruction, - which we have set up as the address of the fixup too. */ - -long -md_pcrel_from (fixS *fixP) -{ - return fixP->fx_where + fixP->fx_frag->fr_address; -} - -const pseudo_typeS -md_pseudo_table[] = -{ - {"align", s_align_bytes, 4}, - {"block", s_space, 0}, - {"cputype", s_ignore, 0}, /* CPU as 29000 or 29050. */ - {"reg", s_lsym, 0}, /* Register equate, same as equ. */ - {"space", s_ignore, 0}, /* Listing control. */ - {"sect", s_ignore, 0}, /* Creation of coff sections. */ -#ifndef OBJ_COFF - {"use", s_use, 0}, /* We can do this right with coff. */ -#endif - {"word", cons, 4}, - {NULL, 0, 0}, -}; diff --git a/gas/config/tc-a29k.h b/gas/config/tc-a29k.h deleted file mode 100644 index f5fc386..0000000 --- a/gas/config/tc-a29k.h +++ /dev/null @@ -1,53 +0,0 @@ -/* tc-a29k.h -- Assemble for the AMD 29000. - Copyright 1989, 1990, 1991, 1992, 1993, 1995, 1998, 2003, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_A29K - -#define TARGET_BYTES_BIG_ENDIAN 1 - -#define WORKING_DOT_WORD - -#define LEX_DOLLAR 1 - -#define tc_unrecognized_line(c) a29k_unrecognized_line (c) -extern int a29k_unrecognized_line (int); - -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_crawl_symbol_chain(a) ; /* Not used. */ -#define tc_coff_symbol_emit_hook(a) ; /* Not used. */ - -#define AOUT_MACHTYPE 101 -#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype (fix_ptr) -#define BFD_ARCH bfd_arch_a29k -#define COFF_MAGIC SIPFBOMAGIC -/* Should the reloc be output ? - on the 29k, this is true only if there is a symbol attached. - on the h8, this is always true, since no fixup is done. */ -#define TC_COUNT_RELOC(x) (x->fx_addsy) -#define TC_CONS_RELOC RELOC_32 - -#define COFF_FLAGS F_AR32W -#define reloc_type int -#define NEED_FX_R_TYPE - -#define ZERO_BASED_SEGMENTS - diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 6a587f3..7cd3db4 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -175,9 +175,6 @@ static int meabi_flags = EF_ARM_EABI_UNKNOWN; symbolS * GOT_symbol; #endif -/* Size of relocation record. */ -const int md_reloc_size = 8; - /* 0: assemble for ARM, 1: assemble for Thumb, 2: assemble for Thumb even though target CPU does not support thumb diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index e692f52..1def078 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -32,8 +32,6 @@ #define COFF_MAGIC ARMMAGIC #define TARGET_ARCH bfd_arch_arm -#define AOUT_MACHTYPE 0 - #define DIFF_EXPR_OK #ifdef LITTLE_ENDIAN @@ -121,7 +119,6 @@ struct fix; #define TC_START_LABEL(C,STR) (c == ':' || (c == '/' && arm_data_in_code ())) #define tc_canonicalize_symbol_name(str) arm_canonicalize_symbol_name (str); #define obj_adjust_symtab() arm_adjust_symtab () -#define tc_aout_pre_write_hook(x) {;} /* not used */ #define LISTING_HEADER "ARM GAS " diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index 39e695f..3516001 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -1085,12 +1085,11 @@ md_apply_fix (fixP, valP, seg) } } -/* A `BFD_ASSEMBLER' GAS will call this to generate a reloc. GAS - will pass the resulting reloc to `bfd_install_relocation'. This - currently works poorly, as `bfd_install_relocation' often does the - wrong thing, and instances of `tc_gen_reloc' have been written to - work around the problems, which in turns makes it difficult to fix - `bfd_install_relocation'. */ +/* GAS will call this to generate a reloc, passing the resulting reloc + to `bfd_install_relocation'. This currently works poorly, as + `bfd_install_relocation' often does the wrong thing, and instances of + `tc_gen_reloc' have been written to work around the problems, which + in turns makes it difficult to fix `bfd_install_relocation'. */ /* If while processing a fixup, a reloc really needs to be created then it is done here. */ diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h index d667ebb..75d923e 100644 --- a/gas/config/tc-avr.h +++ b/gas/config/tc-avr.h @@ -1,5 +1,5 @@ /* This file is tc-avr.h - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. Contributed by Denis Chertykov <denisc@overta.ru> @@ -20,10 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef BFD_ASSEMBLER - #error AVR support requires BFD_ASSEMBLER -#endif - /* By convention, you should define this macro in the `.h' file. For example, `tc-m68k.h' defines `TC_M68K'. You might have to use this if it is necessary to add CPU specific code to the object format diff --git a/gas/config/tc-crx.h b/gas/config/tc-crx.h index bc6c1f7..b1c3c65 100644 --- a/gas/config/tc-crx.h +++ b/gas/config/tc-crx.h @@ -31,10 +31,8 @@ #define TARGET_FORMAT "elf32-crx" #define TARGET_ARCH bfd_arch_crx -#define BFD_ARCH bfd_arch_crx #define WORKING_DOT_WORD -#define NEED_FX_R_TYPE #define LOCAL_LABEL_PREFIX '.' #define md_undefined_symbol(s) 0 diff --git a/gas/config/tc-d10v.h b/gas/config/tc-d10v.h index 4453bf6..f9a30b4 100644 --- a/gas/config/tc-d10v.h +++ b/gas/config/tc-d10v.h @@ -24,10 +24,6 @@ #define TARGET_BYTES_BIG_ENDIAN 0 -#ifndef BFD_ASSEMBLER - #error D10V support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_d10v diff --git a/gas/config/tc-d30v.h b/gas/config/tc-d30v.h index 4c80301..9a5e7cc 100644 --- a/gas/config/tc-d30v.h +++ b/gas/config/tc-d30v.h @@ -22,10 +22,6 @@ #define TC_D30V -#ifndef BFD_ASSEMBLER - #error D30V support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_d30v #define TARGET_FORMAT "elf32-d30v" diff --git a/gas/config/tc-dlx.h b/gas/config/tc-dlx.h index e675649..309f037 100644 --- a/gas/config/tc-dlx.h +++ b/gas/config/tc-dlx.h @@ -22,10 +22,6 @@ #define TC_DLX -#ifndef BFD_ASSEMBLER - #error DLX support requires BFD_ASSEMBLER -#endif - #ifndef __BFD_H_SEEN__ #include "bfd.h" #endif @@ -52,21 +48,9 @@ extern bfd_boolean md_dlx_fix_adjustable (struct fix *); #define tc_unrecognized_line(c) dlx_unrecognized_line (c) -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_crawl_symbol_chain(a) ; /* Not used. */ #define tc_coff_symbol_emit_hook(a) ; /* Not used. */ -#define AOUT_MACHTYPE 101 -#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype (fix_ptr) -#define BFD_ARCH bfd_arch_dlx #define COFF_MAGIC DLXMAGIC -/* Should the reloc be output ? - on the 29k, this is true only if there is a symbol attached. - on the h8, this is always true, since no fixup is done - on dlx, I have no idea!! but lets keep it here just for fun. */ -#define TC_COUNT_RELOC(x) (x->fx_addsy) -#define TC_CONS_RELOC BFD_RELOC_32_PCREL /* No shared lib support, so we don't need to ensure externally visible symbols can be overridden. */ @@ -77,8 +61,6 @@ extern bfd_boolean md_dlx_fix_adjustable (struct fix *); /* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 -#define NEED_FX_R_TYPE - /* Zero Based Segment?? sound very dangerous to me! */ #define ZERO_BASED_SEGMENTS diff --git a/gas/config/tc-fr30.h b/gas/config/tc-fr30.h index edbddf7..a3a832a 100644 --- a/gas/config/tc-fr30.h +++ b/gas/config/tc-fr30.h @@ -21,11 +21,6 @@ #define TC_FR30 -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error FR30 support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "FR30 GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-frv.h b/gas/config/tc-frv.h index db4e366..ddf5c02 100644 --- a/gas/config/tc-frv.h +++ b/gas/config/tc-frv.h @@ -20,11 +20,6 @@ #define TC_FRV -#ifndef BFD_ASSEMBLER -/* leading space so will compile with cc */ - #error FRV support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "FRV GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index 8e926ad..7db600c 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -25,10 +25,7 @@ #include "as.h" #include "subsegs.h" #include "bfd.h" - -#ifdef BFD_ASSEMBLER #include "dwarf2dbg.h" -#endif #define DEFINE_TABLE #define h8_opcodes ops @@ -77,10 +74,8 @@ h8300hmode (int arg ATTRIBUTE_UNUSED) { Hmode = 1; Smode = 0; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300h)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -88,10 +83,8 @@ h8300smode (int arg ATTRIBUTE_UNUSED) { Smode = 1; Hmode = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300s)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -100,10 +93,8 @@ h8300hnmode (int arg ATTRIBUTE_UNUSED) Hmode = 1; Smode = 0; Nmode = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300hn)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -112,10 +103,8 @@ h8300snmode (int arg ATTRIBUTE_UNUSED) Smode = 1; Hmode = 1; Nmode = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sn)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -124,10 +113,8 @@ h8300sxmode (int arg ATTRIBUTE_UNUSED) Smode = 1; Hmode = 1; SXmode = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sx)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -137,10 +124,8 @@ h8300sxnmode (int arg ATTRIBUTE_UNUSED) Hmode = 1; SXmode = 1; Nmode = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sxn)) as_warn (_("could not set architecture and machine")); -#endif } static void @@ -184,8 +169,6 @@ const pseudo_typeS md_pseudo_table[] = {0, 0, 0} }; -const int md_reloc_size; - const char EXP_CHARS[] = "eE"; /* Chars that mean this number is a floating point constant @@ -208,10 +191,8 @@ md_begin (void) char prev_buffer[100]; int idx = 0; -#ifdef BFD_ASSEMBLER if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300)) as_warn (_("could not set architecture and machine")); -#endif opcode_hash_control = hash_new (); prev_buffer[0] = 0; @@ -2017,18 +1998,8 @@ md_assemble (char *str) build_bytes (instruction, operand); -#ifdef BFD_ASSEMBLER dwarf2_emit_insn (instruction->length); -#endif -} - -#ifndef BFD_ASSEMBLER -void -tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_crawl_symbol_chain \n")); } -#endif symbolS * md_undefined_symbol (char *name ATTRIBUTE_UNUSED) @@ -2036,14 +2007,6 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED) return 0; } -#ifndef BFD_ASSEMBLER -void -tc_headers_hook (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_headers_hook \n")); -} -#endif - /* Various routines to kill one day */ /* Equal to MAX_PRECISION in atof-ieee.c */ #define MAX_LITTLENUMS 6 @@ -2132,12 +2095,7 @@ tc_aout_fix_to_chars (void) } void -md_convert_frag ( -#ifdef BFD_ASSEMBLER - bfd *headers ATTRIBUTE_UNUSED, -#else - object_headers *headers ATTRIBUTE_UNUSED, -#endif +md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED, fragS *fragP ATTRIBUTE_UNUSED) { @@ -2145,22 +2103,12 @@ md_convert_frag ( abort (); } -#ifdef BFD_ASSEMBLER valueT md_section_align (segT segment, valueT size) { int align = bfd_get_section_alignment (stdoutput, segment); return ((size + (1 << align) - 1) & (-1 << align)); } -#else -valueT -md_section_align (segT seg, valueT size) -{ - return ((size + (1 << section_alignment[(int) seg]) - 1) - & (-1 << section_alignment[(int) seg])); -} -#endif - void md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) @@ -2212,66 +2160,6 @@ md_pcrel_from (fixS *fixP ATTRIBUTE_UNUSED) abort (); } -#ifndef BFD_ASSEMBLER -void -tc_reloc_mangle (fixS *fix_ptr, struct internal_reloc *intr, bfd_vma base) -{ - symbolS *symbol_ptr; - - symbol_ptr = fix_ptr->fx_addsy; - - /* If this relocation is attached to a symbol then it's ok - to output it. */ - if (fix_ptr->fx_r_type == TC_CONS_RELOC) - { - /* cons likes to create reloc32's whatever the size of the reloc.. - */ - switch (fix_ptr->fx_size) - { - case 4: - intr->r_type = R_RELLONG; - break; - case 2: - intr->r_type = R_RELWORD; - break; - case 1: - intr->r_type = R_RELBYTE; - break; - default: - abort (); - } - } - else - { - intr->r_type = fix_ptr->fx_r_type; - } - - intr->r_vaddr = fix_ptr->fx_frag->fr_address + fix_ptr->fx_where + base; - intr->r_offset = fix_ptr->fx_offset; - - if (symbol_ptr) - { - if (symbol_ptr->sy_number != -1) - intr->r_symndx = symbol_ptr->sy_number; - else - { - symbolS *segsym; - - /* This case arises when a reference is made to `.'. */ - segsym = seg_info (S_GET_SEGMENT (symbol_ptr))->dot; - if (segsym == NULL) - intr->r_symndx = -1; - else - { - intr->r_symndx = segsym->sy_number; - intr->r_offset += S_GET_VALUE (symbol_ptr); - } - } - } - else - intr->r_symndx = -1; -} -#else /* BFD_ASSEMBLER */ arelent * tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) { @@ -2313,4 +2201,3 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) return rel; } -#endif diff --git a/gas/config/tc-h8300.h b/gas/config/tc-h8300.h index 4493838..3d928fd 100644 --- a/gas/config/tc-h8300.h +++ b/gas/config/tc-h8300.h @@ -1,6 +1,6 @@ /* This file is tc-h8300.h Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 2000, 2001, 2002, 2003 + 1997, 1998, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,10 +26,8 @@ #define TARGET_ARCH bfd_arch_h8300 -#ifdef BFD_ASSEMBLER /* Fixup debug sections since we will never relax them. */ #define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC) -#endif #ifdef OBJ_ELF #define TARGET_FORMAT "elf32-h8300" #define LOCAL_LABEL_PREFIX '.' @@ -42,12 +40,7 @@ struct internal_reloc; #define WORKING_DOT_WORD -/* This macro translates between an internal fix and a coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fixP) abort (); - -#define BFD_ARCH bfd_arch_h8300 #define COFF_MAGIC ( Smode && Nmode ? 0x8304 : Hmode && Nmode ? 0x8303 : Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) -#define TC_COUNT_RELOC(x) (1) #define IGNORE_NONSTANDARD_ESCAPES #define tc_coff_symbol_emit_hook(a) ; /* not used */ @@ -84,10 +77,7 @@ extern void tc_reloc_mangle (struct fix *, struct internal_reloc *, bfd_vma); #define tc_fix_adjustable(FIX) 0 #endif -#define TC_CONS_RELOC (Hmode ? R_RELLONG: R_RELWORD) - #define LISTING_HEADER "Renesas H8/300 GAS " -#define NEED_FX_R_TYPE 1 #ifndef OBJ_ELF #define RELOC_32 1234 #endif diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c deleted file mode 100644 index 63168b0..0000000 --- a/gas/config/tc-h8500.c +++ /dev/null @@ -1,1486 +0,0 @@ -/* tc-h8500.c -- Assemble code for the Renesas H8/500 - Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Written By Steve Chamberlain <sac@cygnus.com>. */ - -#include <stdio.h> -#include "as.h" -#include "bfd.h" -#include "subsegs.h" -#define DEFINE_TABLE -#define ASSEMBLER_TABLE -#include "opcodes/h8500-opc.h" -#include "safe-ctype.h" - -const char comment_chars[] = "!"; -const char line_separator_chars[] = ";"; -const char line_comment_chars[] = "!#"; - -/* This table describes all the machine specific pseudo-ops the assembler - has to support. The fields are: - pseudo-op name without dot - function to call to execute this pseudo-op - Integer arg to pass to the function. */ - -const pseudo_typeS md_pseudo_table[] = -{ - {"int", cons, 2}, - {"data.b", cons, 1}, - {"data.w", cons, 2}, - {"data.l", cons, 4}, - {"form", listing_psize, 0}, - {"heading", listing_title, 0}, - {"import", s_ignore, 0}, - {"page", listing_eject, 0}, - {"program", s_ignore, 0}, - {0, 0, 0} -}; - -const int md_reloc_size; - -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant. - As in 0f12.456 - or 0d1.2345e12. */ -const char FLT_CHARS[] = "rRsSfFdDxXpP"; - -#define C(a,b) ENCODE_RELAX(a, b) -#define ENCODE_RELAX(what, length) (((what) << 2) + (length)) - -#define GET_WHAT(x) ((x >> 2)) - -#define BYTE_DISP 1 -#define WORD_DISP 2 -#define UNDEF_BYTE_DISP 0 -#define UNDEF_WORD_DISP 3 - -#define BRANCH 1 -#define SCB_F 2 -#define SCB_TST 3 -#define END 4 - -#define BYTE_F 127 -#define BYTE_B -126 -#define WORD_F 32767 -#define WORD_B 32768 - -relax_typeS md_relax_table[C (END, 0)] = -{ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - - /* BRANCH */ - { 0, 0, 0, 0 }, - { BYTE_F, BYTE_B, 2, C (BRANCH, WORD_DISP) }, - { WORD_F, WORD_B, 3, 0 }, - { 0, 0, 3, 0 }, - - /* SCB_F */ - { 0, 0, 0, 0 }, - { BYTE_F, BYTE_B, 3, C (SCB_F, WORD_DISP) }, - { WORD_F, WORD_B, 8, 0 }, - { 0, 0, 8, 0 }, - - /* SCB_TST */ - { 0, 0, 0, 0 }, - { BYTE_F, BYTE_B, 3, C (SCB_TST, WORD_DISP) }, - { WORD_F, WORD_B, 10, 0 }, - { 0, 0, 10, 0 } - -}; - -static struct hash_control *opcode_hash_control; /* Opcode mnemonics. */ - -/* This function is called once, at assembler startup time. This should - set up all the tables, etc. that the MD part of the assembler needs. */ - -void -md_begin (void) -{ - const h8500_opcode_info *opcode; - char prev_buffer[100]; - int idx = 0; - - opcode_hash_control = hash_new (); - prev_buffer[0] = 0; - - /* Insert unique names into hash table. */ - for (opcode = h8500_table; opcode->name; opcode++) - { - if (idx != opcode->idx) - { - hash_insert (opcode_hash_control, opcode->name, (char *) opcode); - idx++; - } - } -} - -static int rn; /* Register number used by RN. */ -static int rs; /* Register number used by RS. */ -static int rd; /* Register number used by RD. */ -static int crb; /* Byte size cr. */ -static int crw; /* Word sized cr. */ -static int cr; /* Unknown size cr. */ - -static expressionS displacement;/* Displacement expression. */ -static int immediate_inpage; -static expressionS immediate; /* Immediate expression. */ -static expressionS absolute; /* Absolute expression. */ - -typedef struct -{ - int type; - unsigned int reg; - expressionS exp; - int page; -} - -h8500_operand_info; - -/* Try to parse a reg name. Return the number of chars consumed. */ - -static int parse_reg (char *, int *, unsigned int *); - -static int -parse_reg (char *src, int *mode, unsigned int *reg) -{ - char *end; - int len; - - /* Cribbed from get_symbol_end(). */ - if (!is_name_beginner (*src) || *src == '\001') - return 0; - end = src + 1; - while (is_part_of_name (*end) || *end == '\001') - end++; - len = end - src; - - if (len == 2 && src[0] == 'r') - { - if (src[1] >= '0' && src[1] <= '7') - { - *mode = RN; - *reg = (src[1] - '0'); - return len; - } - } - if (len == 2 && src[0] == 's' && src[1] == 'p') - { - *mode = RN; - *reg = 7; - return len; - } - if (len == 3 && src[0] == 'c' && src[1] == 'c' && src[2] == 'r') - { - *mode = CRB; - *reg = 1; - return len; - } - if (len == 2 && src[0] == 's' && src[1] == 'r') - { - *mode = CRW; - *reg = 0; - return len; - } - if (len == 2 && src[0] == 'b' && src[1] == 'r') - { - *mode = CRB; - *reg = 3; - return len; - } - if (len == 2 && src[0] == 'e' && src[1] == 'p') - { - *mode = CRB; - *reg = 4; - return len; - } - if (len == 2 && src[0] == 'd' && src[1] == 'p') - { - *mode = CRB; - *reg = 5; - return len; - } - if (len == 2 && src[0] == 't' && src[1] == 'p') - { - *mode = CRB; - *reg = 7; - return len; - } - if (len == 2 && src[0] == 'f' && src[1] == 'p') - { - *mode = RN; - *reg = 6; - return len; - } - return 0; -} - -static char * -parse_exp (char *s, expressionS *op, int *page) -{ - char *save; - char *new; - - save = input_line_pointer; - - *page = 0; - if (s[0] == '%') - { - if (s[1] == 'p' && s[2] == 'a' && s[3] == 'g' && s[4] == 'e') - { - s += 5; - *page = 'p'; - } - if (s[1] == 'h' && s[2] == 'i' && s[3] == '1' && s[4] == '6') - { - s += 5; - *page = 'h'; - } - else if (s[1] == 'o' && s[2] == 'f' && s[3] == 'f') - { - s += 4; - *page = 'o'; - } - } - - input_line_pointer = s; - - expression (op); - if (op->X_op == O_absent) - as_bad (_("missing operand")); - new = input_line_pointer; - input_line_pointer = save; - return new; -} - -typedef enum -{ - exp_signed, exp_unsigned, exp_sandu -} sign_type; - -static char * -skip_colonthing (sign_type sign, - char *ptr, - h8500_operand_info *exp, - int def, - int size8, - int size16, - int size24) -{ - ptr = parse_exp (ptr, &exp->exp, &exp->page); - if (*ptr == ':') - { - ptr++; - if (*ptr == '8') - { - ptr++; - exp->type = size8; - } - else if (ptr[0] == '1' && ptr[1] == '6') - { - ptr += 2; - exp->type = size16; - } - else if (ptr[0] == '2' && ptr[1] == '4') - { - if (!size24) - { - as_bad (_(":24 not valid for this opcode")); - } - ptr += 2; - exp->type = size24; - } - else - { - as_bad (_("expect :8,:16 or :24")); - exp->type = size16; - } - } - else - { - if (exp->page == 'p') - exp->type = IMM8; - else if (exp->page == 'h') - exp->type = IMM16; - else - { - /* Let's work out the size from the context. */ - int n = exp->exp.X_add_number; - - if (size8 - && exp->exp.X_op == O_constant - && ((sign == exp_signed && (n >= -128 && n <= 127)) - || (sign == exp_unsigned && (n >= 0 && (n <= 255))) - || (sign == exp_sandu && (n >= -128 && (n <= 255))))) - exp->type = size8; - else - exp->type = def; - } - } - return ptr; -} - -static int -parse_reglist (char *src, h8500_operand_info *op) -{ - int mode; - unsigned int rn; - int mask = 0; - unsigned int rm; - int idx = 1; - - /* Skip (. */ - while (src[idx] && src[idx] != ')') - { - int done = parse_reg (src + idx, &mode, &rn); - - if (done) - { - idx += done; - mask |= 1 << rn; - } - else - { - as_bad (_("syntax error in reg list")); - return 0; - } - - if (src[idx] == '-') - { - idx++; - done = parse_reg (src + idx, &mode, &rm); - if (done) - { - idx += done; - while (rn <= rm) - { - mask |= 1 << rn; - rn++; - } - } - else - as_bad (_("missing final register in range")); - } - - if (src[idx] == ',') - idx++; - } - idx++; - op->exp.X_add_symbol = 0; - op->exp.X_op_symbol = 0; - op->exp.X_add_number = mask; - op->exp.X_op = O_constant; - op->exp.X_unsigned = 1; - op->type = IMM8; - return idx; -} - -/* The many forms of operand: - - Rn Register direct - @Rn Register indirect - @(disp[:size], Rn) Register indirect with displacement - @Rn+ - @-Rn - @aa[:size] absolute - #xx[:size] immediate data. */ - -static void -get_operand (char **ptr, - h8500_operand_info *op, - char ispage) -{ - char *src = *ptr; - int mode; - unsigned int num; - unsigned int len; - - op->page = 0; - if (src[0] == '(' && src[1] == 'r') - { - /* This is a register list */ - *ptr = src + parse_reglist (src, op); - return; - } - - len = parse_reg (src, &op->type, &op->reg); - - if (len) - { - *ptr = src + len; - return; - } - - if (*src == '@') - { - src++; - if (*src == '-') - { - src++; - len = parse_reg (src, &mode, &num); - if (len == 0) - { - /* Oops, not a reg after all, must be ordinary exp */ - src--; - /* must be a symbol */ - *ptr = skip_colonthing (exp_unsigned, src, - op, ABS16, ABS8, ABS16, ABS24); - return; - } - - op->type = RNDEC; - op->reg = num; - *ptr = src + len; - return; - } - if (*src == '(') - { - /* Disp */ - src++; - - src = skip_colonthing (exp_signed, src, - op, RNIND_D16, RNIND_D8, RNIND_D16, 0); - - if (*src != ',') - { - as_bad (_("expected @(exp, Rn)")); - return; - } - src++; - len = parse_reg (src, &mode, &op->reg); - if (len == 0 || mode != RN) - { - as_bad (_("expected @(exp, Rn)")); - return; - } - src += len; - if (*src != ')') - { - as_bad (_("expected @(exp, Rn)")); - return; - } - *ptr = src + 1; - return; - } - len = parse_reg (src, &mode, &num); - - if (len) - { - src += len; - if (*src == '+') - { - src++; - if (mode != RN) - { - as_bad (_("@Rn+ needs word register")); - return; - } - op->type = RNINC; - op->reg = num; - *ptr = src; - return; - } - if (mode != RN) - { - as_bad (_("@Rn needs word register")); - return; - } - op->type = RNIND; - op->reg = num; - *ptr = src; - return; - } - else - { - /* must be a symbol */ - *ptr = - skip_colonthing (exp_unsigned, src, op, - ispage ? ABS24 : ABS16, ABS8, ABS16, ABS24); - return; - } - } - - if (*src == '#') - { - src++; - *ptr = skip_colonthing (exp_sandu, src, op, IMM16, IMM8, IMM16, ABS24); - return; - } - else - *ptr = skip_colonthing (exp_signed, src, op, - ispage ? ABS24 : PCREL8, PCREL8, PCREL16, ABS24); -} - -static char * -get_operands (h8500_opcode_info *info, - char *args, - h8500_operand_info *operand) -{ - char *ptr = args; - - switch (info->nargs) - { - case 0: - operand[0].type = 0; - operand[1].type = 0; - break; - - case 1: - ptr++; - get_operand (&ptr, operand + 0, info->name[0] == 'p'); - operand[1].type = 0; - break; - - case 2: - ptr++; - get_operand (&ptr, operand + 0, 0); - if (*ptr == ',') - ptr++; - get_operand (&ptr, operand + 1, 0); - break; - - default: - abort (); - } - - return ptr; -} - -/* Passed a pointer to a list of opcodes which use different - addressing modes, return the opcode which matches the opcodes - provided. */ - -int pcrel8; /* Set when we've seen a pcrel operand. */ - -static h8500_opcode_info * -get_specific (h8500_opcode_info *opcode, - h8500_operand_info *operands) -{ - h8500_opcode_info *this_try = opcode; - int found = 0; - unsigned int noperands = opcode->nargs; - int this_index = opcode->idx; - - while (this_index == opcode->idx && !found) - { - unsigned int i; - - this_try = opcode++; - - /* Look at both operands needed by the opcodes and provided by - the user. */ - for (i = 0; i < noperands; i++) - { - h8500_operand_info *user = operands + i; - - switch (this_try->arg_type[i]) - { - case FPIND_D8: - /* Opcode needs (disp:8,fp). */ - if (user->type == RNIND_D8 && user->reg == 6) - { - displacement = user->exp; - continue; - } - break; - case RDIND_D16: - if (user->type == RNIND_D16) - { - displacement = user->exp; - rd = user->reg; - continue; - } - break; - case RDIND_D8: - if (user->type == RNIND_D8) - { - displacement = user->exp; - rd = user->reg; - continue; - } - break; - case RNIND_D16: - case RNIND_D8: - if (user->type == this_try->arg_type[i]) - { - displacement = user->exp; - rn = user->reg; - continue; - } - break; - - case SPDEC: - if (user->type == RNDEC && user->reg == 7) - continue; - break; - - case SPINC: - if (user->type == RNINC && user->reg == 7) - continue; - break; - - case ABS16: - if (user->type == ABS16) - { - absolute = user->exp; - continue; - } - break; - case ABS8: - if (user->type == ABS8) - { - absolute = user->exp; - continue; - } - break; - case ABS24: - if (user->type == ABS24) - { - absolute = user->exp; - continue; - } - break; - - case CRB: - if ((user->type == CRB || user->type == CR) && user->reg != 0) - { - crb = user->reg; - continue; - } - break; - case CRW: - if ((user->type == CRW || user->type == CR) && user->reg == 0) - { - crw = user->reg; - continue; - } - break; - case DISP16: - if (user->type == DISP16) - { - displacement = user->exp; - continue; - } - break; - case DISP8: - if (user->type == DISP8) - { - displacement = user->exp; - continue; - } - break; - case FP: - if (user->type == RN && user->reg == 6) - continue; - break; - - case PCREL16: - if (user->type == PCREL16) - { - displacement = user->exp; - continue; - } - break; - case PCREL8: - if (user->type == PCREL8) - { - displacement = user->exp; - pcrel8 = 1; - continue; - } - break; - - case IMM16: - if (user->type == IMM16 - || user->type == IMM8) - { - immediate_inpage = user->page; - immediate = user->exp; - continue; - } - break; - case RLIST: - case IMM8: - if (user->type == IMM8) - { - immediate_inpage = user->page; - immediate = user->exp; - continue; - } - break; - case IMM4: - if (user->type == IMM8) - { - immediate_inpage = user->page; - immediate = user->exp; - continue; - } - break; - case QIM: - if (user->type == IMM8 - && user->exp.X_op == O_constant - && (user->exp.X_add_number == -2 - || user->exp.X_add_number == -1 - || user->exp.X_add_number == 1 - || user->exp.X_add_number == 2)) - { - immediate_inpage = user->page; - immediate = user->exp; - continue; - } - break; - case RD: - if (user->type == RN) - { - rd = user->reg; - continue; - } - break; - case RS: - if (user->type == RN) - { - rs = user->reg; - continue; - } - break; - case RDIND: - if (user->type == RNIND) - { - rd = user->reg; - continue; - - } - break; - case RNINC: - case RNIND: - case RNDEC: - case RN: - if (user->type == this_try->arg_type[i]) - { - rn = user->reg; - continue; - } - break; - case SP: - if (user->type == RN && user->reg == 7) - continue; - break; - default: - printf (_("unhandled %d\n"), this_try->arg_type[i]); - break; - } - - /* If we get here this didn't work out. */ - goto fail; - } - found = 1; - fail:; - - } - - if (found) - return this_try; - else - return 0; -} - -static int -check (expressionS *operand, - int low, - int high) -{ - if (operand->X_op != O_constant - || operand->X_add_number < low - || operand->X_add_number > high) - as_bad (_("operand must be absolute in range %d..%d"), low, high); - - return operand->X_add_number; -} - -static void -insert (char *output, int index, expressionS *exp, int reloc, int pcrel) -{ - fix_new_exp (frag_now, - output - frag_now->fr_literal + index, - 4, /* Always say size is 4, but we know better. */ - exp, pcrel, reloc); -} - -static void -build_relaxable_instruction (h8500_opcode_info *opcode, - h8500_operand_info *operand ATTRIBUTE_UNUSED) -{ - /* All relaxable instructions start life as two bytes but can become - three bytes long if a lonely branch and up to 9 bytes if long - scb. */ - char *p; - int len; - int type; - - if (opcode->bytes[0].contents == 0x01) - type = SCB_F; - else if (opcode->bytes[0].contents == 0x06 - || opcode->bytes[0].contents == 0x07) - type = SCB_TST; - else - type = BRANCH; - - p = frag_var (rs_machine_dependent, - md_relax_table[C (type, WORD_DISP)].rlx_length, - len = md_relax_table[C (type, BYTE_DISP)].rlx_length, - C (type, UNDEF_BYTE_DISP), - displacement.X_add_symbol, - displacement.X_add_number, - 0); - - p[0] = opcode->bytes[0].contents; - if (type != BRANCH) - p[1] = opcode->bytes[1].contents | rs; -} - -/* Now we know what sort of opcodes it is, let's build the bytes. */ - -static void -build_bytes (h8500_opcode_info *opcode, h8500_operand_info *operand) -{ - int index; - - if (pcrel8) - { - pcrel8 = 0; - build_relaxable_instruction (opcode, operand); - } - else - { - char *output = frag_more (opcode->length); - - memset (output, 0, opcode->length); - for (index = 0; index < opcode->length; index++) - { - output[index] = opcode->bytes[index].contents; - - switch (opcode->bytes[index].insert) - { - default: - printf (_("failed for %d\n"), opcode->bytes[index].insert); - break; - case 0: - break; - case RN: - output[index] |= rn; - break; - case RD: - case RDIND: - output[index] |= rd; - break; - case RS: - output[index] |= rs; - break; - case DISP16: - insert (output, index, &displacement, R_H8500_IMM16, 0); - index++; - break; - case DISP8: - case FPIND_D8: - insert (output, index, &displacement, R_H8500_IMM8, 0); - break; - case IMM16: - { - int p; - - switch (immediate_inpage) - { - case 'p': - p = R_H8500_HIGH16; - break; - case 'h': - p = R_H8500_HIGH16; - break; - default: - p = R_H8500_IMM16; - break; - } - insert (output, index, &immediate, p, 0); - } - index++; - break; - case RLIST: - case IMM8: - if (immediate_inpage) - insert (output, index, &immediate, R_H8500_HIGH8, 0); - else - insert (output, index, &immediate, R_H8500_IMM8, 0); - break; - case PCREL16: - insert (output, index, &displacement, R_H8500_PCREL16, 1); - index++; - break; - case PCREL8: - insert (output, index, &displacement, R_H8500_PCREL8, 1); - break; - case IMM4: - output[index] |= check (&immediate, 0, 15); - break; - case CR: - output[index] |= cr; - if (cr == 0) - output[0] |= 0x8; - else - output[0] &= ~0x8; - break; - case CRB: - output[index] |= crb; - output[0] &= ~0x8; - break; - case CRW: - output[index] |= crw; - output[0] |= 0x8; - break; - case ABS24: - insert (output, index, &absolute, R_H8500_IMM24, 0); - index += 2; - break; - case ABS16: - insert (output, index, &absolute, R_H8500_IMM16, 0); - index++; - break; - case ABS8: - insert (output, index, &absolute, R_H8500_IMM8, 0); - break; - case QIM: - switch (immediate.X_add_number) - { - case -2: - output[index] |= 0x5; - break; - case -1: - output[index] |= 0x4; - break; - case 1: - output[index] |= 0; - break; - case 2: - output[index] |= 1; - break; - } - break; - } - } - } -} - -/* This is the guts of the machine-dependent assembler. STR points to - a machine dependent instruction. This function is supposed to emit - the frags/bytes it assembles to. */ - -void -md_assemble (char *str) -{ - char *op_start; - char *op_end; - h8500_operand_info operand[2]; - h8500_opcode_info *opcode; - h8500_opcode_info *prev_opcode; - char name[11]; - - int nlen = 0; - - /* Drop leading whitespace. */ - while (*str == ' ') - str++; - - /* Find the op code end. */ - for (op_start = op_end = str; - !is_end_of_line[(unsigned char) *op_end] && *op_end != ' '; - op_end++) - if (nlen < 10) - name[nlen++] = *op_end; - - name[nlen] = 0; - - if (op_end == op_start) - as_bad (_("can't find opcode ")); - - opcode = (h8500_opcode_info *) hash_find (opcode_hash_control, name); - - if (opcode == NULL) - { - as_bad (_("unknown opcode")); - return; - } - - get_operands (opcode, op_end, operand); - prev_opcode = opcode; - - opcode = get_specific (opcode, operand); - - if (opcode == 0) - { - /* Couldn't find an opcode which matched the operands. */ - char *where = frag_more (2); - - where[0] = 0x0; - where[1] = 0x0; - as_bad (_("invalid operands for opcode")); - return; - } - - build_bytes (opcode, operand); -} - -void -tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_crawl_symbol_chain \n")); -} - -symbolS * -md_undefined_symbol (char *name ATTRIBUTE_UNUSED) -{ - return NULL; -} - -void -tc_headers_hook (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_headers_hook \n")); -} - -/* Various routines to kill one day. */ -/* Equal to MAX_PRECISION in atof-ieee.c. */ -#define MAX_LITTLENUMS 6 - -/* Turn a string in input_line_pointer into a floating point constant - of type type, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. */ - -char * -md_atof (int type, char *litP, int *sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_ATOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; -} - -const char *md_shortopts = ""; -struct option md_longopts[] = -{ - {NULL, no_argument, NULL, 0} -}; -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) -{ - return 0; -} - -void -md_show_usage (FILE *stream ATTRIBUTE_UNUSED) -{ -} - -static void -wordify_scb (char *buffer, int *disp_size, int *inst_size) -{ - int rn = buffer[1] & 0x7; - - switch (buffer[0]) - { - case 0x0e: /* BSR */ - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - case 0x28: - case 0x29: - case 0x2a: - case 0x2b: - case 0x2c: - case 0x2d: - case 0x2e: - case 0x2f: - buffer[0] |= 0x10; - buffer[1] = 0; - buffer[2] = 0; - *disp_size = 2; - *inst_size = 1; - return; - default: - abort (); - - case 0x01: - *inst_size = 6; - *disp_size = 2; - break; - case 0x06: - *inst_size = 8; - *disp_size = 2; - - *buffer++ = 0x26; /* bne + 8 */ - *buffer++ = 0x08; - break; - case 0x07: - *inst_size = 8; - *disp_size = 2; - *buffer++ = 0x27; /* bne + 8 */ - *buffer++ = 0x08; - break; - - } - *buffer++ = 0xa8 | rn; /* addq -1,rn */ - *buffer++ = 0x0c; - *buffer++ = 0x04; /* cmp #0xff:8, rn */ - *buffer++ = 0xff; - *buffer++ = 0x70 | rn; - *buffer++ = 0x36; /* bne ... */ - *buffer++ = 0; - *buffer++ = 0; -} - -/* Called after relaxing, change the frags so they know how big they - are. */ - -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - fragS *fragP) -{ - int disp_size = 0; - int inst_size = 0; - char *buffer = fragP->fr_fix + fragP->fr_literal; - - switch (fragP->fr_subtype) - { - case C (BRANCH, BYTE_DISP): - disp_size = 1; - inst_size = 1; - break; - - case C (SCB_F, BYTE_DISP): - case C (SCB_TST, BYTE_DISP): - disp_size = 1; - inst_size = 2; - break; - - /* Branches to a known 16 bit displacement. */ - - /* Turn on the 16bit bit. */ - case C (BRANCH, WORD_DISP): - case C (SCB_F, WORD_DISP): - case C (SCB_TST, WORD_DISP): - wordify_scb (buffer, &disp_size, &inst_size); - break; - - case C (BRANCH, UNDEF_WORD_DISP): - case C (SCB_F, UNDEF_WORD_DISP): - case C (SCB_TST, UNDEF_WORD_DISP): - /* This tried to be relaxed, but didn't manage it, it now needs - a fix. */ - wordify_scb (buffer, &disp_size, &inst_size); - - /* Make a reloc */ - fix_new (fragP, - fragP->fr_fix + inst_size, - 4, - fragP->fr_symbol, - fragP->fr_offset, - 0, - R_H8500_PCREL16); - - fragP->fr_fix += disp_size + inst_size; - return; - break; - default: - abort (); - } - if (inst_size) - { - /* Get the address of the end of the instruction. */ - int next_inst = fragP->fr_fix + fragP->fr_address + disp_size + inst_size; - int targ_addr = (S_GET_VALUE (fragP->fr_symbol) + - fragP->fr_offset); - int disp = targ_addr - next_inst; - - md_number_to_chars (buffer + inst_size, disp, disp_size); - fragP->fr_fix += disp_size + inst_size; - } -} - -valueT -md_section_align (segT seg, valueT size) -{ - return ((size + (1 << section_alignment[(int) seg]) - 1) - & (-1 << section_alignment[(int) seg])); -} - -void -md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) -{ - long val = * (long *) valP; - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - - if (fixP->fx_r_type == 0) - fixP->fx_r_type = fixP->fx_size == 4 ? R_H8500_IMM32 : R_H8500_IMM16; - - switch (fixP->fx_r_type) - { - case R_H8500_IMM8: - case R_H8500_PCREL8: - *buf++ = val; - break; - case R_H8500_IMM16: - case R_H8500_LOW16: - case R_H8500_PCREL16: - *buf++ = (val >> 8); - *buf++ = val; - break; - case R_H8500_HIGH8: - *buf++ = val >> 16; - break; - case R_H8500_HIGH16: - *buf++ = val >> 24; - *buf++ = val >> 16; - break; - case R_H8500_IMM24: - *buf++ = (val >> 16); - *buf++ = (val >> 8); - *buf++ = val; - break; - case R_H8500_IMM32: - *buf++ = (val >> 24); - *buf++ = (val >> 16); - *buf++ = (val >> 8); - *buf++ = val; - break; - default: - abort (); - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -/* Called just before address relaxation, return the length - by which a fragment must grow to reach it's destination. */ - -int -md_estimate_size_before_relax (fragS *fragP, segT segment_type) -{ - int what; - - switch (fragP->fr_subtype) - { - default: - abort (); - - case C (BRANCH, UNDEF_BYTE_DISP): - case C (SCB_F, UNDEF_BYTE_DISP): - case C (SCB_TST, UNDEF_BYTE_DISP): - what = GET_WHAT (fragP->fr_subtype); - /* Used to be a branch to somewhere which was unknown. */ - if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type) - { - /* Got a symbol and it's defined in this segment, become byte - sized - maybe it will fix up. */ - fragP->fr_subtype = C (what, BYTE_DISP); - } - else - /* Its got a segment, but its not ours, so it will always be - long. */ - fragP->fr_subtype = C (what, UNDEF_WORD_DISP); - break; - - case C (BRANCH, BYTE_DISP): - case C (BRANCH, WORD_DISP): - case C (BRANCH, UNDEF_WORD_DISP): - case C (SCB_F, BYTE_DISP): - case C (SCB_F, WORD_DISP): - case C (SCB_F, UNDEF_WORD_DISP): - case C (SCB_TST, BYTE_DISP): - case C (SCB_TST, WORD_DISP): - case C (SCB_TST, UNDEF_WORD_DISP): - /* When relaxing a section for the second time, we don't need to - do anything besides return the current size. */ - break; - } - - return md_relax_table[fragP->fr_subtype].rlx_length; -} - -/* Put number into target byte order. */ - -void -md_number_to_chars (char *ptr, valueT use, int nbytes) -{ - number_to_chars_bigendian (ptr, use, nbytes); -} - -long -md_pcrel_from (fixS *fixP) -{ - return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; -} - -void -tc_coff_symbol_emit_hook (symbolS *ignore ATTRIBUTE_UNUSED) -{ -} - -short -tc_coff_fix2rtype (fixS *fix_ptr) -{ - if (fix_ptr->fx_r_type == RELOC_32) - { - /* Cons likes to create reloc32's whatever the size of the reloc. */ - switch (fix_ptr->fx_size) - { - case 2: - return R_H8500_IMM16; - break; - case 1: - return R_H8500_IMM8; - break; - default: - abort (); - } - } - return fix_ptr->fx_r_type; -} - -void -tc_reloc_mangle (fixS *fix_ptr, - struct internal_reloc *intr, - bfd_vma base) -{ - symbolS *symbol_ptr; - - symbol_ptr = fix_ptr->fx_addsy; - - /* If this relocation is attached to a symbol then it's ok - to output it */ - if (fix_ptr->fx_r_type == RELOC_32) - { - /* Cons likes to create reloc32's whatever the size of the reloc. */ - switch (fix_ptr->fx_size) - { - case 2: - intr->r_type = R_IMM16; - break; - case 1: - intr->r_type = R_IMM8; - break; - default: - abort (); - } - } - else - intr->r_type = fix_ptr->fx_r_type; - - intr->r_vaddr = fix_ptr->fx_frag->fr_address + fix_ptr->fx_where + base; - intr->r_offset = fix_ptr->fx_offset; - - /* Turn the segment of the symbol into an offset. */ - if (symbol_ptr) - { - symbolS *dot; - - dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot; - if (dot) - { - intr->r_offset += S_GET_VALUE (symbol_ptr); - intr->r_symndx = dot->sy_number; - } - else - intr->r_symndx = symbol_ptr->sy_number; - } - else - intr->r_symndx = -1; -} - -int -start_label (char *ptr) -{ - /* Check for :s.w */ - if (ISALPHA (ptr[1]) && ptr[2] == '.') - return 0; - /* Check for :s */ - if (ISALPHA (ptr[1]) && !ISALPHA (ptr[2])) - return 0; - return 1; -} - -int -tc_coff_sizemachdep (fragS *frag) -{ - return md_relax_table[frag->fr_subtype].rlx_length; -} diff --git a/gas/config/tc-h8500.h b/gas/config/tc-h8500.h deleted file mode 100644 index 024f212..0000000 --- a/gas/config/tc-h8500.h +++ /dev/null @@ -1,55 +0,0 @@ -/* This file is tc-h8500.h - Copyright 1993, 1995, 1997, 1998, 2000, 2003, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_H8500 - -#define TARGET_BYTES_BIG_ENDIAN 1 - -struct internal_reloc; - -#define WORKING_DOT_WORD - -/* This macro translates between an internal fix and a coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype (fixP) - -#define BFD_ARCH bfd_arch_h8500 -#define COFF_MAGIC 0x8500 -#define TC_COUNT_RELOC(x) ((x)->fx_addsy || (x)->fx_subsy) -#define IGNORE_NONSTANDARD_ESCAPES - -#define TC_RELOC_MANGLE(s,a,b,c) tc_reloc_mangle(a, b, c) -extern void tc_reloc_mangle - (struct fix *, struct internal_reloc *, bfd_vma); - -#define LISTING_HEADER "Renesas H8/500 GAS " -#define NEED_FX_R_TYPE 1 -#define RELOC_32 1234 - -#define TC_START_LABEL(ch, ptr) (ch == ':' && start_label (ptr)) -int start_label (char *); - -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -int tc_coff_sizemachdep (struct frag *); - -#define md_operand(x) - -extern struct relax_type md_relax_table[]; -#define TC_GENERIC_RELAX_TABLE md_relax_table diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 5743173..9b3edc1 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -106,10 +106,6 @@ extern void pa_check_eof PARAMS ((void)); extern const char hppa_symbol_chars[]; #define tc_symbol_chars hppa_symbol_chars -/* The PA does not need support for either of these. */ -#define tc_crawl_symbol_chain(headers) {;} -#define tc_headers_hook(headers) {;} - #define RELOC_EXPANSION_POSSIBLE #define MAX_RELOC_EXPANSION 6 diff --git a/gas/config/tc-i370.h b/gas/config/tc-i370.h index 8822996..4cd5f2f 100644 --- a/gas/config/tc-i370.h +++ b/gas/config/tc-i370.h @@ -29,10 +29,6 @@ struct fix; #define TARGET_BYTES_BIG_ENDIAN 1 #endif -#ifndef BFD_ASSEMBLER - #error I370 support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH (i370_arch ()) extern enum bfd_architecture i370_arch (void); diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 9482311..afdd169 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4870,9 +4870,6 @@ int md_short_jump_size = 2; /* Size of dword displacement jmp. */ int md_long_jump_size = 5; -/* Size of relocation record. */ -const int md_reloc_size = 8; - void md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) char *ptr; @@ -4986,10 +4983,7 @@ md_apply_fix (fixP, valP, seg) /* For some reason, the PE format does not store a section address offset for a PC relative symbol. */ if (S_GET_SEGMENT (fixP->fx_addsy) != seg -#if defined(BFD_ASSEMBLER) || defined(S_IS_WEAK) - || S_IS_WEAK (fixP->fx_addsy) -#endif - ) + || S_IS_WEAK (fixP->fx_addsy)) value += md_pcrel_from (fixP); #endif } diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 3796ae1..ddfe297 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -1,6 +1,6 @@ /* tc-i386.h -- Header file for tc-i386.c Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,10 +23,6 @@ #ifndef TC_I386 #define TC_I386 1 -#ifndef BFD_ASSEMBLER -#error So, do you know what you are doing? -#endif - struct fix; #define TARGET_BYTES_BIG_ENDIAN 0 diff --git a/gas/config/tc-i860.h b/gas/config/tc-i860.h index 4fb34e5..11c36b5 100644 --- a/gas/config/tc-i860.h +++ b/gas/config/tc-i860.h @@ -1,5 +1,5 @@ /* tc-i860.h -- Header file for the i860. - Copyright 1991, 1992, 1995, 1998, 2000, 2001, 2002, 2003 + Copyright 1991, 1992, 1995, 1998, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. Brought back from the dead and completely reworked @@ -24,10 +24,6 @@ #ifndef TC_I860 #define TC_I860 1 -#ifndef BFD_ASSEMBLER -#error i860 support requires BFD_ASSEMBLER -#endif - enum i860_fix_info { OP_NONE = 0x00000, diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index eef97fe..a3206bb 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -123,14 +123,6 @@ extern char *input_line_pointer; -#if !defined (BFD_ASSEMBLER) && !defined (BFD) -#ifdef OBJ_COFF -const int md_reloc_size = sizeof (struct reloc); -#else /* OBJ_COFF */ -const int md_reloc_size = sizeof (struct relocation_info); -#endif /* OBJ_COFF */ -#endif - /* Local i80960 routines. */ struct memS; struct regop; @@ -2050,17 +2042,10 @@ relax_cobr (fragS *fragP) /* fragP->fr_opcode is assumed to point to If the fragment substate is 2, a 13-bit displacement was not enough. Replace the cobr with a two instructions (a compare and a branch). */ -#ifndef BFD_ASSEMBLER -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - fragS *fragP) -#else void md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS *fragP) -#endif { /* Structure describing needed address fix. */ fixS *fixP; @@ -2455,15 +2440,6 @@ md_apply_fix (fixS *fixP, if (!fixP->fx_bit_fixP) { -#ifndef BFD_ASSEMBLER - /* For callx, we always want to write out zero, and emit a - symbolic relocation. */ - if (fixP->fx_bsr) - val = 0; - - fixP->fx_addnumber = val; -#endif - md_number_to_imm (place, val, fixP->fx_size); } else if ((int) (size_t) fixP->fx_bit_fixP == 13 @@ -2546,33 +2522,6 @@ tc_bout_fix_to_chars (char *where, #endif /* OBJ_AOUT or OBJ_BOUT */ -#if defined (OBJ_COFF) && defined (BFD) -short -tc_coff_fix2rtype (fixS *fixP) -{ - if (fixP->fx_bsr) - abort (); - - if (fixP->fx_pcrel == 0 && fixP->fx_size == 4) - return R_RELLONG; - - if (fixP->fx_pcrel != 0 && fixP->fx_size == 4) - return R_IPRMED; - - abort (); - return 0; -} - -int -tc_coff_sizemachdep (fragS *frag) -{ - if (frag->fr_next) - return frag->fr_next->fr_address - frag->fr_address; - else - return 0; -} -#endif - /* Align an address by rounding it up to the specified boundary. */ valueT @@ -2581,139 +2530,12 @@ md_section_align (segT seg, { int align; -#ifdef BFD_ASSEMBLER align = bfd_get_section_alignment (stdoutput, seg); -#else - align = section_alignment[(int) seg]; -#endif return (addr + (1 << align) - 1) & (-1 << align); } extern int coff_flags; -#ifdef OBJ_COFF -void -tc_headers_hook (object_headers *headers) -{ - switch (architecture) - { - case ARCH_KA: - coff_flags |= F_I960KA; - break; - - case ARCH_KB: - coff_flags |= F_I960KB; - break; - - case ARCH_MC: - coff_flags |= F_I960MC; - break; - - case ARCH_CA: - coff_flags |= F_I960CA; - break; - - case ARCH_JX: - coff_flags |= F_I960JX; - break; - - case ARCH_HX: - coff_flags |= F_I960HX; - break; - - default: - if (iclasses_seen == I_BASE) - coff_flags |= F_I960CORE; - else if (iclasses_seen & I_CX) - coff_flags |= F_I960CA; - else if (iclasses_seen & I_HX) - coff_flags |= F_I960HX; - else if (iclasses_seen & I_JX) - coff_flags |= F_I960JX; - else if (iclasses_seen & I_CX2) - coff_flags |= F_I960CA; - else if (iclasses_seen & I_MIL) - coff_flags |= F_I960MC; - else if (iclasses_seen & (I_DEC | I_FP)) - coff_flags |= F_I960KB; - else - coff_flags |= F_I960KA; - break; - } - - if (flag_readonly_data_in_text) - { - headers->filehdr.f_magic = I960RWMAGIC; - headers->aouthdr.magic = OMAGIC; - } - else - { - headers->filehdr.f_magic = I960ROMAGIC; - headers->aouthdr.magic = NMAGIC; - } /* set magic numbers */ -} - -#endif /* OBJ_COFF */ - -#ifndef BFD_ASSEMBLER - -/* Things going on here: - - For bout, We need to assure a couple of simplifying - assumptions about leafprocs for the linker: the leafproc - entry symbols will be defined in the same assembly in - which they're declared with the '.leafproc' directive; - and if a leafproc has both 'call' and 'bal' entry points - they are both global or both local. - - For coff, the call symbol has a second aux entry that - contains the bal entry point. The bal symbol becomes a - label. - - For coff representation, the call symbol has a second aux entry that - contains the bal entry point. The bal symbol becomes a label. */ - -void -tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED) -{ - symbolS *symbolP; - - for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) - { -#ifdef OBJ_COFF - if (TC_S_IS_SYSPROC (symbolP)) - { - /* Second aux entry already contains the sysproc number. */ - S_SET_NUMBER_AUXILIARY (symbolP, 2); - S_SET_STORAGE_CLASS (symbolP, C_SCALL); - S_SET_DATA_TYPE (symbolP, S_GET_DATA_TYPE (symbolP) | (DT_FCN << N_BTSHFT)); - continue; - } -#endif /* OBJ_COFF */ - - if (!TC_S_IS_BALNAME (symbolP) && !TC_S_IS_CALLNAME (symbolP)) - continue; - - if (!S_IS_DEFINED (symbolP)) - as_bad (_("leafproc symbol '%s' undefined"), S_GET_NAME (symbolP)); - - if (TC_S_IS_CALLNAME (symbolP)) - { - symbolS *balP = tc_get_bal_of_call (symbolP); - - if (S_IS_EXTERNAL (symbolP) != S_IS_EXTERNAL (balP)) - { - S_SET_EXTERNAL (symbolP); - S_SET_EXTERNAL (balP); - as_warn (_("Warning: making leafproc entries %s and %s both global\n"), - S_GET_NAME (symbolP), S_GET_NAME (balP)); - } /* externality mismatch */ - } /* if callname */ - } /* walk the symbol chain */ -} - -#endif /* ! BFD_ASSEMBLER */ - /* For aout or bout, the bal immediately follows the call. For coff, we cheat and store a pointer to the bal symbol in the @@ -2841,8 +2663,6 @@ i960_validate_fix (fixS *fixP, segT this_segment_type ATTRIBUTE_UNUSED) return 1; } -#ifdef BFD_ASSEMBLER - /* From cgen.c: */ static short @@ -2895,8 +2715,6 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP) /* end from cgen.c */ -#endif /* BFD_ASSEMBLER */ - const pseudo_typeS md_pseudo_table[] = { {"bss", s_lcomm, 1}, diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index 897901d..05db36e 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -52,21 +52,12 @@ */ /* tailor gas */ -#define SYMBOLS_NEED_BACKPOINTERS #define LOCAL_LABELS_FB 1 #define BITFIELD_CONS_EXPRESSIONS /* tailor the coff format */ -#define BFD_ARCH bfd_arch_i960 -#define COFF_FLAGS F_AR32WR #define COFF_MAGIC I960ROMAGIC -#define OBJ_COFF_SECTION_HEADER_HAS_ALIGNMENT #define OBJ_COFF_MAX_AUXENTRIES (2) -#define TC_COUNT_RELOC(FIX) (!(FIX)->fx_done) -#define TC_COFF_FIX2RTYPE(FIX) tc_coff_fix2rtype (FIX) -#define TC_COFF_SIZEMACHDEP(FRAGP) tc_coff_sizemachdep (FRAGP) -#define TC_COFF_SET_MACHINE(HDRS) tc_headers_hook (HDRS) -extern int tc_coff_sizemachdep PARAMS ((struct frag *)); /* MEANING OF 'n_other' in the symbol record. * @@ -188,7 +179,6 @@ extern struct symbol *tc_get_bal_of_call PARAMS ((symbolS *)); extern void i960_handle_align PARAMS ((struct frag *)); #define HANDLE_ALIGN(FRAG) i960_handle_align (FRAG) -#define NEED_FX_R_TYPE #define NO_RELOC -1 #define md_operand(x) diff --git a/gas/config/tc-ip2k.h b/gas/config/tc-ip2k.h index ad8d906..e26e901 100644 --- a/gas/config/tc-ip2k.h +++ b/gas/config/tc-ip2k.h @@ -20,11 +20,6 @@ #define TC_IP2K -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error IP2K support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "IP2xxx GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-iq2000.h b/gas/config/tc-iq2000.h index 0fe7699..aba1da1 100644 --- a/gas/config/tc-iq2000.h +++ b/gas/config/tc-iq2000.h @@ -1,5 +1,5 @@ /* tc-iq2000.h -- Header file for tc-iq2000.c. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,11 +20,6 @@ #define TC_IQ2000 -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error IQ2000 support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "IQ2000 GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-m32c.h b/gas/config/tc-m32c.h index 826bcf8..971b59d 100644 --- a/gas/config/tc-m32c.h +++ b/gas/config/tc-m32c.h @@ -1,5 +1,5 @@ /* tc-m32c.h -- Header file for tc-m32c.c. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,10 +20,6 @@ #define TC_M32C -#ifndef BFD_ASSEMBLER -#error M32C support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "M16C/M32C GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-m32r.h b/gas/config/tc-m32r.h index 9ac61cf..eb03495 100644 --- a/gas/config/tc-m32r.h +++ b/gas/config/tc-m32r.h @@ -21,11 +21,6 @@ #define TC_M32R -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error M32R support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER \ (target_big_endian ? "M32R GAS" : "M32R GAS Little Endian") diff --git a/gas/config/tc-m68hc11.h b/gas/config/tc-m68hc11.h index 954e486..a1a42b8 100644 --- a/gas/config/tc-m68hc11.h +++ b/gas/config/tc-m68hc11.h @@ -32,10 +32,6 @@ struct fix; /* Motorola assembler specs does not require '.' before pseudo-ops. */ #define NO_PSEUDO_DOT 1 -#ifndef BFD_ASSEMBLER -#error M68HC11 support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH (m68hc11_arch ()) extern enum bfd_architecture m68hc11_arch (void); diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 07b06e7..8862a7f 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -70,8 +70,6 @@ const char FLT_CHARS[] = "rRsSfFdDxXeEpP"; changed in read.c . Ideally it shouldn't have to know about it at all, but nothing is ideal around here. */ -const int md_reloc_size = 8; /* Size of relocation record. */ - /* Are we trying to generate PIC code? If so, absolute references ought to be made into linkage table references or pc-relative references. Not implemented. For ELF there are other means @@ -740,63 +738,6 @@ find_cf_chip (int architecture) return buf; } -#if defined (M68KCOFF) && !defined (BFD_ASSEMBLER) - -#ifdef NO_PCREL_RELOCS - -int -make_pcrel_absolute (fixS *fixP, long *add_number) -{ - register unsigned char *opcode = fixP->fx_frag->fr_opcode; - - /* Rewrite the PC relative instructions to absolute address ones. - these are rumored to be faster, and the apollo linker refuses - to deal with the PC relative relocations. */ - if (opcode[0] == 0x60 && opcode[1] == 0xff) /* BRA -> JMP. */ - { - if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative branch to absolute jump")); - opcode[0] = 0x4e; - opcode[1] = 0xf9; - } - else if (opcode[0] == 0x61 && opcode[1] == 0xff) /* BSR -> JSR. */ - { - if (flag_keep_pcrel) - as_fatal (_("Tried to convert PC relative BSR to absolute JSR")); - opcode[0] = 0x4e; - opcode[1] = 0xb9; - } - else - as_fatal (_("Unknown PC relative instruction")); - *add_number -= 4; - return 0; -} - -#endif /* NO_PCREL_RELOCS */ - -short -tc_coff_fix2rtype (fixS *fixP) -{ - if (fixP->fx_tcbit && fixP->fx_size == 4) - return R_RELLONG_NEG; -#ifdef NO_PCREL_RELOCS - know (fixP->fx_pcrel == 0); - return (fixP->fx_size == 1 ? R_RELBYTE - : fixP->fx_size == 2 ? R_DIR16 - : R_DIR32); -#else - return (fixP->fx_pcrel - ? (fixP->fx_size == 1 ? R_PCRBYTE - : fixP->fx_size == 2 ? R_PCRWORD - : R_PCRLONG) - : (fixP->fx_size == 1 ? R_RELBYTE - : fixP->fx_size == 2 ? R_RELWORD - : R_RELLONG)); -#endif -} - -#endif - #ifdef OBJ_ELF /* Return zero if the reference to SYMBOL from within the same segment may @@ -956,8 +897,6 @@ tc_m68k_fix_adjustable (fixS *fixP) #endif /* OBJ_ELF */ -#ifdef BFD_ASSEMBLER - arelent * tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) { @@ -1068,8 +1007,6 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) return reloc; } -#endif /* BFD_ASSEMBLER */ - /* Handle of the OPCODE hash table. NULL means any use before m68k_ip_begin() will crash. */ static struct hash_control *op_hash; @@ -2273,12 +2210,8 @@ m68k_ip (char *instring) && m68k_abspcadd) { opP->disp.exp.X_op = O_symbol; -#ifndef BFD_ASSEMBLER - opP->disp.exp.X_add_symbol = &abs_symbol; -#else opP->disp.exp.X_add_symbol = section_symbol (absolute_section); -#endif } /* Force into index mode. Hope this works. */ @@ -3894,11 +3827,6 @@ init_regtable (void) static int no_68851, no_68881; -#ifdef OBJ_AOUT -/* a.out machine type. Default to 68020. */ -int m68k_aout_machtype = 2; -#endif - void md_assemble (char *str) { @@ -4444,18 +4372,6 @@ m68k_init_after_args (void) if (no_68851 && (current_architecture & m68851)) as_bad (_("options for 68851 and no-68851 both given")); -#ifdef OBJ_AOUT - /* Work out the magic number. This isn't very general. */ - if (current_architecture & m68000) - m68k_aout_machtype = 0; - else if (current_architecture & m68010) - m68k_aout_machtype = 1; - else if (current_architecture & m68020) - m68k_aout_machtype = 2; - else - m68k_aout_machtype = 2; -#endif - /* Note which set of "movec" control registers is available. */ select_control_regs (); @@ -4654,11 +4570,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) } #endif -#ifdef BFD_ASSEMBLER if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return; -#endif switch (fixP->fx_size) { @@ -4712,10 +4626,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) in write.c may have clobbered fx_pcrel, so we need to examine the reloc type. */ if ((fixP->fx_pcrel -#ifdef BFD_ASSEMBLER - || fixP->fx_r_type == BFD_RELOC_8_PCREL -#endif - ) + || fixP->fx_r_type == BFD_RELOC_8_PCREL) && fixP->fx_size == 1 && (fixP->fx_addsy == NULL || S_IS_DEFINED (fixP->fx_addsy)) @@ -4943,18 +4854,6 @@ md_convert_frag_1 (fragS *fragP) } } -#ifndef BFD_ASSEMBLER - -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT sec ATTRIBUTE_UNUSED, - fragS *fragP) -{ - md_convert_frag_1 (fragP); -} - -#else - void md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, @@ -4962,7 +4861,6 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, { md_convert_frag_1 (fragP); } -#endif /* Force truly undefined symbols to their maximum size, and generally set up the frag list to be relaxed @@ -5121,38 +5019,6 @@ md_ri_to_chars (char *the_bytes, struct reloc_info_generic *ri) #endif -#ifndef BFD_ASSEMBLER -void -tc_aout_fix_to_chars (char *where, fixS *fixP, - relax_addressT segment_address_in_file) -{ - /* - * In: length of relocation (or of address) in chars: 1, 2 or 4. - * Out: GNU LD relocation length code: 0, 1, or 2. - */ - - static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2}; - long r_symbolnum; - - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - (fixP->fx_frag->fr_address - + fixP->fx_where - segment_address_in_file), 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - where[4] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[6] = r_symbolnum & 0x0ff; - where[7] = (((fixP->fx_pcrel << 7) & 0x80) - | ((nbytes_r_length[fixP->fx_size] << 5) & 0x60) - | ((!S_IS_DEFINED (fixP->fx_addsy) << 4) & 0x10)); -} -#endif - #endif /* OBJ_AOUT or OBJ_BOUT */ #ifndef WORKING_DOT_WORD @@ -7408,7 +7274,6 @@ valueT md_section_align (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 @@ -7419,7 +7284,6 @@ md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size) align = bfd_get_section_alignment (stdoutput, segment); size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); #endif -#endif return size; } @@ -7441,34 +7305,6 @@ md_pcrel_from (fixS *fixP) return fixP->fx_where + fixP->fx_frag->fr_address - adjust; } -#ifndef BFD_ASSEMBLER -#ifdef OBJ_COFF - -void -tc_coff_symbol_emit_hook (symbolS *ignore ATTRIBUTE_UNUSED) -{ -} - -int -tc_coff_sizemachdep (fragS *frag) -{ - switch (frag->fr_subtype & 0x3) - { - case BYTE: - return 1; - case SHORT: - return 2; - case LONG: - return 4; - default: - abort (); - return 0; - } -} - -#endif -#endif - #ifdef OBJ_ELF void m68k_elf_final_processing (void) diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index 7f46592..523a387 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -61,34 +61,11 @@ struct fix; #ifndef COFF_MAGIC #define COFF_MAGIC MC68MAGIC #endif -#define BFD_ARCH bfd_arch_m68k /* for non-BFD_ASSEMBLER */ -#define TARGET_ARCH bfd_arch_m68k /* BFD_ASSEMBLER */ -#define COFF_FLAGS F_AR32W -#define TC_COUNT_RELOC(x) ((x)->fx_addsy||(x)->fx_subsy) - -#define TC_COFF_FIX2RTYPE(FIX) tc_coff_fix2rtype(FIX) -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) -extern int tc_coff_sizemachdep (struct frag *); -#ifdef TE_SUN3 -/* This variable contains the value to write out at the beginning of - the a.out file. The 2<<16 means that this is a 68020 file instead - of an old-style 68000 file */ - -#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC); /* Magic byte for file header */ -#endif /* TE_SUN3 */ - -#ifndef AOUT_MACHTYPE -#define AOUT_MACHTYPE m68k_aout_machtype -extern int m68k_aout_machtype; -#endif +#define TARGET_ARCH bfd_arch_m68k #define tc_comment_chars m68k_comment_chars extern const char *m68k_comment_chars; -#define tc_crawl_symbol_chain(a) {;} /* not used */ -#define tc_headers_hook(a) {;} /* not used */ -#define tc_aout_pre_write_hook(x) {;} /* not used */ - #define LISTING_WORD_SIZE 2 /* A word is 2 bytes */ #define LISTING_LHS_WIDTH 2 /* One word on the first line */ #define LISTING_LHS_WIDTH_SECOND 2 /* One word on the second line */ @@ -101,10 +78,6 @@ extern const char *m68k_comment_chars; #if !defined (REGISTER_PREFIX_OPTIONAL) #if defined (M68KCOFF) || defined (OBJ_ELF) -#ifndef BFD_ASSEMBLER -#define LOCAL_LABEL(name) (name[0] == '.' \ - && (name[1] == 'L' || name[1] == '.')) -#endif /* ! BFD_ASSEMBLER */ #define REGISTER_PREFIX_OPTIONAL 0 #else /* ! (COFF || ELF) */ #define REGISTER_PREFIX_OPTIONAL 1 @@ -120,11 +93,6 @@ extern const char *m68k_comment_chars; #define tc_canonicalize_symbol_name(s) ((*(s) == '~' ? *(s) = '.' : '.'), s) /* On the Delta, dots are not required before pseudo-ops. */ #define NO_PSEUDO_DOT 1 -#ifndef BFD_ASSEMBLER -#undef LOCAL_LABEL -#define LOCAL_LABEL(name) \ - (name[0] == '.' || (name[0] == 'L' && name[1] == '%')) -#endif #endif extern void m68k_mri_mode_change (int); @@ -141,8 +109,6 @@ extern void m68k_flush_pending_output (void); extern void m68k_frob_symbol (symbolS *); -#ifdef BFD_ASSEMBLER - #define tc_frob_symbol(sym,punt) \ do \ { \ @@ -177,20 +143,6 @@ extern int tc_m68k_fix_adjustable (struct fix *); extern void m68k_elf_final_processing (void); #endif -#else /* ! BFD_ASSEMBLER */ - -#define tc_frob_coff_symbol(sym) m68k_frob_symbol (sym) - -#define NO_RELOC 0 -#define RELAX_RELOC_ABS8 0 -#define RELAX_RELOC_ABS16 0 -#define RELAX_RELOC_ABS32 0 -#define RELAX_RELOC_PC8 0 -#define RELAX_RELOC_PC16 0 -#define RELAX_RELOC_PC32 0 - -#endif /* ! BFD_ASSEMBLER */ - #define DIFF_EXPR_OK extern void m68k_init_after_args (void); diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c deleted file mode 100644 index d4a950e..0000000 --- a/gas/config/tc-m88k.c +++ /dev/null @@ -1,1138 +0,0 @@ -/* m88k.c -- Assembler for the Motorola 88000 - Contributed by Devon Bowen of Buffalo University - and Torbjorn Granlund of the Swedish Institute of Computer Science. - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, - 2000, 2001, 2002, 2003, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "as.h" -#include "safe-ctype.h" -#include "subsegs.h" -#include "m88k-opcode.h" - -struct field_val_assoc -{ - char *name; - unsigned val; -}; - -struct field_val_assoc cr_regs[] = -{ - {"PID", 0}, - {"PSR", 1}, - {"EPSR", 2}, - {"SSBR", 3}, - {"SXIP", 4}, - {"SNIP", 5}, - {"SFIP", 6}, - {"VBR", 7}, - {"DMT0", 8}, - {"DMD0", 9}, - {"DMA0", 10}, - {"DMT1", 11}, - {"DMD1", 12}, - {"DMA1", 13}, - {"DMT2", 14}, - {"DMD2", 15}, - {"DMA2", 16}, - {"SR0", 17}, - {"SR1", 18}, - {"SR2", 19}, - {"SR3", 20}, - - {NULL, 0}, -}; - -struct field_val_assoc fcr_regs[] = -{ - {"FPECR", 0}, - {"FPHS1", 1}, - {"FPLS1", 2}, - {"FPHS2", 3}, - {"FPLS2", 4}, - {"FPPT", 5}, - {"FPRH", 6}, - {"FPRL", 7}, - {"FPIT", 8}, - - {"FPSR", 62}, - {"FPCR", 63}, - - {NULL, 0}, -}; - -struct field_val_assoc cmpslot[] = -{ -/* Integer Floating point. */ - {"nc", 0}, - {"cp", 1}, - {"eq", 2}, - {"ne", 3}, - {"gt", 4}, - {"le", 5}, - {"lt", 6}, - {"ge", 7}, - {"hi", 8}, {"ou", 8}, - {"ls", 9}, {"ib", 9}, - {"lo", 10}, {"in", 10}, - {"hs", 11}, {"ob", 11}, - {"be", 12}, {"ue", 12}, - {"nb", 13}, {"lg", 13}, - {"he", 14}, {"ug", 14}, - {"nh", 15}, {"ule", 15}, - {"ul", 16}, - {"uge", 17}, - - {NULL, 0}, -}; - -struct field_val_assoc cndmsk[] = -{ - {"gt0", 1}, - {"eq0", 2}, - {"ge0", 3}, - {"lt0", 12}, - {"ne0", 13}, - {"le0", 14}, - - {NULL, 0}, -}; - -struct m88k_insn -{ - unsigned long opcode; - expressionS exp; - enum reloc_type reloc; -}; - -extern char *myname; -static struct hash_control *op_hash = NULL; - -/* These bits should be turned off in the first address of every segment. */ -int md_seg_align = 7; - -/* These chars start a comment anywhere in a source file (except inside - another comment. */ -const char comment_chars[] = ";"; - -/* These chars only start a comment at the beginning of a line. */ -const char line_comment_chars[] = "#"; - -const char line_separator_chars[] = ""; - -/* Chars that can be used to separate mant from exp in floating point nums. */ -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant. - as in 0f123.456 - or 0H1.234E-12 (see exp chars above). */ -const char FLT_CHARS[] = "dDfF"; - -void -md_begin (void) -{ - const char *retval = NULL; - unsigned int i = 0; - - /* Initialize hash table. */ - op_hash = hash_new (); - - while (*m88k_opcodes[i].name) - { - char *name = m88k_opcodes[i].name; - - /* Hash each mnemonic and record its position. */ - retval = hash_insert (op_hash, name, &m88k_opcodes[i]); - - if (retval != NULL) - as_fatal (_("Can't hash instruction '%s':%s"), - m88k_opcodes[i].name, retval); - - /* Skip to next unique mnemonic or end of list. */ - for (i++; !strcmp (m88k_opcodes[i].name, name); i++) - ; - } -} - -const char *md_shortopts = ""; -struct option md_longopts[] = -{ - {NULL, no_argument, NULL, 0} -}; -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) -{ - return 0; -} - -void -md_show_usage (FILE *stream ATTRIBUTE_UNUSED) -{ -} - -static char * -get_o6 (char *param, unsigned *valp) -{ - unsigned val; - char *save_ptr; - - save_ptr = input_line_pointer; - input_line_pointer = param; - val = get_absolute_expression (); - param = input_line_pointer; - input_line_pointer = save_ptr; - - if (val & 0x3) - as_warn (_("Removed lower 2 bits of expression")); - - *valp = val; - - return (param); -} - -static char * -get_vec9 (char *param, unsigned *valp) -{ - unsigned val; - char *save_ptr; - - save_ptr = input_line_pointer; - input_line_pointer = param; - val = get_absolute_expression (); - param = input_line_pointer; - input_line_pointer = save_ptr; - - if (val >= 1 << 9) - as_warn (_("Expression truncated to 9 bits")); - - *valp = val % (1 << 9); - - return param; -} - -static char * -get_bf2 (char *param, int bc) -{ - int depth = 0; - int c; - - for (;;) - { - c = *param; - if (c == 0) - return param; - else if (c == '(') - depth++; - else if (c == ')') - depth--; - else if (c == bc && depth <= 0) - return param; - param++; - } -} - -static char * -match_name (char *param, - struct field_val_assoc *assoc_tab, - unsigned *valp) -{ - int i; - char *name; - int name_len; - - for (i = 0;; i++) - { - name = assoc_tab[i].name; - if (name == NULL) - return NULL; - name_len = strlen (name); - if (!strncmp (param, name, name_len)) - { - *valp = assoc_tab[i].val; - return param + name_len; - } - } -} - -static char * -get_bf_offset_expression (char *param, unsigned *offsetp) -{ - unsigned offset; - - if (ISALPHA (param[0])) - { - param[0] = TOLOWER (param[0]); - param[1] = TOLOWER (param[1]); - - param = match_name (param, cmpslot, offsetp); - - return param; - } - else - { - input_line_pointer = param; - offset = get_absolute_expression (); - param = input_line_pointer; - } - - *offsetp = offset; - return param; -} - -static char * -get_bf (char *param, unsigned *valp) -{ - unsigned offset = 0; - unsigned width = 0; - char *xp; - char *save_ptr; - - xp = get_bf2 (param, '<'); - - save_ptr = input_line_pointer; - input_line_pointer = param; - if (*xp == 0) - { - /* We did not find '<'. We have an offset (width implicitly 32). */ - param = get_bf_offset_expression (param, &offset); - input_line_pointer = save_ptr; - if (param == NULL) - return NULL; - } - else - { - *xp++ = 0; /* Overwrite the '<'. */ - param = get_bf2 (xp, '>'); - if (*param == 0) - return NULL; - *param++ = 0; /* Overwrite the '>'. */ - - width = get_absolute_expression (); - xp = get_bf_offset_expression (xp, &offset); - input_line_pointer = save_ptr; - - if (xp + 1 != param) - return NULL; - } - - *valp = ((width % 32) << 5) | (offset % 32); - - return param; -} - -static char * -get_cr (char *param, unsigned *regnop) -{ - unsigned regno; - unsigned c; - - if (!strncmp (param, "cr", 2)) - { - param += 2; - - regno = *param++ - '0'; - if (regno < 10) - { - if (regno == 0) - { - *regnop = 0; - return param; - } - c = *param - '0'; - if (c < 10) - { - regno = regno * 10 + c; - if (c < 64) - { - *regnop = regno; - return param + 1; - } - } - else - { - *regnop = regno; - return param; - } - } - return NULL; - } - - param = match_name (param, cr_regs, regnop); - - return param; -} - -static char * -get_fcr (char *param, unsigned *regnop) -{ - unsigned regno; - unsigned c; - - if (!strncmp (param, "fcr", 3)) - { - param += 3; - - regno = *param++ - '0'; - if (regno < 10) - { - if (regno == 0) - { - *regnop = 0; - return param; - } - c = *param - '0'; - if (c < 10) - { - regno = regno * 10 + c; - if (c < 64) - { - *regnop = regno; - return param + 1; - } - } - else - { - *regnop = regno; - return param; - } - } - return NULL; - } - - param = match_name (param, fcr_regs, regnop); - - return param; -} - -#define hexval(z) \ - (ISDIGIT (z) ? (z) - '0' : \ - ISLOWER (z) ? (z) - 'a' + 10 : \ - ISUPPER (z) ? (z) - 'A' + 10 : (unsigned) -1) - -static char * -getval (char *param, unsigned int *valp) -{ - unsigned int val = 0; - unsigned int c; - - c = *param++; - if (c == '0') - { - c = *param++; - if (c == 'x' || c == 'X') - { - c = *param++; - c = hexval (c); - while (c < 16) - { - val = val * 16 + c; - c = *param++; - c = hexval (c); - } - } - else - { - c -= '0'; - while (c < 8) - { - val = val * 8 + c; - c = *param++ - '0'; - } - } - } - else - { - c -= '0'; - while (c < 10) - { - val = val * 10 + c; - c = *param++ - '0'; - } - } - - *valp = val; - return param - 1; -} - -static char * -get_cnd (char *param, unsigned *valp) -{ - unsigned int val; - - if (ISDIGIT (*param)) - { - param = getval (param, &val); - - if (val >= 32) - { - as_warn (_("Expression truncated to 5 bits")); - val %= 32; - } - } - else - { - param[0] = TOLOWER (param[0]); - param[1] = TOLOWER (param[1]); - - param = match_name (param, cndmsk, valp); - - if (param == NULL) - return NULL; - - val = *valp; - } - - *valp = val << 21; - return param; -} - -static char * -get_reg (char *param, unsigned *regnop, unsigned int reg_prefix) -{ - unsigned c; - unsigned regno; - - c = *param++; - if (c == reg_prefix) - { - regno = *param++ - '0'; - if (regno < 10) - { - if (regno == 0) - { - *regnop = 0; - return param; - } - c = *param - '0'; - if (c < 10) - { - regno = regno * 10 + c; - if (c < 32) - { - *regnop = regno; - return param + 1; - } - } - else - { - *regnop = regno; - return param; - } - } - return NULL; - } - else if (c == 's' && param[0] == 'p') - { - *regnop = 31; - return param + 1; - } - - return 0; -} - -static char * -get_imm16 (char *param, struct m88k_insn *insn) -{ - enum reloc_type reloc = NO_RELOC; - unsigned int val; - char *save_ptr; - - if (!strncmp (param, "hi16", 4) && !ISALNUM (param[4])) - { - reloc = RELOC_HI16; - param += 4; - } - else if (!strncmp (param, "lo16", 4) && !ISALNUM (param[4])) - { - reloc = RELOC_LO16; - param += 4; - } - else if (!strncmp (param, "iw16", 4) && !ISALNUM (param[4])) - { - reloc = RELOC_IW16; - param += 4; - } - - save_ptr = input_line_pointer; - input_line_pointer = param; - expression (&insn->exp); - param = input_line_pointer; - input_line_pointer = save_ptr; - - val = insn->exp.X_add_number; - - if (insn->exp.X_op == O_constant) - { - /* Insert the value now, and reset reloc to NO_RELOC. */ - if (reloc == NO_RELOC) - { - /* Warn about too big expressions if not surrounded by xx16. */ - if (val > 0xffff) - as_warn (_("Expression truncated to 16 bits")); - } - - if (reloc == RELOC_HI16) - val >>= 16; - - insn->opcode |= val & 0xffff; - reloc = NO_RELOC; - } - else if (reloc == NO_RELOC) - /* We accept a symbol even without lo16, hi16, etc, and assume - lo16 was intended. */ - reloc = RELOC_LO16; - - insn->reloc = reloc; - - return param; -} - -static char * -get_pcr (char *param, struct m88k_insn *insn, enum reloc_type reloc) -{ - char *saveptr, *saveparam; - - saveptr = input_line_pointer; - input_line_pointer = param; - - expression (&insn->exp); - - saveparam = input_line_pointer; - input_line_pointer = saveptr; - - /* Botch: We should relocate now if O_constant. */ - insn->reloc = reloc; - - return saveparam; -} - -static char * -get_cmp (char *param, unsigned *valp) -{ - unsigned int val; - char *save_ptr; - - save_ptr = param; - - param = match_name (param, cmpslot, valp); - val = *valp; - - if (param == NULL) - { - param = save_ptr; - - save_ptr = input_line_pointer; - input_line_pointer = param; - val = get_absolute_expression (); - param = input_line_pointer; - input_line_pointer = save_ptr; - - if (val >= 32) - { - as_warn (_("Expression truncated to 5 bits")); - val %= 32; - } - } - - *valp = val << 21; - return param; -} - -static int -calcop (struct m88k_opcode *format, - char *param, - struct m88k_insn *insn) -{ - char *fmt = format->op_spec; - int f; - unsigned val; - unsigned opcode; - unsigned int reg_prefix = 'r'; - - insn->opcode = format->opcode; - opcode = 0; - - for (;;) - { - if (param == 0) - return 0; - f = *fmt++; - switch (f) - { - case 0: - insn->opcode |= opcode; - return (*param == 0 || *param == '\n'); - - default: - if (f != *param++) - return 0; - break; - - case 'd': - param = get_reg (param, &val, reg_prefix); - reg_prefix = 'r'; - opcode |= val << 21; - break; - - case 'o': - param = get_o6 (param, &val); - opcode |= ((val >> 2) << 7); - break; - - case 'x': - reg_prefix = 'x'; - break; - - case '1': - param = get_reg (param, &val, reg_prefix); - reg_prefix = 'r'; - opcode |= val << 16; - break; - - case '2': - param = get_reg (param, &val, reg_prefix); - reg_prefix = 'r'; - opcode |= val; - break; - - case '3': - param = get_reg (param, &val, 'r'); - opcode |= (val << 16) | val; - break; - - case 'I': - param = get_imm16 (param, insn); - break; - - case 'b': - param = get_bf (param, &val); - opcode |= val; - break; - - case 'p': - param = get_pcr (param, insn, RELOC_PC16); - break; - - case 'P': - param = get_pcr (param, insn, RELOC_PC26); - break; - - case 'B': - param = get_cmp (param, &val); - opcode |= val; - break; - - case 'M': - param = get_cnd (param, &val); - opcode |= val; - break; - - case 'c': - param = get_cr (param, &val); - opcode |= val << 5; - break; - - case 'f': - param = get_fcr (param, &val); - opcode |= val << 5; - break; - - case 'V': - param = get_vec9 (param, &val); - opcode |= val; - break; - - case '?': - /* Having this here repeats the warning somtimes. - But can't we stand that? */ - as_warn (_("Use of obsolete instruction")); - break; - } - } -} - -void -md_assemble (char *op) -{ - char *param, *thisfrag; - char c; - struct m88k_opcode *format; - struct m88k_insn insn; - - assert (op); - - /* Skip over instruction to find parameters. */ - for (param = op; *param != 0 && !ISSPACE (*param); param++) - ; - c = *param; - *param++ = '\0'; - - /* Try to find the instruction in the hash table. */ - if ((format = (struct m88k_opcode *) hash_find (op_hash, op)) == NULL) - { - as_bad (_("Invalid mnemonic '%s'"), op); - return; - } - - /* Try parsing this instruction into insn. */ - insn.exp.X_add_symbol = 0; - insn.exp.X_op_symbol = 0; - insn.exp.X_add_number = 0; - insn.exp.X_op = O_illegal; - insn.reloc = NO_RELOC; - - while (!calcop (format, param, &insn)) - { - /* If it doesn't parse try the next instruction. */ - if (!strcmp (format[0].name, format[1].name)) - format++; - else - { - as_fatal (_("Parameter syntax error")); - return; - } - } - - /* Grow the current frag and plop in the opcode. */ - thisfrag = frag_more (4); - md_number_to_chars (thisfrag, insn.opcode, 4); - - /* If this instruction requires labels mark it for later. */ - switch (insn.reloc) - { - case NO_RELOC: - break; - - case RELOC_LO16: - case RELOC_HI16: - fix_new_exp (frag_now, - thisfrag - frag_now->fr_literal + 2, - 2, - &insn.exp, - 0, - insn.reloc); - break; - - case RELOC_IW16: - fix_new_exp (frag_now, - thisfrag - frag_now->fr_literal, - 4, - &insn.exp, - 0, - insn.reloc); - break; - - case RELOC_PC16: - fix_new_exp (frag_now, - thisfrag - frag_now->fr_literal + 2, - 2, - &insn.exp, - 1, - insn.reloc); - break; - - case RELOC_PC26: - fix_new_exp (frag_now, - thisfrag - frag_now->fr_literal, - 4, - &insn.exp, - 1, - insn.reloc); - break; - - default: - as_fatal (_("Unknown relocation type")); - break; - } -} - -void -md_number_to_chars (char *buf, valueT val, int nbytes) -{ - number_to_chars_bigendian (buf, val, nbytes); -} - -#define MAX_LITTLENUMS 6 - -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. */ - -char * -md_atof (int type, char *litP, int *sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_ATOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; -} - -int md_short_jump_size = 4; - -void -md_create_short_jump (char *ptr, - addressT from_addr ATTRIBUTE_UNUSED, - addressT to_addr ATTRIBUTE_UNUSED, - fragS *frag, - symbolS *to_symbol) -{ - ptr[0] = (char) 0xc0; - ptr[1] = 0x00; - ptr[2] = 0x00; - ptr[3] = 0x00; - fix_new (frag, - ptr - frag->fr_literal, - 4, - to_symbol, - (offsetT) 0, - 0, - RELOC_PC26); /* Botch: Shouldn't this be RELOC_PC16? */ -} - -int md_long_jump_size = 4; - -void -md_create_long_jump (char *ptr, - addressT from_addr ATTRIBUTE_UNUSED, - addressT to_addr ATTRIBUTE_UNUSED, - fragS *frag, - symbolS *to_symbol) -{ - ptr[0] = (char) 0xc0; - ptr[1] = 0x00; - ptr[2] = 0x00; - ptr[3] = 0x00; - fix_new (frag, - ptr - frag->fr_literal, - 4, - to_symbol, - (offsetT) 0, - 0, - RELOC_PC26); -} - -int -md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, - segT segment_type ATTRIBUTE_UNUSED) -{ - as_fatal (_("Relaxation should never occur")); - return -1; -} - -#ifdef M88KCOFF - -/* These functions are needed if we are linking with obj-coffbfd.c. - That file may be replaced by a more BFD oriented version at some - point. If that happens, these functions should be reexamined. - - Ian Lance Taylor, Cygnus Support, 13 July 1993. */ - -/* Given a fixS structure (created by a call to fix_new, above), - return the BFD relocation type to use for it. */ - -short -tc_coff_fix2rtype (fixS *fixp) -{ - switch (fixp->fx_r_type) - { - case RELOC_LO16: - return R_LVRT16; - case RELOC_HI16: - return R_HVRT16; - case RELOC_PC16: - return R_PCR16L; - case RELOC_PC26: - return R_PCR26L; - case RELOC_32: - return R_VRT32; - case RELOC_IW16: - return R_VRT16; - default: - abort (); - } -} - -/* Apply a fixS to the object file. Since COFF does not use addends - in relocs, the addend is actually stored directly in the object - file itself. */ - -void -md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) -{ - long val = * (long *) valP; - char *buf; - - buf = fixP->fx_frag->fr_literal + fixP->fx_where; - fixP->fx_offset = 0; - - switch (fixP->fx_r_type) - { - case RELOC_IW16: - fixP->fx_offset = val >> 16; - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_LO16: - fixP->fx_offset = val >> 16; - buf[0] = val >> 8; - buf[1] = val; - break; - - case RELOC_HI16: - fixP->fx_offset = val >> 16; - buf[0] = val >> 8; - buf[1] = val; - break; - - case RELOC_PC16: - buf[0] = val >> 10; - buf[1] = val >> 2; - break; - - case RELOC_PC26: - buf[0] |= (val >> 26) & 0x03; - buf[1] = val >> 18; - buf[2] = val >> 10; - buf[3] = val >> 2; - break; - - case RELOC_32: - buf[0] = val >> 24; - buf[1] = val >> 16; - buf[2] = val >> 8; - buf[3] = val; - break; - - default: - abort (); - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -/* Where a PC relative offset is calculated from. On the m88k they - are calculated from just after the instruction. */ - -long -md_pcrel_from (fixS *fixp) -{ - switch (fixp->fx_r_type) - { - case RELOC_PC16: - return fixp->fx_frag->fr_address + fixp->fx_where - 2; - case RELOC_PC26: - return fixp->fx_frag->fr_address + fixp->fx_where; - default: - abort (); - } -} - -/* Fill in rs_align_code fragments. */ - -void -m88k_handle_align (fragS *fragp) -{ - static const unsigned char nop_pattern[] = { 0xf4, 0x00, 0x58, 0x00 }; - - int bytes; - char *p; - - if (fragp->fr_type != rs_align_code) - return; - - bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; - p = fragp->fr_literal + fragp->fr_fix; - - if (bytes & 3) - { - int fix = bytes & 3; - memset (p, 0, fix); - p += fix; - bytes -= fix; - fragp->fr_fix += fix; - } - - memcpy (p, nop_pattern, 4); - fragp->fr_var = 4; -} - -#endif /* M88KCOFF */ - -const pseudo_typeS md_pseudo_table[] = -{ - {"align", s_align_bytes, 4}, - {"def", s_set, 0}, - {"dfloat", float_cons, 'd'}, - {"ffloat", float_cons, 'f'}, - {"half", cons, 2}, - {"bss", s_lcomm, 1}, - {"string", stringer, 0}, - {"word", cons, 4}, - /* Force set to be treated as an instruction. */ - {"set", NULL, 0}, - {".set", s_set, 0}, - {NULL, NULL, 0} -}; diff --git a/gas/config/tc-m88k.h b/gas/config/tc-m88k.h deleted file mode 100644 index 2c2984f..0000000 --- a/gas/config/tc-m88k.h +++ /dev/null @@ -1,109 +0,0 @@ -/* m88k.h -- Assembler for the Motorola 88000 - Contributed by Devon Bowen of Buffalo University - and Torbjorn Granlund of the Swedish Institute of Computer Science. - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, - 2002, 2005 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_M88K - -#define TARGET_BYTES_BIG_ENDIAN 1 - -#ifdef M88KCOFF -#define COFF_MAGIC MC88OMAGIC -#define BFD_ARCH bfd_arch_m88k -#define COFF_FLAGS F_AR32W -#endif - -#define NEED_FX_R_TYPE -#define TC_KEEP_FX_OFFSET -#define TC_CONS_RELOC RELOC_32 - -/* Different type of relocation available in the m88k. */ - -enum reloc_type -{ - RELOC_LO16, /* lo16(sym). */ - RELOC_HI16, /* hi16(sym). */ - RELOC_PC16, /* bb0, bb1, bcnd. */ - RELOC_PC26, /* br, bsr. */ - RELOC_32, /* Jump tables, etc. */ - RELOC_IW16, /* Global access through linker regs 28. */ - NO_RELOC -}; - -struct reloc_info_m88k -{ - unsigned long int r_address; - unsigned int r_symbolnum:24; - unsigned int r_extern:1; - unsigned int r_pad:3; - enum reloc_type r_type:4; - long int r_addend; -}; - -#define relocation_info reloc_info_m88k - -/* The m88k uses '@' to start local labels. */ -#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) - -#ifndef BFD_ASSEMBLER -#define LOCAL_LABEL(name) \ - ((name[0] =='@' && (name [1] == 'L' || name [1] == '.')) \ - || (name[0] == 'L' && name[1] == '0' && name[2] == '\001')) -#endif - -/* The m88k uses pseudo-ops with no leading period. */ -#define NO_PSEUDO_DOT 1 - -/* Don't warn on word overflow; it happens on %hi relocs. */ -#undef WARN_SIGNED_OVERFLOW_WORD - -#define md_convert_frag(b,s,f) {as_fatal (_("m88k convert_frag\n"));} - -/* We don't need to do anything special for undefined symbols. */ -#define md_undefined_symbol(s) 0 - -/* We have no special operand handling. */ -#define md_operand(e) - -#ifdef M88KCOFF - -/* Whether a reloc should be output. */ -#define TC_COUNT_RELOC(fixp) ((fixp)->fx_addsy != NULL) - -/* Get the BFD reloc type to use for a gas fixS structure. */ -#define TC_COFF_FIX2RTYPE(fixp) tc_coff_fix2rtype (fixp) - -/* No special hook needed for symbols. */ -#define tc_coff_symbol_emit_hook(s) - -/* Align sections to a four byte boundary. */ -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) max (section_alignment[(int) (SEG)], 4) - -/* Fill in rs_align_code fragments. */ -extern void m88k_handle_align (fragS *); -#define HANDLE_ALIGN(frag) m88k_handle_align (frag) - -#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4) - -#endif /* M88KCOFF */ diff --git a/gas/config/tc-maxq.c b/gas/config/tc-maxq.c index e6987e1..c1a11af 100644 --- a/gas/config/tc-maxq.c +++ b/gas/config/tc-maxq.c @@ -90,7 +90,6 @@ union _maxq20_op typedef union _maxq20_op maxq20_opcode; /* For handling optional L/S in Maxq20. */ -#ifdef BFD_ASSEMBLER /* Exposed For Linker - maps indirectly to the liker relocations. */ #define LONG_PREFIX MAXQ_LONGJUMP /* BFD_RELOC_16 */ @@ -100,16 +99,6 @@ typedef union _maxq20_op maxq20_opcode; #define NO_PREFIX 0 #define EXPLICT_LONG_PREFIX 14 -#else - -#define EXPLICT_LONG_PREFIX 14 -#define LONG_PREFIX 5 -#define SHORT_PREFIX 1 -#define ABSOLUTE_ADDR_FOR_DATA 0 -#define NO_PREFIX 0 - -#endif - /* The main instruction structure containing fields to describe instrn */ typedef struct _maxq20_insn { @@ -229,7 +218,6 @@ md_show_usage (FILE * stream) ")); } -#ifdef BFD_ASSEMBLER unsigned long maxq20_mach (void) { @@ -298,8 +286,6 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) return rel; } -#endif - /* md_estimate_size_before_relax() Called just before relax() for rs_machine_dependent frags. The MAXQ @@ -464,35 +450,13 @@ maxq20_cons_fix_new (fragS * frag, unsigned int off, unsigned int len, return; } -short -tc_coff_fix2rtype (fixS * fixP) -{ - return fixP->fx_r_type; -} - -int -tc_coff_sizemachdep (fragS *fragP) -{ - if (fragP->fr_next) - return (fragP->fr_next->fr_address - fragP->fr_address); - - return 0; -} - /* GAS will call this for every rs_machine_dependent fragment. The instruction is compleated using the data from the relaxation pass. It may also create any necessary relocations. */ -#ifdef BFD_ASSEMBLER void md_convert_frag (bfd * headers ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED, fragS * fragP) -#else -void -md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, - segT sec ATTRIBUTE_UNUSED, - fragS * fragP) -#endif { char *opcode; offsetT target_address; @@ -619,18 +583,10 @@ md_apply_fix (fixS *fixP, valueT *valT, segT seg ATTRIBUTE_UNUSED) maxq_number_to_chars (p + 1, PFX0, 1); } -#ifdef BFD_ASSEMBLER /* Remember value for tc_gen_reloc. */ fixP->fx_addnumber = *valT; -#endif } - /* This prob can be fixed by defining tc_fix_adjustable. */ -#ifndef BFD_ASSEMBLER - if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy)) - segment_info[S_GET_SEGMENT (fixP->fx_addsy)].dot = NULL; -#endif - /* Some fixups generated by GAS which gets resovled before this this func. is called need to be wriiten to the frag as here we are going to go away with the relocations fx_done=1. */ @@ -728,16 +684,6 @@ const pseudo_typeS md_pseudo_table[] = {NULL, 0, 0}, }; -#if defined(BFD_HEADERS) -#ifdef RELSZ -const int md_reloc_size = RELSZ; /* Coff headers. */ -#else -const int md_reloc_size = 12; /* Something else headers. */ -#endif -#else -const int md_reloc_size = 12; /* Not bfdized. */ -#endif - #define SET_PFX_ARG(x) (PFX_INSN[1] = x) @@ -1512,22 +1458,8 @@ maxq20_data (char *op_string) if (symbolP != NULL && S_GET_SEGMENT (symbolP) != now_seg - && S_GET_SEGMENT (symbolP) != -#ifdef BFD_ASSEMBLER - bfd_und_section_ptr -#else - SEG_UNKNOWN -#endif - ) + && S_GET_SEGMENT (symbolP) != bfd_und_section_ptr) { - int val_pfx; - -#ifdef BFD_ASSEMBLER - val_pfx = 0; -#else - val_pfx = (symbolP->sy_value.X_add_number) >> 8; -#endif - /* In case we do not want to always include the prefix instruction and let the loader handle the job or in case of a 8 bit addressing mode, we will just check for val_pfx to be equal to zero and then load the @@ -1535,7 +1467,7 @@ maxq20_data (char *op_string) loaded. */ /* The prefix register will have to be loaded automatically as we have a 16 bit addressing field. */ - pfx_for_imm_val (val_pfx); + pfx_for_imm_val (0); return symbolP; } @@ -1592,23 +1524,14 @@ maxq20_displacement (char *disp_start, char *disp_end) #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) if (exp->X_op != O_constant -#ifdef BFD_ASSEMBLER && OUTPUT_FLAVOR == bfd_target_aout_flavour -#endif && exp_seg != absolute_section && exp_seg != text_section && exp_seg != data_section && exp_seg != bss_section && exp_seg != undefined_section -#ifdef BFD_ASSEMBLER - && !bfd_is_com_section (exp_seg) -#endif - ) + && !bfd_is_com_section (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 diff --git a/gas/config/tc-maxq.h b/gas/config/tc-maxq.h index 0735785..12b7a94 100644 --- a/gas/config/tc-maxq.h +++ b/gas/config/tc-maxq.h @@ -1,6 +1,6 @@ /* tc-maxq.h -- Header file for the asssembler(MAXQ) - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2005 Free Software Foundation, Inc. Contributed by HCL Technologies Pvt. Ltd. @@ -50,10 +50,6 @@ typedef enum _RELOC_ENUM } RELOC_ENUM; -#ifndef NEED_FX_R_TYPE -#define NEED_FX_R_TYPE /* For defining our own rloc type. */ -#endif - #ifndef MAX_STACK #define MAX_STACK 0xf #endif @@ -86,9 +82,6 @@ RELOC_ENUM; /* Locally defined symbol shoudnot be adjusted to section symbol. */ #define tc_fix_adjustable(FIX) 0 -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -extern int tc_coff_sizemachdep (fragS * frag); - /* This specifies that the target has been defined as little endian - default. */ #define TARGET_BYTES_BIG_ENDIAN 0 @@ -107,23 +100,6 @@ extern int tc_coff_sizemachdep (fragS * frag); #define TARGET_MACH maxq20_mach () extern unsigned long maxq20_mach (void); -/* COFF format. */ -#ifndef BFD_ASSEMBLER - -/* Defines the magic number we are using for the maxq-coff. defined in coff.h. */ -#define COFF_MAGIC MAXQ20MAGIC -#define BFD_ARCH bfd_arch_maxq - -/* Whether the reloc should be outputted to the file or not. This - is only true if the symbol we are relocating for is not empty. */ -#define TC_COUNT_RELOC(fixp) ((fixp) -> fx_addsy != NULL) - -/* This macro translates between an internal fix and an coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype (fixP) -extern short tc_coff_fix2rtype (struct fix *); - -#endif /* BFD_ASSEMBLER */ - #ifndef LEX_AT /* We define this macro to generate a fixup for a data allocation pseudo-op. */ #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) maxq20_cons_fix_new (FRAG,OFF,LEN,EXP) diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index 0f9ec69..a795a55 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -49,8 +49,6 @@ const char comment_chars[] = "#/"; const char line_separator_chars[] = ";"; const char line_comment_chars[] = "#/"; -const int md_reloc_size = 8; - static int do_jsri2bsr = 0; /* Change here from 1 by Cruess 19 August 97. */ static int sifilter_mode = 0; diff --git a/gas/config/tc-mcore.h b/gas/config/tc-mcore.h index 12410c8..dc97eb5 100644 --- a/gas/config/tc-mcore.h +++ b/gas/config/tc-mcore.h @@ -23,18 +23,10 @@ #ifndef TC_MCORE #define TC_MCORE 1 -#ifndef BFD_ASSEMBLER - #error MCORE support requires BFD_ASSEMBLER -#endif - #define TARGET_ARCH bfd_arch_mcore /* Used to initialise target_big_endian. */ #define TARGET_BYTES_BIG_ENDIAN 0 -/* Don't write out relocs for pcrel stuff. */ -#define TC_COUNT_RELOC(x) (((x)->fx_addsy || (x)->fx_subsy) && \ - (x)->fx_r_type < BFD_RELOC_MCORE_PCREL_IMM8BY4) - #define IGNORE_NONSTANDARD_ESCAPES #define TC_RELOC_MANGLE(a,b,c) tc_reloc_mangle (a, b, c) @@ -45,15 +37,9 @@ #define LISTING_HEADER "M.CORE GAS Version 2.9.4" #define LISTING_LHS_CONT_LINES 4 -#define NEED_FX_R_TYPE 1 -#define COFF_FLAGS 1 - /* We want local label support. */ #define LOCAL_LABELS_FB 1 -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -int tc_coff_sizemachdep (struct frag *); - extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table #define md_end md_mcore_end diff --git a/gas/config/tc-mn10200.h b/gas/config/tc-mn10200.h index ba10f49..b4722df 100644 --- a/gas/config/tc-mn10200.h +++ b/gas/config/tc-mn10200.h @@ -1,5 +1,5 @@ /* tc-mn10200.h -- Header file for tc-mn10200.c. - Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000, 2001, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,10 +22,6 @@ #define TARGET_BYTES_BIG_ENDIAN 0 -#ifndef BFD_ASSEMBLER - #error MN10200 support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_mn10200 diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index d9124d8..8849d1c 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -1,5 +1,5 @@ /* tc-mn10300.c -- Assembler code for the Matsushita 10300 - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -2468,11 +2468,10 @@ md_apply_fix (fixP, valP, seg) abort (); /* The value we are passed in *valuep includes the symbol values. - Since we are using BFD_ASSEMBLER, if we are doing this relocation - the code in write.c is going to call bfd_install_relocation, which - is also going to use the symbol value. That means that if the - reloc is fully resolved we want to use *valuep since - bfd_install_relocation is not being used. + If we are doing this relocation the code in write.c is going to + call bfd_install_relocation, which is also going to use the symbol + value. That means that if the reloc is fully resolved we want to + use *valuep since bfd_install_relocation is not being used. However, if the reloc is not fully resolved we do not want to use *valuep, and must use fx_offset instead. However, if the reloc diff --git a/gas/config/tc-mn10300.h b/gas/config/tc-mn10300.h index fc65025..ad41df4 100644 --- a/gas/config/tc-mn10300.h +++ b/gas/config/tc-mn10300.h @@ -1,5 +1,5 @@ /* tc-mn10300.h -- Header file for tc-mn10300.c. - Copyright 1996, 1997, 2000, 2001, 2002, 2003, 2004 + Copyright 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,10 +23,6 @@ #define TARGET_BYTES_BIG_ENDIAN 0 -#ifndef BFD_ASSEMBLER - #error MN10300 support requires BFD_ASSEMBLER -#endif - #define DIFF_EXPR_OK #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" diff --git a/gas/config/tc-ms1.h b/gas/config/tc-ms1.h index bc2b3f1..ebf9533 100644 --- a/gas/config/tc-ms1.h +++ b/gas/config/tc-ms1.h @@ -20,11 +20,6 @@ #define TC_MS1 -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error MS1 support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "MS1 GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index 9e5c533..5b6e196 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1964,12 +1964,11 @@ md_apply_fix (fixS * fixp, valueT * valuep, segT seg) } } -/* A `BFD_ASSEMBLER' GAS will call this to generate a reloc. GAS - will pass the resulting reloc to `bfd_install_relocation'. This - currently works poorly, as `bfd_install_relocation' often does the - wrong thing, and instances of `tc_gen_reloc' have been written to - work around the problems, which in turns makes it difficult to fix - `bfd_install_relocation'. */ +/* GAS will call this to generate a reloc, passing the resulting reloc + to `bfd_install_relocation'. This currently works poorly, as + `bfd_install_relocation' often does the wrong thing, and instances of + `tc_gen_reloc' have been written to work around the problems, which + in turns makes it difficult to fix `bfd_install_relocation'. */ /* If while processing a fixup, a reloc really needs to be created then it is done here. */ diff --git a/gas/config/tc-msp430.h b/gas/config/tc-msp430.h index e0ca859..632e2a9 100644 --- a/gas/config/tc-msp430.h +++ b/gas/config/tc-msp430.h @@ -1,5 +1,5 @@ /* This file is tc-msp430.h - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Dmitry Diky <diwil@mail.ru> @@ -20,10 +20,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef BFD_ASSEMBLER - #error MSP430 support requires BFD_ASSEMBLER -#endif - #define TC_MSP430 /* By convention, you should define this macro in the `.h' file. For example, `tc-m68k.h' defines `TC_M68K'. You might have to use this diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c index 1b35fb6..1a8c3cb 100644 --- a/gas/config/tc-ns32k.c +++ b/gas/config/tc-ns32k.c @@ -1243,7 +1243,6 @@ parse (const char *line, int recursive_level) return recursive_level; } -#ifdef BFD_ASSEMBLER /* This functionality should really be in the bfd library. */ static bfd_reloc_code_real_type @@ -1307,7 +1306,6 @@ reloc (int size, int pcrel, int type) return BFD_RELOC_NONE; } -#endif static void fix_new_ns32k (fragS *frag, /* Which frag? */ @@ -1327,11 +1325,7 @@ fix_new_ns32k (fragS *frag, /* Which frag? */ { fixS *fixP = fix_new (frag, where, size, add_symbol, offset, pcrel, -#ifdef BFD_ASSEMBLER bit_fixP ? NO_RELOC : reloc (size, pcrel, im_disp) -#else - NO_RELOC -#endif ); fix_opcode_frag (fixP) = opcode_frag; @@ -1359,11 +1353,7 @@ fix_new_ns32k_exp (fragS *frag, /* Which frag? */ unsigned int opcode_offset) { fixS *fixP = fix_new_exp (frag, where, size, exp, pcrel, -#ifdef BFD_ASSEMBLER bit_fixP ? NO_RELOC : reloc (size, pcrel, im_disp) -#else - NO_RELOC -#endif ); fix_opcode_frag (fixP) = opcode_frag; @@ -2047,17 +2037,10 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) /* Convert a relaxed displacement to ditto in final output. */ -#ifndef BFD_ASSEMBLER -void -md_convert_frag (object_headers *headers, - segT sec, - fragS *fragP) -#else void md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS *fragP) -#endif { long disp; long ext = 0; @@ -2137,7 +2120,6 @@ md_estimate_size_before_relax (fragS *fragP, segT segment) int md_short_jump_size = 3; int md_long_jump_size = 5; -const int md_reloc_size = 8; /* Size of relocation record. */ void md_create_short_jump (char *ptr, @@ -2275,8 +2257,6 @@ md_pcrel_from (fixS *fixP) return res; } -#ifdef BFD_ASSEMBLER - arelent * tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) { @@ -2308,39 +2288,3 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) return rel; } -#else /* BFD_ASSEMBLER */ - -#ifdef OBJ_AOUT -void -cons_fix_new_ns32k (char *where, - struct fix *fixP, - relax_addressT segment_address_in_file) -{ - /* In: Length of relocation (or of address) in chars: 1, 2 or 4. - Out: GNU LD relocation length code: 0, 1, or 2. */ - - static unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 }; - long r_symbolnum; - - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - md_number_to_chars (where + 4, - ((long) (r_symbolnum) - | (long) (fixP->fx_pcrel << 24) - | (long) (nbytes_r_length[fixP->fx_size] << 25) - | (long) ((!S_IS_DEFINED (fixP->fx_addsy)) << 27) - | (long) (fix_bsr (fixP) << 28) - | (long) (fix_im_disp (fixP) << 29)), - 4); -} - -#endif /* OBJ_AOUT */ -#endif /* BFD_ASSEMBLER */ diff --git a/gas/config/tc-ns32k.h b/gas/config/tc-ns32k.h index 30f7cc1..1504966 100644 --- a/gas/config/tc-ns32k.h +++ b/gas/config/tc-ns32k.h @@ -26,7 +26,6 @@ #define TC_PCREL_ADJUST(F) md_pcrel_adjust(F) extern int md_pcrel_adjust (fragS *); -#ifdef BFD_ASSEMBLER #define NO_RELOC BFD_RELOC_NONE #define TARGET_ARCH bfd_arch_ns32k @@ -34,18 +33,11 @@ extern int md_pcrel_adjust (fragS *); #ifndef TARGET_FORMAT /* Maybe defined in te-*.h. */ #define TARGET_FORMAT "a.out-pc532-mach" #endif -#else -#define NO_RELOC 0 -#endif #define LOCAL_LABELS_FB 1 #include "bit_fix.h" -#define tc_aout_pre_write_hook(x) {;} /* not used */ -#define tc_crawl_symbol_chain(a) {;} /* not used */ -#define tc_headers_hook(a) {;} /* not used */ - #ifdef SEQUENT_COMPATABILITY #define DEF_MODEC 20 #define DEF_MODEL 21 diff --git a/gas/config/tc-openrisc.h b/gas/config/tc-openrisc.h index 22d2be8..0c14da2 100644 --- a/gas/config/tc-openrisc.h +++ b/gas/config/tc-openrisc.h @@ -20,11 +20,6 @@ #define TC_OPENRISC -#ifndef BFD_ASSEMBLER -/* leading space so will compile with cc */ -# error OPENRISC support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "OpenRISC GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-or32.c b/gas/config/tc-or32.c index f8790db..3099e9f 100644 --- a/gas/config/tc-or32.c +++ b/gas/config/tc-or32.c @@ -26,10 +26,7 @@ #include "safe-ctype.h" #include "as.h" #include "opcode/or32.h" - -#ifdef BFD_ASSEMBLER #include "elf/or32.h" -#endif #define DEBUG 0 @@ -74,16 +71,6 @@ const pseudo_typeS md_pseudo_table[] = int md_short_jump_size = 4; int md_long_jump_size = 4; -#if defined(BFD_HEADERS) -#ifdef RELSZ -const int md_reloc_size = RELSZ; /* Coff headers. */ -#else -const int md_reloc_size = 12; /* Something else headers. */ -#endif -#else -const int md_reloc_size = 12; /* Not bfdized. */ -#endif - /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ const char comment_chars[] = "#"; @@ -254,11 +241,7 @@ md_assemble (char *str) md_number_to_chars (toP, the_insn.opcode, 4); /* Put out the symbol-dependent stuff. */ -#ifdef BFD_ASSEMBLER if (the_insn.reloc != BFD_RELOC_NONE) -#else - if (the_insn.reloc != NO_RELOC) -#endif { fix_new_exp (frag_now, (toP - frag_now->fr_literal + the_insn.reloc_offset), @@ -274,7 +257,6 @@ static int waiting_for_shift = 0; static int mask_or_shift = 0; -#ifdef BFD_ASSEMBLER static char * parse_operand (char *s, expressionS *operandp, int opt) { @@ -338,83 +320,11 @@ parse_operand (char *s, expressionS *operandp, int opt) return new; } -#else - -static char * -parse_operand (char *s, expressionS *operandp, int opt) -{ - char *save = input_line_pointer; - char *new; - -#if DEBUG - printf (" PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt); -#endif - - input_line_pointer = s; - - if (strncasecmp (s, "HI(", 3) == 0) - { - waiting_for_shift = 1; - mask_or_shift = RELOC_CONSTH; - - input_line_pointer += 3; - } - else if (strncasecmp (s, "LO(", 3) == 0) - { - mask_or_shift = RELOC_CONST; - - input_line_pointer += 3; - } - else - mask_or_shift = 0; - - expression (operandp); - - if (operandp->X_op == O_absent) - { - if (! opt) - as_bad (_("missing operand")); - else - { - operandp->X_add_number = 0; - operandp->X_op = O_constant; - } - } - - new = input_line_pointer; - input_line_pointer = save; - - if ((operandp->X_op == O_symbol) && (*s != '_')) - { -#if DEBUG - printf ("symbol: '%s'\n", save); -#endif - - for (save = s; s < new; s++) - if ((*s == REGISTER_PREFIX) && (*(s + 1) == 'r')) /* Register prefix. */ - s++; - - if ((*s == 'r') && ISDIGIT (*(s + 1))) - { - operandp->X_add_number = strtol (s + 1, NULL, 10); - operandp->X_op = O_register; - } - s = save; - } - -#if DEBUG - printf (" %s=parse_operand(%s): operandp->X_op = %u\n", new, s, operandp->X_op); -#endif - - return new; -} -#endif /* Instruction parsing. Takes a string containing the opcode. Operands are at input_line_pointer. Output is in the_insn. Warnings or errors are generated. */ -#ifdef BFD_ASSEMBLER static void machine_ip (char *str) { @@ -619,214 +529,6 @@ machine_ip (char *str) } } -#else - -static void -machine_ip (char *str) -{ - char *s; - const char *args; - const struct machine_opcode *insn; - char *argsStart; - unsigned long opcode; - expressionS the_operand; - expressionS *operand = &the_operand; - unsigned int regno; - int reloc = NO_RELOC; - -#if DEBUG - printf ("machine_ip(%s)\n", str); -#endif - - s = str; - for (; ISALNUM (*s) || *s == '.'; ++s) - if (ISUPPER (*s)) - *s = TOLOWER (*s); - - switch (*s) - { - case '\0': - break; - - case ' ': /* FIXME-SOMEDAY more whitespace. */ - *s++ = '\0'; - break; - - default: - as_bad (_("unknown opcode1: `%s'"), str); - return; - } - - if ((insn = (struct machine_opcode *) hash_find (op_hash, str)) == NULL) - { - as_bad (_("unknown opcode2 `%s'."), str); - return; - } - - argsStart = s; - opcode = 0; - memset (&the_insn, '\0', sizeof (the_insn)); - the_insn.reloc = NO_RELOC; - - reloc = NO_RELOC; - - /* Build the opcode, checking as we go to make sure that the - operands match. - - If an operand matches, we modify the_insn or opcode appropriately, - and do a "continue". If an operand fails to match, we "break". */ - if (insn->args[0] != '\0') - /* Prime the pump. */ - s = parse_operand (s, operand, - insn->args[0] == 'I' - || strcmp (insn->name, "l.nop") == 0); - - for (args = insn->args;; ++args) - { -#if DEBUG - printf (" args = %s\n", args); -#endif - switch (*args) - { - case '\0': /* End of args. */ - /* We have have 0 args, do the bazoooka! */ - if (args == insn->args) - encode (insn, &opcode, 0, 0); - - if (*s == '\0') - { - /* We are truly done. */ - the_insn.opcode = opcode; - if (check_invalid_opcode (opcode)) - as_bad (_("instruction not allowed: %s"), str); - return; - } - as_bad (_("too many operands: %s"), s); - break; - - case ',': /* Must match a comma. */ - if (*s++ == ',') - { - reloc = NO_RELOC; - - /* Parse next operand. */ - s = parse_operand (s, operand, args[1] == 'I'); -#if DEBUG - printf (" ',' case: operand->X_add_number = %d, *args = %s, *s = %s\n", - operand->X_add_number, args, s); -#endif - continue; - } - break; - - case '(': /* Must match a (. */ - s = parse_operand (s, operand, args[1] == 'I'); - continue; - - case ')': /* Must match a ). */ - continue; - - case 'r': /* A general register. */ - args++; - - if (operand->X_op != O_register) - break; /* Only registers. */ - - know (operand->X_add_symbol == 0); - know (operand->X_op_symbol == 0); - regno = operand->X_add_number; - encode (insn, &opcode, regno, *args); -#if DEBUG - printf (" r: operand->X_op = %d\n", operand->X_op); -#endif - continue; - - default: - /* if (! ISALPHA (*args)) - break; */ /* Only immediate values. */ - - if (mask_or_shift) - { -#if DEBUG - printf ("mask_or_shift = %d\n", mask_or_shift); -#endif - reloc = mask_or_shift; - } - mask_or_shift = 0; - - if (strncasecmp (args, "LO(", 3) == 0) - { -#if DEBUG - printf ("reloc_const\n"); -#endif - reloc = RELOC_CONST; - } - else if (strncasecmp (args, "HI(", 3) == 0) - { -#if DEBUG - printf ("reloc_consth\n"); -#endif - reloc = RELOC_CONSTH; - } - - if (*s == '(') - operand->X_op = O_constant; - else if (*s == ')') - s += 1; -#if DEBUG - printf (" default case: operand->X_add_number = %d, *args = %s, *s = %s\n", - operand->X_add_number, args, s); -#endif - if (operand->X_op == O_constant) - { - if (reloc == NO_RELOC) - { - unsigned long v, mask; - - mask = 0x3ffffff; - v = abs (operand->X_add_number) & ~ mask; - if (v) - as_bad (_("call/jmp target out of range (1)")); - } - - if (reloc == RELOC_CONSTH) - operand->X_add_number = ((operand->X_add_number>>16) & 0xffff); - - the_insn.pcrel = 0; - encode (insn, &opcode, operand->X_add_number, *args); - /* the_insn.reloc = NO_RELOC; */ - continue; - } - - if (reloc == NO_RELOC) - the_insn.reloc = RELOC_JUMPTARG; - else - the_insn.reloc = reloc; -#if DEBUG - printf (" reloc sym=%d\n", the_insn.reloc); - printf (" NO_RELOC=%d\n", NO_RELOC); -#endif - the_insn.exp = *operand; - - /* the_insn.reloc_offset = 1; */ - the_insn.pcrel = 1; /* Assume PC-relative jump. */ - - /* FIXME-SOON, Do we figure out whether abs later, after - know sym val? */ - if (reloc == RELOC_CONST || reloc == RELOC_CONSTH) - the_insn.pcrel = 0; - - encode (insn, &opcode, operand->X_add_number, *args); - continue; - } - - /* Types or values of args don't match. */ - as_bad (_("invalid operands")); - return; - } -} -#endif - /* This is identical to the md_atof in m68k.c. I think this is right, but I'm not sure. @@ -900,7 +602,6 @@ md_number_to_chars (char *buf, valueT val, int n) number_to_chars_bigendian (buf, val, n); } -#ifdef BFD_ASSEMBLER void md_apply_fix (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) { @@ -996,153 +697,6 @@ md_apply_fix (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_addsy == (symbolS *) NULL) fixP->fx_done = 1; } -#else -void -md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) -{ - long val = *valP; - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - -#if DEBUG - printf ("md_apply_fix val:%x\n", val); -#endif - - fixP->fx_addnumber = val; /* Remember value for emit_reloc. */ - - know (fixP->fx_size == 4); - know (fixP->fx_r_type < NO_RELOC); - - /* This is a hack. There should be a better way to handle this. */ - if (fixP->fx_r_type == RELOC_WDISP30 && fixP->fx_addsy) - val += fixP->fx_where + fixP->fx_frag->fr_address; - - switch (fixP->fx_r_type) - { - case RELOC_32: - buf[0] = val >> 24; - buf[1] = val >> 16; - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_8: - buf[0] = val; - break; - - case RELOC_WDISP30: - val = (val >> 2) + 1; - buf[0] |= (val >> 24) & 0x3f; - buf[1] = (val >> 16); - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_HI22: - buf[1] |= (val >> 26) & 0x3f; - buf[2] = val >> 18; - buf[3] = val >> 10; - break; - - case RELOC_LO10: - buf[2] |= (val >> 8) & 0x03; - buf[3] = val; - break; - - case RELOC_BASE13: - buf[2] |= (val >> 8) & 0x1f; - buf[3] = val; - break; - - case RELOC_WDISP22: - val = (val >> 2) + 1; - /* FALLTHROUGH */ - case RELOC_BASE22: - buf[1] |= (val >> 16) & 0x3f; - buf[2] = val >> 8; - buf[3] = val; - break; - - case RELOC_JUMPTARG: /* 0000XXXX pattern in a word. */ - if (!fixP->fx_done) - { - /* The linker tries to support both AMD and old GNU style - R_IREL relocs. That means that if the addend is exactly - the negative of the address within the section, the - linker will not handle it correctly. */ - } - else if (fixP->fx_pcrel) - { - long v = val >> 28; - if (v != 0 && v != -1) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("call/jmp target out of range (2)")); - } - else - /* This case was supposed to be handled in machine_ip. */ - abort (); - - buf[0] |= (val >> 26) & 0x03; /* Holds bits 0FFFFFFC of address. */ - buf[1] = val >> 18; - buf[2] = val >> 10; - buf[3] = val >> 2; - break; - - case RELOC_CONST: /* 0000XXXX pattern in a word. */ -#if DEBUG - printf ("reloc_const: val=%x\n", val); -#endif - buf[2] = val >> 8; /* Holds bits 0000XXXX. */ - buf[3] = val; - break; - - case RELOC_CONSTH: /* 0000XXXX pattern in a word. */ -#if DEBUG - printf ("reloc_consth: val=%x\n", val); -#endif - buf[2] = val >> 24; /* Holds bits XXXX0000. */ - buf[3] = val >> 16; - break; - - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: - fixP->fx_done = 0; - break; - - case NO_RELOC: - default: - as_bad (_("bad relocation type: 0x%02x"), fixP->fx_r_type); - break; - } - - if (fixP->fx_addsy == (symbolS *) NULL) - fixP->fx_done = 1; -} -#endif - -#ifdef OBJ_COFF -short -tc_coff_fix2rtype (fixS *fixP) -{ -#if DEBUG - printf ("tc_coff_fix2rtype\n"); -#endif - - switch (fixP->fx_r_type) - { - case RELOC_32: return R_WORD; - case RELOC_8: return R_BYTE; - case RELOC_CONST: return R_ILOHALF; - case RELOC_CONSTH: return R_IHIHALF; - case RELOC_JUMPTARG: return R_IREL; - default: - printf ("need %d\n", fixP->fx_r_type); - abort (); - } - - return 0; -} - -#endif /* OBJ_COFF */ /* Should never be called for or32. */ @@ -1158,16 +712,6 @@ md_create_short_jump (char * ptr ATTRIBUTE_UNUSED, /* Should never be called for or32. */ -#ifndef BFD_ASSEMBLER -void -md_convert_frag (object_headers * headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - register fragS * fragP ATTRIBUTE_UNUSED) -{ - as_fatal ("or32_convert_frag\n"); -} - -#else void md_convert_frag (bfd * headers ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED, @@ -1175,7 +719,6 @@ md_convert_frag (bfd * headers ATTRIBUTE_UNUSED, { as_fatal ("or32_convert_frag\n"); } -#endif /* Should never be called for or32. */ @@ -1307,34 +850,6 @@ or32_unrecognized_line (int c) symbolS * md_undefined_symbol (char *name ATTRIBUTE_UNUSED) { -#ifndef BFD_ASSEMBLER - long regnum; - char testbuf[5 + /*SLOP*/ 5]; - -#if DEBUG - printf ("md_undefined_symbol(%s)\n", name); -#endif - - /* Register name. */ - if (name[0] == 'r' || name[0] == 'R' || name[0] == 'a' || name[0] == 'b') - { - /* Parse the number, make sure it has no extra zeroes or - trailing chars. */ - regnum = atol (& name[1]); - - if (regnum > 31) - as_fatal (_("register out of range")); - - sprintf (testbuf, "%ld", regnum); - - if (strcmp (testbuf, &name[1]) != 0) - return NULL; /* gr007 or lr7foo or whatever. */ - - /* We have a wiener! Define and return a new symbol for it. */ - return (symbol_new (name, SEG_REGISTER, (valueT) regnum, - &zero_address_frag)); - } -#endif return NULL; } @@ -1486,7 +1001,6 @@ md_pcrel_from (fixS *fixP) /* Generate a reloc for a fixup. */ -#ifdef BFD_ASSEMBLER arelent * tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { @@ -1513,4 +1027,3 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) reloc->addend = fixp->fx_addnumber; return reloc; } -#endif diff --git a/gas/config/tc-or32.h b/gas/config/tc-or32.h index d2bac3e..b17482d 100644 --- a/gas/config/tc-or32.h +++ b/gas/config/tc-or32.h @@ -40,14 +40,8 @@ extern int or32_unrecognized_line (int); -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_headers_hook(a) ; /* Not used. */ -#define tc_crawl_symbol_chain(a) ; /* Not used. */ #define tc_coff_symbol_emit_hook(a) ; /* Not used. */ -#define AOUT_MACHTYPE 80 -#define TC_COFF_FIX2RTYPE(fix_ptr) tc_coff_fix2rtype (fix_ptr) -#define BFD_ARCH bfd_arch_or32 #define COFF_MAGIC SIPFBOMAGIC /* No shared lib support, so we don't need to ensure externally @@ -59,13 +53,4 @@ extern int or32_unrecognized_line (int); #define MD_APPLY_SYM_VALUE(FIX) 0 #endif -/* Should the reloc be output ? - on the 29k, this is true only if there is a symbol attached. - on the h8, this is always true, since no fixup is done. */ -#define TC_COUNT_RELOC(x) (x->fx_addsy) -#define TC_CONS_RELOC RELOC_32 - -#define COFF_FLAGS F_AR32W -#define NEED_FX_R_TYPE - #define ZERO_BASED_SEGMENTS diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index b0c136c..cea7f21 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -5532,11 +5532,11 @@ md_apply_fix (fixP, valP, seg) fixP->fx_done = 1; #else /* FIXME FIXME FIXME: The value we are passed in *valP includes - the symbol values. Since we are using BFD_ASSEMBLER, if we are - doing this relocation the code in write.c is going to call - bfd_install_relocation, which is also going to use the symbol - value. That means that if the reloc is fully resolved we want to - use *valP since bfd_install_relocation is not being used. + the symbol values. If we are doing this relocation the code in + write.c is going to call bfd_install_relocation, which is also + going to use the symbol value. That means that if the reloc is + fully resolved we want to use *valP since bfd_install_relocation is + not being used. However, if the reloc is not fully resolved we do not want to use *valP, and must use fx_offset instead. However, if the reloc is PC relative, we do want to use *valP since it includes the diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 0e85bba..7b6126a 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -29,10 +29,6 @@ struct fix; #define TARGET_BYTES_BIG_ENDIAN 1 #endif -#ifndef BFD_ASSEMBLER - #error PowerPC support requires BFD_ASSEMBLER -#endif - /* If OBJ_COFF is defined, and TE_PE is not defined, we are assembling XCOFF for AIX or PowerMac. If TE_PE is defined, we are assembling COFF for Windows NT. */ diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index 8a22e53..dbecfef 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -1,5 +1,6 @@ /* tc-s390.h -- Header file for tc-s390.c. - Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of GAS, the GNU Assembler. @@ -23,10 +24,6 @@ struct fix; -#ifndef BFD_ASSEMBLER - #error S390 support requires BFD_ASSEMBLER -#endif - #define TC_FORCE_RELOCATION(FIX) tc_s390_force_relocation(FIX) extern int tc_s390_force_relocation PARAMS ((struct fix *)); diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index b8248a1..27ccdee 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -124,8 +124,6 @@ const pseudo_typeS md_pseudo_table[] = {0, 0, 0} }; -/*int md_reloc_size; */ - int sh_relax; /* set if -relax seen */ /* Whether -small was seen. */ @@ -2871,9 +2869,7 @@ md_assemble (char *str) } } -#ifdef BFD_ASSEMBLER dwarf2_emit_insn (size); -#endif } /* This routine is called each time a label definition is seen. It @@ -2922,24 +2918,6 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED) return 0; } -#ifdef OBJ_COFF -#ifndef BFD_ASSEMBLER - -void -tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_crawl_symbol_chain \n")); -} - -void -tc_headers_hook (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_headers_hook \n")); -} - -#endif -#endif - /* Various routines to kill one day. */ /* Equal to MAX_PRECISION in atof-ieee.c. */ #define MAX_LITTLENUMS 6 @@ -3245,8 +3223,7 @@ struct sh_count_relocs }; /* Count the number of fixups in a section which refer to a particular - symbol. When using BFD_ASSEMBLER, this is called via - bfd_map_over_sections. */ + symbol. This is called via bfd_map_over_sections. */ static void sh_count_relocs (bfd *abfd ATTRIBUTE_UNUSED, segT sec, void *data) @@ -3271,8 +3248,8 @@ sh_count_relocs (bfd *abfd ATTRIBUTE_UNUSED, segT sec, void *data) } } -/* Handle the count relocs for a particular section. When using - BFD_ASSEMBLER, this is called via bfd_map_over_sections. */ +/* Handle the count relocs for a particular section. + This is called via bfd_map_over_sections. */ static void sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec, @@ -3302,9 +3279,6 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec, || fix->fx_subsy != NULL || fix->fx_addnumber != 0 || S_GET_SEGMENT (sym) != sec -#if ! defined (BFD_ASSEMBLER) && defined (OBJ_COFF) - || S_GET_STORAGE_CLASS (sym) == C_EXT -#endif || S_IS_EXTERNAL (sym)) { as_warn_where (fix->fx_file, fix->fx_line, @@ -3344,9 +3318,6 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec, || fscan->fx_subsy != NULL || fscan->fx_addnumber != 0 || S_GET_SEGMENT (sym) != sec -#if ! defined (BFD_ASSEMBLER) && defined (OBJ_COFF) - || S_GET_STORAGE_CLASS (sym) == C_EXT -#endif || S_IS_EXTERNAL (sym)) { as_warn_where (fix->fx_file, fix->fx_line, @@ -3358,16 +3329,7 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec, counting the number of times we find a reference to sym. */ info.sym = sym; info.count = 0; -#ifdef BFD_ASSEMBLER bfd_map_over_sections (stdoutput, sh_count_relocs, &info); -#else - { - int iscan; - - for (iscan = SEG_E0; iscan < SEG_UNKNOWN; iscan++) - sh_count_relocs ((bfd *) NULL, iscan, &info); - } -#endif if (info.count < 1) abort (); @@ -3402,28 +3364,14 @@ sh_frob_file (void) if (! sh_relax) return; -#ifdef BFD_ASSEMBLER bfd_map_over_sections (stdoutput, sh_frob_section, NULL); -#else - { - int iseg; - - for (iseg = SEG_E0; iseg < SEG_UNKNOWN; iseg++) - sh_frob_section ((bfd *) NULL, iseg, NULL); - } -#endif } /* Called after relaxing. Set the correct sizes of the fragments, and create relocs so that md_apply_fix will fill in the correct values. */ void -#ifdef BFD_ASSEMBLER md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, segT seg, fragS *fragP) -#else -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg, - fragS *fragP) -#endif { int donerelax = 0; @@ -3496,12 +3444,7 @@ md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg, /* Build a relocation to six / four bytes farther on. */ subseg_change (seg, 0); - fix_new (fragP, fragP->fr_fix, 2, -#ifdef BFD_ASSEMBLER - section_symbol (seg), -#else - seg_info (seg)->dot, -#endif + fix_new (fragP, fragP->fr_fix, 2, section_symbol (seg), fragP->fr_address + fragP->fr_fix + (delay ? 4 : 6), 1, BFD_RELOC_SH_PCDISP8BY2); @@ -3568,17 +3511,12 @@ md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg, valueT md_section_align (segT seg ATTRIBUTE_UNUSED, valueT size) { -#ifdef BFD_ASSEMBLER #ifdef OBJ_ELF return size; #else /* ! OBJ_ELF */ return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1) & (-1 << bfd_get_section_alignment (stdoutput, seg))); #endif /* ! OBJ_ELF */ -#else /* ! BFD_ASSEMBLER */ - return ((size + (1 << section_alignment[(int) seg]) - 1) - & (-1 << section_alignment[(int) seg])); -#endif /* ! BFD_ASSEMBLER */ } /* This static variable is set by s_uacons to tell sh_cons_align that @@ -3803,7 +3741,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) long max, min; int shift; -#ifdef BFD_ASSEMBLER /* A difference between two symbols, the second of which is in the current section, is transformed in a PC-relative relocation to the other symbol. We have to adjust the relocation type here. */ @@ -3849,24 +3786,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) && fixP->fx_addsy != NULL && S_IS_WEAK (fixP->fx_addsy)) val -= S_GET_VALUE (fixP->fx_addsy); -#endif -#ifdef BFD_ASSEMBLER if (SWITCH_TABLE (fixP)) val -= S_GET_VALUE (fixP->fx_subsy); -#else - if (fixP->fx_r_type == 0) - { - if (fixP->fx_size == 2) - fixP->fx_r_type = BFD_RELOC_16; - else if (fixP->fx_size == 4) - fixP->fx_r_type = BFD_RELOC_32; - else if (fixP->fx_size == 1) - fixP->fx_r_type = BFD_RELOC_8; - else - abort (); - } -#endif max = min = 0; shift = 0; @@ -4207,8 +4129,7 @@ md_number_to_chars (char *ptr, valueT use, int nbytes) number_to_chars_bigendian (ptr, use, nbytes); } -/* This version is used in obj-coff.c when not using BFD_ASSEMBLER. - eg for the sh-hms target. */ +/* This version is used in obj-coff.c eg. for the sh-hms target. */ long md_pcrel_from (fixS *fixP) @@ -4234,167 +4155,6 @@ md_pcrel_from_section (fixS *fixP, segT sec) return md_pcrel_from (fixP); } -#ifdef OBJ_COFF - -int -tc_coff_sizemachdep (fragS *frag) -{ - return md_relax_table[frag->fr_subtype].rlx_length; -} - -#endif /* OBJ_COFF */ - -#ifndef BFD_ASSEMBLER -#ifdef OBJ_COFF - -/* Map BFD relocs to SH COFF relocs. */ - -struct reloc_map -{ - bfd_reloc_code_real_type bfd_reloc; - int sh_reloc; -}; - -static const struct reloc_map coff_reloc_map[] = -{ - { BFD_RELOC_32, R_SH_IMM32 }, - { BFD_RELOC_16, R_SH_IMM16 }, - { BFD_RELOC_8, R_SH_IMM8 }, - { BFD_RELOC_SH_PCDISP8BY2, R_SH_PCDISP8BY2 }, - { BFD_RELOC_SH_PCDISP12BY2, R_SH_PCDISP }, - { BFD_RELOC_SH_IMM4, R_SH_IMM4 }, - { BFD_RELOC_SH_IMM4BY2, R_SH_IMM4BY2 }, - { BFD_RELOC_SH_IMM4BY4, R_SH_IMM4BY4 }, - { BFD_RELOC_SH_IMM8, R_SH_IMM8 }, - { BFD_RELOC_SH_IMM8BY2, R_SH_IMM8BY2 }, - { BFD_RELOC_SH_IMM8BY4, R_SH_IMM8BY4 }, - { BFD_RELOC_SH_PCRELIMM8BY2, R_SH_PCRELIMM8BY2 }, - { BFD_RELOC_SH_PCRELIMM8BY4, R_SH_PCRELIMM8BY4 }, - { BFD_RELOC_8_PCREL, R_SH_SWITCH8 }, - { BFD_RELOC_SH_SWITCH16, R_SH_SWITCH16 }, - { BFD_RELOC_SH_SWITCH32, R_SH_SWITCH32 }, - { BFD_RELOC_SH_USES, R_SH_USES }, - { BFD_RELOC_SH_COUNT, R_SH_COUNT }, - { BFD_RELOC_SH_ALIGN, R_SH_ALIGN }, - { BFD_RELOC_SH_CODE, R_SH_CODE }, - { BFD_RELOC_SH_DATA, R_SH_DATA }, - { BFD_RELOC_SH_LABEL, R_SH_LABEL }, - { BFD_RELOC_UNUSED, 0 } -}; - -/* Adjust a reloc for the SH. This is similar to the generic code, - but does some minor tweaking. */ - -void -sh_coff_reloc_mangle (segment_info_type *seg, fixS *fix, - struct internal_reloc *intr, unsigned int paddr) -{ - symbolS *symbol_ptr = fix->fx_addsy; - symbolS *dot; - - intr->r_vaddr = paddr + fix->fx_frag->fr_address + fix->fx_where; - - if (! SWITCH_TABLE (fix)) - { - const struct reloc_map *rm; - - for (rm = coff_reloc_map; rm->bfd_reloc != BFD_RELOC_UNUSED; rm++) - if (rm->bfd_reloc == (bfd_reloc_code_real_type) fix->fx_r_type) - break; - if (rm->bfd_reloc == BFD_RELOC_UNUSED) - as_bad_where (fix->fx_file, fix->fx_line, - _("Can not represent %s relocation in this object file format"), - bfd_get_reloc_code_name (fix->fx_r_type)); - intr->r_type = rm->sh_reloc; - intr->r_offset = 0; - } - else - { - know (sh_relax); - - if (fix->fx_r_type == BFD_RELOC_16) - intr->r_type = R_SH_SWITCH16; - else if (fix->fx_r_type == BFD_RELOC_8) - intr->r_type = R_SH_SWITCH8; - else if (fix->fx_r_type == BFD_RELOC_32) - intr->r_type = R_SH_SWITCH32; - else - abort (); - - /* For a switch reloc, we set r_offset to the difference between - the reloc address and the subtrahend. When the linker is - doing relaxing, it can use the determine the starting and - ending points of the switch difference expression. */ - intr->r_offset = intr->r_vaddr - S_GET_VALUE (fix->fx_subsy); - } - - /* PC relative relocs are always against the current section. */ - if (symbol_ptr == NULL) - { - switch (fix->fx_r_type) - { - case BFD_RELOC_SH_PCRELIMM8BY2: - case BFD_RELOC_SH_PCRELIMM8BY4: - case BFD_RELOC_SH_PCDISP8BY2: - case BFD_RELOC_SH_PCDISP12BY2: - case BFD_RELOC_SH_USES: - symbol_ptr = seg->dot; - break; - default: - break; - } - } - - if (fix->fx_r_type == BFD_RELOC_SH_USES) - { - /* We can't store the offset in the object file, since this - reloc does not take up any space, so we store it in r_offset. - The fx_addnumber field was set in md_apply_fix. */ - intr->r_offset = fix->fx_addnumber; - } - else if (fix->fx_r_type == BFD_RELOC_SH_COUNT) - { - /* We can't store the count in the object file, since this reloc - does not take up any space, so we store it in r_offset. The - fx_offset field was set when the fixup was created in - sh_coff_frob_file. */ - intr->r_offset = fix->fx_offset; - /* This reloc is always absolute. */ - symbol_ptr = NULL; - } - else if (fix->fx_r_type == BFD_RELOC_SH_ALIGN) - { - /* Store the alignment in the r_offset field. */ - intr->r_offset = fix->fx_offset; - /* This reloc is always absolute. */ - symbol_ptr = NULL; - } - else if (fix->fx_r_type == BFD_RELOC_SH_CODE - || fix->fx_r_type == BFD_RELOC_SH_DATA - || fix->fx_r_type == BFD_RELOC_SH_LABEL) - { - /* These relocs are always absolute. */ - symbol_ptr = NULL; - } - - /* Turn the segment of the symbol into an offset. */ - if (symbol_ptr != NULL) - { - dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot; - if (dot != NULL) - intr->r_symndx = dot->sy_number; - else - intr->r_symndx = symbol_ptr->sy_number; - } - else - intr->r_symndx = -1; -} - -#endif /* OBJ_COFF */ -#endif /* ! BFD_ASSEMBLER */ - -#ifdef BFD_ASSEMBLER - /* Create a reloc. */ arelent * @@ -4610,4 +4370,3 @@ sh_regname_to_dw2regnum (const char *regname) return regnum; } #endif /* OBJ_ELF */ -#endif /* BFD_ASSEMBLER */ diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h index 4143aef..c533a87 100644 --- a/gas/config/tc-sh.h +++ b/gas/config/tc-sh.h @@ -1,6 +1,6 @@ /* This file is tc-sh.h Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -60,16 +60,6 @@ extern int sh_force_relocation (struct fix *); to know about all such entries so that it can adjust them if necessary. */ -#ifdef BFD_ASSEMBLER -#define SWITCH_TABLE_CONS(FIX) (0) -#else -#define SWITCH_TABLE_CONS(FIX) \ - ((FIX)->fx_r_type == 0 \ - && ((FIX)->fx_size == 2 \ - || (FIX)->fx_size == 1 \ - || (FIX)->fx_size == 4)) -#endif - #define SWITCH_TABLE(FIX) \ ((FIX)->fx_addsy != NULL \ && (FIX)->fx_subsy != NULL \ @@ -77,8 +67,7 @@ extern int sh_force_relocation (struct fix *); && S_GET_SEGMENT ((FIX)->fx_subsy) == text_section \ && ((FIX)->fx_r_type == BFD_RELOC_32 \ || (FIX)->fx_r_type == BFD_RELOC_16 \ - || (FIX)->fx_r_type == BFD_RELOC_8 \ - || SWITCH_TABLE_CONS (FIX))) + || (FIX)->fx_r_type == BFD_RELOC_8)) #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \ (! SEG_NORMAL (SEC) \ @@ -122,27 +111,15 @@ extern void sh_frob_label (void); extern void sh_flush_pending_output (void); #define md_flush_pending_output() sh_flush_pending_output () -#ifdef BFD_ASSEMBLER #define tc_frob_file_before_adjust sh_frob_file -#else -#define tc_frob_file sh_frob_file -#endif extern void sh_frob_file (void); #ifdef OBJ_COFF /* COFF specific definitions. */ -/* This macro translates between an internal fix and a coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fix) ((fix)->fx_r_type) - -#define BFD_ARCH TARGET_ARCH - #define COFF_MAGIC (!target_big_endian ? SH_ARCH_MAGIC_LITTLE : SH_ARCH_MAGIC_BIG) -/* We need to write out relocs which have not been completed. */ -#define TC_COUNT_RELOC(fix) ((fix)->fx_addsy != NULL) - #define TC_RELOC_MANGLE(seg, fix, int, paddr) \ sh_coff_reloc_mangle ((seg), (fix), (int), (paddr)) extern void sh_coff_reloc_mangle @@ -151,18 +128,9 @@ extern void sh_coff_reloc_mangle #define tc_coff_symbol_emit_hook(a) ; /* not used */ -#define NEED_FX_R_TYPE 1 - #define TC_KEEP_FX_OFFSET 1 -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) -extern int tc_coff_sizemachdep (fragS *); - -#ifdef BFD_ASSEMBLER #define SEG_NAME(SEG) segment_name (SEG) -#else -#define SEG_NAME(SEG) obj_segment_name (SEG) -#endif /* We align most sections to a 16 byte boundary. */ #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 60b5dae..1f2b2f9 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -174,9 +174,6 @@ const pseudo_typeS md_pseudo_table[] = {NULL, 0, 0}, }; -/* Size of relocation record. */ -const int md_reloc_size = 12; - /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ const char comment_chars[] = "!"; /* JF removed '|' from @@ -3961,9 +3958,7 @@ s_common (ignore) goto allocate_common; } -#ifdef BFD_ASSEMBLER symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; -#endif demand_empty_rest_of_line (); return; diff --git a/gas/config/tc-tahoe.c b/gas/config/tc-tahoe.c deleted file mode 100644 index 6bef4be..0000000 --- a/gas/config/tc-tahoe.c +++ /dev/null @@ -1,1892 +0,0 @@ -/* This file is tc-tahoe.c - - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 2000, 2001, 2002, - 2003, 2004, 2005 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "as.h" -#include "safe-ctype.h" -#include "obstack.h" - -/* This bit glommed from tahoe-inst.h. */ - -typedef unsigned char byte; -typedef byte tahoe_opcodeT; - -/* This is part of tahoe-ins-parse.c & friends. - We want to parse a tahoe instruction text into a tree defined here. */ - -#define TIT_MAX_OPERANDS 4 /* Maximum number of operands in one - single tahoe instruction. */ - -struct top /* Tahoe instruction operand. */ - { - int top_ndx; /* -1, or index register. eg 7=[R7]. */ - int top_reg; /* -1, or register number. eg 7 = R7 or (R7). */ - byte top_mode; /* Addressing mode byte. This byte, defines - which of the 11 modes opcode is. */ - - char top_access; /* Access type wanted for this operand - 'b'branch ' 'no-instruction 'amrvw'. */ - char top_width; /* Operand width expected, one of "bwlq?-:!". */ - - char * top_error; /* Say if operand is inappropriate. */ - - segT seg_of_operand; /* Segment as returned by expression(). */ - - expressionS exp_of_operand; /* The expression as parsed by expression(). */ - - byte top_dispsize; /* Number of bytes in the displacement if we - can figure it out. */ - }; - -/* The addressing modes for an operand. These numbers are the actual values - for certain modes, so be careful if you screw with them. */ -#define TAHOE_DIRECT_REG 0x50 -#define TAHOE_REG_DEFERRED 0x60 - -#define TAHOE_REG_DISP 0xE0 -#define TAHOE_REG_DISP_DEFERRED 0xF0 - -#define TAHOE_IMMEDIATE 0x8F -#define TAHOE_IMMEDIATE_BYTE 0x88 -#define TAHOE_IMMEDIATE_WORD 0x89 -#define TAHOE_IMMEDIATE_LONGWORD 0x8F -#define TAHOE_ABSOLUTE_ADDR 0x9F - -#define TAHOE_DISPLACED_RELATIVE 0xEF -#define TAHOE_DISP_REL_DEFERRED 0xFF - -#define TAHOE_AUTO_DEC 0x7E -#define TAHOE_AUTO_INC 0x8E -#define TAHOE_AUTO_INC_DEFERRED 0x9E -/* INDEXED_REG is decided by the existence or lack of a [reg]. */ - -/* These are encoded into top_width when top_access=='b' - and it's a psuedo op. */ -#define TAHOE_WIDTH_ALWAYS_JUMP '-' -#define TAHOE_WIDTH_CONDITIONAL_JUMP '?' -#define TAHOE_WIDTH_BIG_REV_JUMP '!' -#define TAHOE_WIDTH_BIG_NON_REV_JUMP ':' - -/* The hex code for certain tahoe commands and modes. - This is just for readability. */ -#define TAHOE_JMP 0x71 -#define TAHOE_PC_REL_LONG 0xEF -#define TAHOE_BRB 0x11 -#define TAHOE_BRW 0x13 -/* These, when 'ored' with, or added to, a register number, - set up the number for the displacement mode. */ -#define TAHOE_PC_OR_BYTE 0xA0 -#define TAHOE_PC_OR_WORD 0xC0 -#define TAHOE_PC_OR_LONG 0xE0 - -struct tit /* Get it out of the sewer, it stands for - tahoe instruction tree (Geeze!). */ -{ - tahoe_opcodeT tit_opcode; /* The opcode. */ - byte tit_operands; /* How many operands are here. */ - struct top tit_operand[TIT_MAX_OPERANDS]; /* Operands. */ - char *tit_error; /* "" or fatal error text. */ -}; - -/* end: tahoe-inst.h */ - -/* tahoe.c - tahoe-specific - - Not part of gas yet. */ - -#include "opcode/tahoe.h" - -/* This is the number to put at the beginning of the a.out file. */ -long omagic = OMAGIC; - -/* These chars start a comment anywhere in a source file (except inside - another comment or a quoted string. */ -const char comment_chars[] = "#;"; - -/* These chars only start a comment at the beginning of a line. */ -const char line_comment_chars[] = "#"; - -/* Chars that can be used to separate mant from exp in floating point nums. */ -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant - as in 0f123.456 - or 0d1.234E-12 (see exp chars above) - Note: The Tahoe port doesn't support floating point constants. This is - consistent with 'as' If it's needed, I can always add it later. */ -const char FLT_CHARS[] = "df"; - -/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be - changed in read.c . Ideally it shouldn't have to know about it at all, - but nothing is ideal around here. - (The tahoe has plenty of room, so the change currently isn't needed.) */ - -static struct tit t; /* A tahoe instruction after decoding. */ - -void float_cons (); -/* A table of pseudo ops (sans .), the function called, and an integer op - that the function is called with. */ - -const pseudo_typeS md_pseudo_table[] = -{ - {"dfloat", float_cons, 'd'}, - {"ffloat", float_cons, 'f'}, - {0} -}; - -/* For Tahoe, relative addresses of "just the right length" are pretty easy. - The branch displacement is always the last operand, even in - synthetic instructions. - For Tahoe, we encode the relax_substateTs (in e.g. fr_substate) as: - - 4 3 2 1 0 bit number - ---/ /--+-------+-------+-------+-------+-------+ - | what state ? | how long ? | - ---/ /--+-------+-------+-------+-------+-------+ - - The "how long" bits are 00=byte, 01=word, 10=long. - This is a Un*x convention. - Not all lengths are legit for a given value of (what state). - The four states are listed below. - The "how long" refers merely to the displacement length. - The address usually has some constant bytes in it as well. - - States for Tahoe address relaxing. - 1. TAHOE_WIDTH_ALWAYS_JUMP (-) - Format: "b-" - Tahoe opcodes are: (Hex) - jr 11 - jbr 11 - Simple branch. - Always, 1 byte opcode, then displacement/absolute. - If word or longword, change opcode to brw or jmp. - - 2. TAHOE_WIDTH_CONDITIONAL_JUMP (?) - J<cond> where <cond> is a simple flag test. - Format: "b?" - Tahoe opcodes are: (Hex) - jneq/jnequ 21 - jeql/jeqlu 31 - jgtr 41 - jleq 51 - jgeq 81 - jlss 91 - jgtru a1 - jlequ b1 - jvc c1 - jvs d1 - jlssu/jcs e1 - jgequ/jcc f1 - Always, you complement 4th bit to reverse the condition. - Always, 1-byte opcode, then 1-byte displacement. - - 3. TAHOE_WIDTH_BIG_REV_JUMP (!) - Jbc/Jbs where cond tests a memory bit. - Format: "rlvlb!" - Tahoe opcodes are: (Hex) - jbs 0e - jbc 1e - Always, you complement 4th bit to reverse the condition. - Always, 1-byte opcde, longword, longword-address, 1-word-displacement - - 4. TAHOE_WIDTH_BIG_NON_REV_JUMP (:) - JaoblXX/Jbssi - Format: "rlmlb:" - Tahoe opcodes are: (Hex) - aojlss 2f - jaoblss 2f - aojleq 3f - jaobleq 3f - jbssi 5f - Always, we cannot reverse the sense of the branch; we have a word - displacement. - - We need to modify the opcode is for class 1, 2 and 3 instructions. - After relax() we may complement the 4th bit of 2 or 3 to reverse sense of - branch. - - We sometimes store context in the operand literal. This way we can figure out - after relax() what the original addressing mode was. (Was is pc_rel, or - pc_rel_disp? That sort of thing.) */ - -/* These displacements are relative to the START address of the - displacement which is at the start of the displacement, not the end of - the instruction. The hardware pc_rel is at the end of the instructions. - That's why all the displacements have the length of the displacement added - to them. (WF + length(word)) - - The first letter is Byte, Word. - 2nd letter is Forward, Backward. */ -#define BF (1 + 127) -#define BB (1 + -128) -#define WF (2 + 32767) -#define WB (2 + -32768) -/* Dont need LF, LB because they always reach. [They are coded as 0.] */ - -#define C(a,b) ENCODE_RELAX(a, b) -/* This macro has no side-effects. */ -#define ENCODE_RELAX(what,length) (((what) << 2) + (length)) -#define RELAX_STATE(s) ((s) >> 2) -#define RELAX_LENGTH(s) ((s) & 3) - -#define STATE_ALWAYS_BRANCH 1 -#define STATE_CONDITIONAL_BRANCH 2 -#define STATE_BIG_REV_BRANCH 3 -#define STATE_BIG_NON_REV_BRANCH 4 -#define STATE_PC_RELATIVE 5 - -#define STATE_BYTE 0 -#define STATE_WORD 1 -#define STATE_LONG 2 -#define STATE_UNDF 3 /* Symbol undefined in pass1. */ - -/* This is the table used by gas to figure out relaxing modes. The fields are - forward_branch reach, backward_branch reach, number of bytes it would take, - where the next biggest branch is. */ -const relax_typeS md_relax_table[] = -{ - { - 1, 1, 0, 0 - }, /* Error sentinel 0,0 */ - { - 1, 1, 0, 0 - }, /* Unused 0,1 */ - { - 1, 1, 0, 0 - }, /* Unused 0,2 */ - { - 1, 1, 0, 0 - }, /* Unused 0,3 */ -/* Unconditional branch cases "jrb" - The relax part is the actual displacement */ - { - BF, BB, 1, C (1, 1) - }, /* Brb B`foo 1,0 */ - { - WF, WB, 2, C (1, 2) - }, /* Brw W`foo 1,1 */ - { - 0, 0, 5, 0 - }, /* Jmp L`foo 1,2 */ - { - 1, 1, 0, 0 - }, /* Unused 1,3 */ -/* Reversible Conditional Branch. If the branch won't reach, reverse - it, and jump over a brw or a jmp that will reach. The relax part is the - actual address. */ - { - BF, BB, 1, C (2, 1) - }, /* b<cond> B`foo 2,0 */ - { - WF + 2, WB + 2, 4, C (2, 2) - }, /* brev over, brw W`foo, over: 2,1 */ - { - 0, 0, 7, 0 - }, /* brev over, jmp L`foo, over: 2,2 */ - { - 1, 1, 0, 0 - }, /* Unused 2,3 */ -/* Another type of reversible branch. But this only has a word - displacement. */ - { - 1, 1, 0, 0 - }, /* Unused 3,0 */ - { - WF, WB, 2, C (3, 2) - }, /* jbX W`foo 3,1 */ - { - 0, 0, 8, 0 - }, /* jrevX over, jmp L`foo, over: 3,2 */ - { - 1, 1, 0, 0 - }, /* Unused 3,3 */ -/* These are the non reversible branches, all of which have a word - displacement. If I can't reach, branch over a byte branch, to a - jump that will reach. The jumped branch jumps over the reaching - branch, to continue with the flow of the program. It's like playing - leap frog. */ - { - 1, 1, 0, 0 - }, /* Unused 4,0 */ - { - WF, WB, 2, C (4, 2) - }, /* aobl_ W`foo 4,1 */ - { - 0, 0, 10, 0 - }, /*aobl_ W`hop,br over,hop: jmp L^foo,over 4,2*/ - { - 1, 1, 0, 0 - }, /* Unused 4,3 */ -/* Normal displacement mode, no jumping or anything like that. - The relax points to one byte before the address, thats why all - the numbers are up by one. */ - { - BF + 1, BB + 1, 2, C (5, 1) - }, /* B^"foo" 5,0 */ - { - WF + 1, WB + 1, 3, C (5, 2) - }, /* W^"foo" 5,1 */ - { - 0, 0, 5, 0 - }, /* L^"foo" 5,2 */ - { - 1, 1, 0, 0 - }, /* Unused 5,3 */ -}; - -#undef C -#undef BF -#undef BB -#undef WF -#undef WB -/* End relax stuff. */ - -/* Handle of the OPCODE hash table. NULL means any use before - md_begin() will crash. */ -static struct hash_control *op_hash; - -/* Init function. Build the hash table. */ - -void -md_begin (void) -{ - struct tot *tP; - char *errorval = 0; - int synthetic_too = 1; /* If 0, just use real opcodes. */ - - op_hash = hash_new (); - - for (tP = totstrs; *tP->name && !errorval; tP++) - errorval = hash_insert (op_hash, tP->name, &tP->detail); - - if (synthetic_too) - for (tP = synthetic_totstrs; *tP->name && !errorval; tP++) - errorval = hash_insert (op_hash, tP->name, &tP->detail); - - if (errorval) - as_fatal (errorval); -} - -const char *md_shortopts = "ad:STt:V"; - -struct option md_longopts[] = -{ - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -int -md_parse_option (int c, char *arg) -{ - switch (c) - { - case 'a': - as_warn (_("The -a option doesn't exist. (Despite what the man page says!")); - break; - - case 'd': - as_warn (_("Displacement length %s ignored!"), arg); - break; - - case 'S': - as_warn (_("SYMBOL TABLE not implemented")); - break; - - case 'T': - as_warn (_("TOKEN TRACE not implemented")); - break; - - case 't': - as_warn (_("I don't need or use temp. file \"%s\"."), arg); - break; - - case 'V': - as_warn (_("I don't use an interpass file! -V ignored")); - break; - - default: - return 0; - } - - return 1; -} - -void -md_show_usage (FILE *stream) -{ - fprintf (stream, _("\ -Tahoe options:\n\ --a ignored\n\ --d LENGTH ignored\n\ --J ignored\n\ --S ignored\n\ --t FILE ignored\n\ --T ignored\n\ --V ignored\n")); -} - -/* The functions in this section take numbers in the machine format, and - munges them into Tahoe byte order. - They exist primarily for cross assembly purpose. - Knows about order of bytes in address. */ - -void -md_number_to_chars (char con[], /* Return 'nbytes' of chars here. */ - valueT value, /* The value of the bits. */ - int nbytes) /* Number of bytes in the output. */ -{ - number_to_chars_bigendian (con, value, nbytes); -} - -void -md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED, - valueT * valP ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED) -{ - /* Should never be called. */ - know (0); -} - -void -md_number_to_disp (char con[]m /* Return 'nbytes' of chars here. */ - long int value, /* The value of the bits. */ - int nbytes) /* Number of bytes in the output. */ -{ - md_number_to_chars (con, value, nbytes); -} - -void -md_number_to_field (char con[], /* Return 'nbytes' of chars here. */ - long int value, /* The value of the bits. */ - int nbytes) /* Number of bytes in the output. */ -{ - md_number_to_chars (con, value, nbytes); -} - -/* Put the bits in an order that a tahoe will understand, despite the ordering - of the native machine. - On Tahoe: first 4 bytes are normal unsigned big endian long, - next three bytes are symbolnum, in kind of 3 byte big endian (least sig. byte last). - The last byte is broken up with bit 7 as pcrel, - bits 6 & 5 as length, - bit 4 as extern and the last nibble as 'undefined'. */ - -void -tc_aout_fix_to_chars (char *where, - fixS *fixP, - relax_addressT segment_address_in_file) -{ - long r_symbolnum; - - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - where[4] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[6] = r_symbolnum & 0x0ff; - where[7] = (((is_pcrel (fixP) << 7) & 0x80) - | ((((fixP->fx_type == FX_8 || fixP->fx_type == FX_PCREL8 - ? 0 - : (fixP->fx_type == FX_16 || fixP->fx_type == FX_PCREL16 - ? 1 - : (fixP->fx_type == FX_32 || fixP->fx_type == FX_PCREL32 - ? 2 - : 42)))) << 5) & 0x60) - | ((!S_IS_DEFINED (fixP->fx_addsy) << 4) & 0x10)); -} - -/* Relocate byte stuff. */ - -/* This is for broken word. */ -int md_short_jump_size = 3; - -void -md_create_short_jump (char *ptr, - addressT from_addr, - addressT to_addr, - fragS *frag, - symbolS *to_symbol) -{ - valueT offset; - - offset = to_addr - (from_addr + 1); - *ptr++ = TAHOE_BRW; - md_number_to_chars (ptr, offset, 2); -} - -int md_long_jump_size = 6; -const int md_reloc_size = 8; /* Size of relocation record. */ - -void -md_create_long_jump (char *ptr, - addressT from_addr, - addressT to_addr, - fragS *frag, - symbolS *to_symbol) -{ - valueT offset; - - offset = to_addr - (from_addr + 4); - *ptr++ = TAHOE_JMP; - *ptr++ = TAHOE_PC_REL_LONG; - md_number_to_chars (ptr, offset, 4); -} - -/* md_estimate_size_before_relax(), called just before relax(). - Any symbol that is now undefined will not become defined. - Return the correct fr_subtype in the frag and the growth beyond - fr_fix. */ - -int -md_estimate_size_before_relax (fragS *fragP, segT segment_type) -{ - if (RELAX_LENGTH (fragP->fr_subtype) == STATE_UNDF) - { - if (S_GET_SEGMENT (fragP->fr_symbol) != segment) - { - /* Non-relaxable cases. */ - char *p; - int old_fr_fix; - - old_fr_fix = fragP->fr_fix; - p = fragP->fr_literal + old_fr_fix; - switch (RELAX_STATE (fragP->fr_subtype)) - { - case STATE_PC_RELATIVE: - *p |= TAHOE_PC_OR_LONG; - /* We now know how big it will be, one long word. */ - fragP->fr_fix += 1 + 4; - fix_new (fragP, old_fr_fix + 1, fragP->fr_symbol, - fragP->fr_offset, FX_PCREL32, NULL); - break; - - case STATE_CONDITIONAL_BRANCH: - *fragP->fr_opcode ^= 0x10; /* Reverse sense of branch. */ - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = TAHOE_PC_REL_LONG; - fragP->fr_fix += 1 + 1 + 1 + 4; - fix_new (fragP, old_fr_fix + 3, fragP->fr_symbol, - fragP->fr_offset, FX_PCREL32, NULL); - break; - - case STATE_BIG_REV_BRANCH: - *fragP->fr_opcode ^= 0x10; /* Reverse sense of branch. */ - *p++ = 0; - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = TAHOE_PC_REL_LONG; - fragP->fr_fix += 2 + 2 + 4; - fix_new (fragP, old_fr_fix + 4, fragP->fr_symbol, - fragP->fr_offset, FX_PCREL32, NULL); - break; - - case STATE_BIG_NON_REV_BRANCH: - *p++ = 2; - *p++ = 0; - *p++ = TAHOE_BRB; - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = TAHOE_PC_REL_LONG; - fragP->fr_fix += 2 + 2 + 2 + 4; - fix_new (fragP, old_fr_fix + 6, fragP->fr_symbol, - fragP->fr_offset, FX_PCREL32, NULL); - break; - - case STATE_ALWAYS_BRANCH: - *fragP->fr_opcode = TAHOE_JMP; - *p++ = TAHOE_PC_REL_LONG; - fragP->fr_fix += 1 + 4; - fix_new (fragP, old_fr_fix + 1, fragP->fr_symbol, - fragP->fr_offset, FX_PCREL32, NULL); - break; - - default: - abort (); - } - frag_wane (fragP); - - /* Return the growth in the fixed part of the frag. */ - return fragP->fr_fix - old_fr_fix; - } - - /* Relaxable cases. Set up the initial guess for the variable - part of the frag. */ - switch (RELAX_STATE (fragP->fr_subtype)) - { - case STATE_PC_RELATIVE: - fragP->fr_subtype = ENCODE_RELAX (STATE_PC_RELATIVE, STATE_BYTE); - break; - case STATE_CONDITIONAL_BRANCH: - fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE); - break; - case STATE_BIG_REV_BRANCH: - fragP->fr_subtype = ENCODE_RELAX (STATE_BIG_REV_BRANCH, STATE_WORD); - break; - case STATE_BIG_NON_REV_BRANCH: - fragP->fr_subtype = ENCODE_RELAX (STATE_BIG_NON_REV_BRANCH, STATE_WORD); - break; - case STATE_ALWAYS_BRANCH: - fragP->fr_subtype = ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_BYTE); - break; - } - } - - if (fragP->fr_subtype >= sizeof (md_relax_table) / sizeof (md_relax_table[0])) - abort (); - - /* Return the size of the variable part of the frag. */ - return md_relax_table[fragP->fr_subtype].rlx_length; -} - -/* Called after relax() is finished. - In: Address of frag. - fr_type == rs_machine_dependent. - fr_subtype is what the address relaxed to. - - Out: Any fixSs and constants are set up. - Caller will turn frag into a ".space 0". */ - -void -md_convert_frag (object_headers *headers, segT seg, fragS *fragP) -{ - char *addressP; /* -> _var to change. */ - char *opcodeP; /* -> opcode char(s) to change. */ - short int extension = 0; /* Size of relaxed address. - Added to fr_fix: incl. ALL var chars. */ - symbolS *symbolP; - long int where; - long int address_of_var; - /* Where, in file space, is _var of *fragP? */ - long int target_address; - /* Where, in file space, does addr point? */ - - know (fragP->fr_type == rs_machine_dependent); - where = fragP->fr_fix; - addressP = fragP->fr_literal + where; - opcodeP = fragP->fr_opcode; - symbolP = fragP->fr_symbol; - know (symbolP); - target_address = S_GET_VALUE (symbolP) + fragP->fr_offset; - address_of_var = fragP->fr_address + where; - - switch (fragP->fr_subtype) - { - case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_BYTE): - /* *addressP holds the registers number, plus 0x10, if it's deferred - mode. To set up the right mode, just OR the size of this displacement. */ - /* Byte displacement. */ - *addressP++ |= TAHOE_PC_OR_BYTE; - *addressP = target_address - (address_of_var + 2); - extension = 2; - break; - - case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_WORD): - /* Word displacement. */ - *addressP++ |= TAHOE_PC_OR_WORD; - md_number_to_chars (addressP, target_address - (address_of_var + 3), 2); - extension = 3; - break; - - case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_LONG): - /* Long word displacement. */ - *addressP++ |= TAHOE_PC_OR_LONG; - md_number_to_chars (addressP, target_address - (address_of_var + 5), 4); - extension = 5; - break; - - case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE): - *addressP = target_address - (address_of_var + 1); - extension = 1; - break; - - case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD): - *opcodeP ^= 0x10; /* Reverse sense of test. */ - *addressP++ = 3; /* Jump over word branch. */ - *addressP++ = TAHOE_BRW; - md_number_to_chars (addressP, target_address - (address_of_var + 4), 2); - extension = 4; - break; - - case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_LONG): - *opcodeP ^= 0x10; /* Reverse sense of test. */ - *addressP++ = 6; - *addressP++ = TAHOE_JMP; - *addressP++ = TAHOE_PC_REL_LONG; - md_number_to_chars (addressP, target_address, 4); - extension = 7; - break; - - case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_BYTE): - *addressP = target_address - (address_of_var + 1); - extension = 1; - break; - - case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_WORD): - *opcodeP = TAHOE_BRW; - md_number_to_chars (addressP, target_address - (address_of_var + 2), 2); - extension = 2; - break; - - case ENCODE_RELAX (STATE_ALWAYS_BRANCH, STATE_LONG): - *opcodeP = TAHOE_JMP; - *addressP++ = TAHOE_PC_REL_LONG; - md_number_to_chars (addressP, target_address - (address_of_var + 5), 4); - extension = 5; - break; - - case ENCODE_RELAX (STATE_BIG_REV_BRANCH, STATE_WORD): - md_number_to_chars (addressP, target_address - (address_of_var + 2), 2); - extension = 2; - break; - - case ENCODE_RELAX (STATE_BIG_REV_BRANCH, STATE_LONG): - *opcodeP ^= 0x10; - *addressP++ = 0; - *addressP++ = 6; - *addressP++ = TAHOE_JMP; - *addressP++ = TAHOE_PC_REL_LONG; - md_number_to_chars (addressP, target_address, 4); - extension = 8; - break; - - case ENCODE_RELAX (STATE_BIG_NON_REV_BRANCH, STATE_WORD): - md_number_to_chars (addressP, target_address - (address_of_var + 2), 2); - extension = 2; - break; - - case ENCODE_RELAX (STATE_BIG_NON_REV_BRANCH, STATE_LONG): - *addressP++ = 0; - *addressP++ = 2; - *addressP++ = TAHOE_BRB; - *addressP++ = 6; - *addressP++ = TAHOE_JMP; - *addressP++ = TAHOE_PC_REL_LONG; - md_number_to_chars (addressP, target_address, 4); - extension = 10; - break; - - default: - BAD_CASE (fragP->fr_subtype); - break; - } - fragP->fr_fix += extension; -} - - -/* This is the stuff for md_assemble. */ -#define FP_REG 13 -#define SP_REG 14 -#define PC_REG 15 -#define BIGGESTREG PC_REG - -/* Parse the string pointed to by START - If it represents a valid register, point START to the character after - the last valid register char, and return the register number (0-15). - If invalid, leave START alone, return -1. - The format has to be exact. I don't do things like eat leading zeros - or the like. - Note: This doesn't check for the next character in the string making - this invalid. Ex: R123 would return 12, it's the callers job to check - what start is point to apon return. - - Valid registers are R1-R15, %1-%15, FP (13), SP (14), PC (15) - Case doesn't matter. */ - -int -tahoe_reg_parse (char **start) /* A pointer to the string to parse. */ -{ - char *regpoint = *start; - int regnum = -1; - - switch (*regpoint++) - { - case '%': /* Registers can start with a %, - R or r, and then a number. */ - case 'R': - case 'r': - if (ISDIGIT (*regpoint)) - { - /* Got the first digit. */ - regnum = *regpoint++ - '0'; - if ((regnum == 1) && ISDIGIT (*regpoint)) - { - /* Its a two digit number. */ - regnum = 10 + (*regpoint++ - '0'); - if (regnum > BIGGESTREG) - regnum = -1; - } - } - break; - case 'F': /* Is it the FP. */ - case 'f': - switch (*regpoint++) - { - case 'p': - case 'P': - regnum = FP_REG; - } - break; - case 's': /* How about the SP. */ - case 'S': - switch (*regpoint++) - { - case 'p': - case 'P': - regnum = SP_REG; - } - break; - case 'p': /* Or the PC even. */ - case 'P': - switch (*regpoint++) - { - case 'c': - case 'C': - regnum = PC_REG; - } - break; - } - - if (regnum != -1) - /* No error, so move string pointer. */ - *start = regpoint; - - return regnum; -} - -/* This chops up an operand and figures out its modes and stuff. - It's a little touchy about extra characters. - Optex to start with one extra character so it can be overwritten for - the backward part of the parsing. - You can't put a bunch of extra characters in side to - make the command look cute. ie: * foo ( r1 ) [ r0 ] - If you like doing a lot of typing, try COBOL! - Actually, this parser is a little weak all around. It's designed to be - used with compliers, so I emphasize correct decoding of valid code quickly - rather that catching every possible error. - Note: This uses the expression function, so save input_line_pointer before - calling. - - Sperry defines the semantics of address modes (and values) - by a two-letter code, explained here. - - letter 1: access type - - a address calculation - no data access, registers forbidden - b branch displacement - m read - let go of bus - write back "modify" - r read - w write - v bit field address: like 'a' but registers are OK - - letter 2: data type (i.e. width, alignment) - - b byte - w word - l longword - q quadword (Even regs < 14 allowed) (if 12, you get a warning) - - unconditional synthetic jbr operand - ? simple synthetic reversible branch operand - ! complex synthetic reversible branch operand - : complex synthetic non-reversible branch operand - - The '-?!:' letter 2's are not for external consumption. They are used - by GAS for psuedo ops relaxing code. - - After parsing topP has: - - top_ndx: -1, or the index register. eg 7=[R7] - top_reg: -1, or register number. eg 7 = R7 or (R7) - top_mode: The addressing mode byte. This byte, defines which of - the 11 modes opcode is. - top_access: Access type wanted for this operand 'b'branch ' ' - no-instruction 'amrvw' - top_width: Operand width expected, one of "bwlq?-:!" - exp_of_operand: The expression as parsed by expression() - top_dispsize: Number of bytes in the displacement if we can figure it - out and it's relevant. - - Need syntax checks built. */ - -void -tip_op (char *optex, /* The users text input, with one leading character. */ - struct top *topP) /* The tahoe instruction with some fields already set: - in: access, width - out: ndx, reg, mode, error, dispsize. */ -{ - int mode = 0; /* This operand's mode. */ - char segfault = *optex; /* To keep the back parsing from freaking. */ - char *point = optex + 1; /* Parsing from front to back. */ - char *end; /* Parsing from back to front. */ - int reg = -1; /* major register, -1 means absent. */ - int imreg = -1; /* Major register in immediate mode. */ - int ndx = -1; /* index register number, -1 means absent. */ - char dec_inc = ' '; /* Is the SP auto-incremented '+' or - auto-decremented '-' or neither ' '. */ - int immediate = 0; /* 1 if '$' immediate mode. */ - int call_width = 0; /* If the caller casts the displacement. */ - int abs_width = 0; /* The width of the absolute displacement. */ - int com_width = 0; /* Displacement width required by branch. */ - int deferred = 0; /* 1 if '*' deferral is used. */ - byte disp_size = 0; /* How big is this operand. 0 == don't know. */ - char *op_bad = ""; /* Bad operand error. */ - char *tp, *temp, c; /* Temporary holders. */ - char access = topP->top_access;/* Save on a deref. */ - char width = topP->top_width; - int really_none = 0; /* Empty expressions evaluate to 0 - but I need to know if it's there or not. */ - expressionS *expP; /* -> expression values for this operand. */ - - /* Does this command restrict the displacement size. */ - if (access == 'b') - com_width = (width == 'b' ? 1 : - (width == 'w' ? 2 : - (width == 'l' ? 4 : 0))); - - *optex = '\0'; /* This is kind of a back stop for all - the searches to fail on if needed. */ - if (*point == '*') - { - /* A dereference? */ - deferred = 1; - point++; - } - - /* Force words into a certain mode. */ - /* Using the ^ operator is ambiguous. If I have an absolute label - called 'w' set to, say 2, and I have the expression 'w^1', do I get - 1, forced to be in word displacement mode, or do I get the value of - 'w' or'ed with 1 (3 in this case). - The default is 'w' as an offset, so that's what I use. - Stick with `, it does the same, and isn't ambig. */ - - if (*point != '\0' && ((point[1] == '^') || (point[1] == '`'))) - switch (*point) - { - case 'b': - case 'B': - case 'w': - case 'W': - case 'l': - case 'L': - if (com_width) - as_warn (_("Casting a branch displacement is bad form, and is ignored.")); - else - { - c = TOLOWER (*point); - call_width = ((c == 'b') ? 1 : - ((c == 'w') ? 2 : 4)); - } - point += 2; - break; - } - - /* Setting immediate mode. */ - if (*point == '$') - { - immediate = 1; - point++; - } - - /* I've pulled off all the easy stuff off the front, move to the end and - yank. */ - - for (end = point; *end != '\0'; end++) /* Move to the end. */ - ; - - if (end != point) /* Null string? */ - end--; - - if (end > point && *end == ' ' && end[-1] != '\'') - end--; /* Hop white space. */ - - /* Is this an index reg. */ - if ((*end == ']') && (end[-1] != '\'')) - { - temp = end; - - /* Find opening brace. */ - for (--end; (*end != '[' && end != point); end--) - ; - - /* If I found the opening brace, get the index register number. */ - if (*end == '[') - { - tp = end + 1; /* tp should point to the start of a reg. */ - ndx = tahoe_reg_parse (&tp); - if (tp != temp) - /* Reg. parse error. */ - ndx = -1; - else - /* Found it, move past brace. */ - end--; - - if (ndx == -1) - { - op_bad = _("Couldn't parse the [index] in this operand."); - end = point; /* Force all the rest of the tests to fail. */ - } - } - else - { - op_bad = _("Couldn't find the opening '[' for the index of this operand."); - end = point; /* Force all the rest of the tests to fail. */ - } - } - - /* Post increment? */ - if (*end == '+') - { - dec_inc = '+'; - /* was: *end--; */ - end--; - } - - /* Register in parens? */ - if ((*end == ')') && (end[-1] != '\'')) - { - temp = end; - - /* Find opening paren. */ - for (--end; (*end != '(' && end != point); end--) - ; - - /* If I found the opening paren, get the register number. */ - if (*end == '(') - { - tp = end + 1; - reg = tahoe_reg_parse (&tp); - if (tp != temp) - { - /* Not a register, but could be part of the expression. */ - reg = -1; - /* Rest the pointer back. */ - end = temp; - } - else - /* Found the reg. move before opening paren. */ - end--; - } - else - { - op_bad = _("Couldn't find the opening '(' for the deref of this operand."); - /* Force all the rest of the tests to fail. */ - end = point; - } - } - - /* Pre decrement? */ - if (*end == '-') - { - if (dec_inc != ' ') - { - op_bad = _("Operand can't be both pre-inc and post-dec."); - end = point; - } - else - { - dec_inc = '-'; - end--; - } - } - - /* Everything between point and end is the 'expression', unless it's - a register name. */ - c = end[1]; - end[1] = '\0'; - - tp = point; - /* Get the immediate register if it is there. */ - imreg = tahoe_reg_parse (&point); - if (*point != '\0') - { - /* If there is junk after point, then the it's not immediate reg. */ - point = tp; - imreg = -1; - } - - if (imreg != -1 && reg != -1) - op_bad = _("I parsed 2 registers in this operand."); - - /* Evaluate whats left of the expression to see if it's valid. - Note again: This assumes that the calling expression has saved - input_line_pointer. (Nag, nag, nag!). */ - if (*op_bad == '\0') - { - /* Statement has no syntax goofs yet: let's sniff the expression. */ - input_line_pointer = point; - expP = &(topP->exp_of_operand); - topP->seg_of_operand = expression (expP); - switch (expP->X_op) - { - case O_absent: - /* No expression. For BSD4.2 compatibility, missing expression is - absolute 0. */ - expP->X_op = O_constant; - expP->X_add_number = 0; - really_none = 1; - case O_constant: - /* For SEG_ABSOLUTE, we shouldn't need to set X_op_symbol, - X_add_symbol to any particular value. */ - /* But, we will program defensively. Since this situation occurs - rarely so it costs us little to do so. */ - expP->X_add_symbol = NULL; - expP->X_op_symbol = NULL; - /* How many bytes are needed to express this abs value? */ - abs_width = - ((((expP->X_add_number & 0xFFFFFF80) == 0) - || ((expP->X_add_number & 0xFFFFFF80) == 0xFFFFFF80)) ? 1 : - (((expP->X_add_number & 0xFFFF8000) == 0) - || ((expP->X_add_number & 0xFFFF8000) == 0xFFFF8000)) ? 2 : 4); - - case O_symbol: - break; - - default: - /* Major bug. We can't handle the case of an operator - expression in a synthetic opcode variable-length - instruction. We don't have a frag type that is smart - enough to relax an operator, and so we just force all - operators to behave like SEG_PASS1s. Clearly, if there is - a demand we can invent a new or modified frag type and - then coding up a frag for this case will be easy. */ - need_pass_2 = 1; - op_bad = _("Can't relocate expression error."); - break; - - case O_big: - /* This is an error. Tahoe doesn't allow any expressions - bigger that a 32 bit long word. Any bigger has to be referenced - by address. */ - op_bad = _("Expression is too large for a 32 bits."); - break; - } - - if (*input_line_pointer != '\0') - op_bad = _("Junk at end of expression."); - } - - end[1] = c; - - /* I'm done, so restore optex. */ - *optex = segfault; - - /* At this point in the game, we (in theory) have all the components of - the operand at least parsed. Now it's time to check for syntax/semantic - errors, and build the mode. - This is what I have: - deferred = 1 if '*' - call_width = 0,1,2,4 - abs_width = 0,1,2,4 - com_width = 0,1,2,4 - immediate = 1 if '$' - ndx = -1 or reg num - dec_inc = '-' or '+' or ' ' - reg = -1 or reg num - imreg = -1 or reg num - topP->exp_of_operand - really_none. */ - /* Is there a displacement size? */ - disp_size = (call_width ? call_width : - (com_width ? com_width : - abs_width ? abs_width : 0)); - - if (*op_bad == '\0') - { - if (imreg != -1) - { - /* Rn */ - mode = TAHOE_DIRECT_REG; - if (deferred - || immediate - || (dec_inc != ' ') - || (reg != -1) - || !really_none) - op_bad = _("Syntax error in direct register mode."); - else if (ndx != -1) - op_bad = _("You can't index a register in direct register mode."); - else if (imreg == SP_REG && access == 'r') - op_bad = - _("SP can't be the source operand with direct register addressing."); - else if (access == 'a') - op_bad = _("Can't take the address of a register."); - else if (access == 'b') - op_bad = _("Direct Register can't be used in a branch."); - else if (width == 'q' && ((imreg % 2) || (imreg > 13))) - op_bad = _("For quad access, the register must be even and < 14."); - else if (call_width) - op_bad = _("You can't cast a direct register."); - - if (*op_bad == '\0') - { - /* No errors, check for warnings. */ - if (width == 'q' && imreg == 12) - as_warn (_("Using reg 14 for quadwords can tromp the FP register.")); - - reg = imreg; - } - - /* We know: imm = -1. */ - } - else if (dec_inc == '-') - { - /* -(SP) */ - mode = TAHOE_AUTO_DEC; - if (deferred || immediate || !really_none) - op_bad = _("Syntax error in auto-dec mode."); - else if (ndx != -1) - op_bad = _("You can't have an index auto dec mode."); - else if (access == 'r') - op_bad = _("Auto dec mode cant be used for reading."); - else if (reg != SP_REG) - op_bad = _("Auto dec only works of the SP register."); - else if (access == 'b') - op_bad = _("Auto dec can't be used in a branch."); - else if (width == 'q') - op_bad = _("Auto dec won't work with quadwords."); - - /* We know: imm = -1, dec_inc != '-'. */ - } - else if (dec_inc == '+') - { - if (immediate || !really_none) - op_bad = _("Syntax error in one of the auto-inc modes."); - else if (deferred) - { - /* *(SP)+ */ - mode = TAHOE_AUTO_INC_DEFERRED; - if (reg != SP_REG) - op_bad = _("Auto inc deferred only works of the SP register."); - else if (ndx != -1) - op_bad = _("You can't have an index auto inc deferred mode."); - else if (access == 'b') - op_bad = _("Auto inc can't be used in a branch."); - } - else - { - /* (SP)+ */ - mode = TAHOE_AUTO_INC; - if (access == 'm' || access == 'w') - op_bad = _("You can't write to an auto inc register."); - else if (reg != SP_REG) - op_bad = _("Auto inc only works of the SP register."); - else if (access == 'b') - op_bad = _("Auto inc can't be used in a branch."); - else if (width == 'q') - op_bad = _("Auto inc won't work with quadwords."); - else if (ndx != -1) - op_bad = _("You can't have an index in auto inc mode."); - } - - /* We know: imm = -1, dec_inc == ' '. */ - } - else if (reg != -1) - { - if ((ndx != -1) && (reg == SP_REG)) - op_bad = _("You can't index the sp register."); - if (deferred) - { - /* *<disp>(Rn) */ - mode = TAHOE_REG_DISP_DEFERRED; - if (immediate) - op_bad = _("Syntax error in register displaced mode."); - } - else if (really_none) - /* (Rn) */ - mode = TAHOE_REG_DEFERRED; - else - /* <disp>(Rn) */ - mode = TAHOE_REG_DISP; - - /* We know: imm = -1, dec_inc == ' ', Reg = -1 */ - } - else - { - if (really_none) - op_bad = _("An offest is needed for this operand."); - if (deferred && immediate) - { - /* *$<ADDR> */ - mode = TAHOE_ABSOLUTE_ADDR; - disp_size = 4; - } - else if (immediate) - { - /* $<disp> */ - mode = TAHOE_IMMEDIATE; - if (ndx != -1) - op_bad = _("You can't index a register in immediate mode."); - if (access == 'a') - op_bad = _("Immediate access can't be used as an address."); - /* ponder the wisdom of a cast because it doesn't do any good. */ - } - else if (deferred) - /* *<disp> */ - mode = TAHOE_DISP_REL_DEFERRED; - else - /* <disp> */ - mode = TAHOE_DISPLACED_RELATIVE; - } - } - - /* At this point, all the errors we can do have be checked for. - We can build the 'top'. */ - topP->top_ndx = ndx; - topP->top_reg = reg; - topP->top_mode = mode; - topP->top_error = op_bad; - topP->top_dispsize = disp_size; -} - -/* This converts a string into a tahoe instruction. - The string must be a bare single instruction in tahoe (with BSD4 frobs) - format. - It provides at most one fatal error message (which stops the scan) - some warning messages as it finds them. - The tahoe instruction is returned in exploded form. - - The exploded instruction is returned to a struct tit of your choice. - #include "tahoe-inst.h" to know what a struct tit is. */ - -static void -tip (struct tit *titP, /* We build an exploded instruction here. */ - char *instring) /* Text of a vax instruction: we modify. */ -{ - struct tot_wot *twP = NULL; /* How to bit-encode this opcode. */ - char *p; /* 1/skip whitespace.2/scan vot_how. */ - char *q; - unsigned char count; /* Counts number of operands seen. */ - struct top *operandp; /* Scan operands in struct tit. */ - char *alloperr = ""; /* Error over all operands. */ - char c; /* Remember char, (we clobber it with '\0' temporarily). */ - char *save_input_line_pointer; - - if (*instring == ' ') - ++instring; /* Skip leading whitespace. */ - for (p = instring; *p && *p != ' '; p++) - ; - - /* Scanned up to end of operation-code. */ - /* Operation-code is ended with whitespace. */ - if (p == instring) - { - titP->tit_error = _("No operator"); - count = 0; - titP->tit_opcode = 0; - } - else - { - c = *p; - *p = '\0'; - - /* Here with instring pointing to what better be an op-name, and p - pointing to character just past that. - We trust instring points to an op-name, with no whitespace. */ - twP = (struct tot_wot *) hash_find (op_hash, instring); - /* Restore char after op-code. */ - *p = c; - if (twP == 0) - { - titP->tit_error = _("Unknown operator"); - count = 0; - titP->tit_opcode = 0; - } - else - { - /* We found a match! So let's pick up as many operands as the - instruction wants, and even gripe if there are too many. - We expect comma to separate each operand. - We let instring track the text, while p tracks a part of the - struct tot. */ - - /* No operands seen yet. */ - count = 0; - /* Point past the operation code. */ - instring = p + (*p != '\0'); - /* tip_op() screws with the input_line_pointer, so save it before - I jump in. */ - save_input_line_pointer = input_line_pointer; - - for (p = twP->args, operandp = titP->tit_operand; - !*alloperr && *p; - operandp++, p += 2) - { - /* Here to parse one operand. Leave instring pointing just - past any one ',' that marks the end of this operand. */ - if (!p[1]) - as_fatal (_("Compiler bug: ODD number of bytes in arg structure %s."), - twP->args); - else if (*instring) - { - for (q = instring; (*q != ',' && *q != '\0'); q++) - /* Jump quoted characters. */ - if (*q == '\'' && q[1] != '\0') - q++; - - c = *q; - /* Q points to ',' or '\0' that ends argument. C is that - character. */ - *q = '\0'; - operandp->top_access = p[0]; - operandp->top_width = p[1]; - tip_op (instring - 1, operandp); - /* Restore input text. */ - *q = c; - - if (*(operandp->top_error)) - alloperr = operandp->top_error; - - /* Next operand (if any). */ - instring = q + (c ? 1 : 0); - /* Won another argument, may have an operr. */ - count++; - } - else - alloperr = _("Not enough operands"); - } - /* Restore the pointer. */ - input_line_pointer = save_input_line_pointer; - - if (!*alloperr) - { - /* Skip whitespace. */ - if (*instring == ' ') - instring ++; - - if (*instring) - alloperr = _("Too many operands"); - } - - titP->tit_error = alloperr; - } - } - - titP->tit_opcode = twP->code; - titP->tit_operands = count; -} - -void -md_assemble (char *instruction_string) -{ - char *p; - struct top *operandP; /* An operand. Scans all operands. */ - expressionS *expP; /* -> expression values for this operand. */ - /* These refer to an instruction operand expression. */ - segT to_seg; /* Target segment of the address. */ - valueT this_add_number; - symbolS *this_add_symbol; /* +ve (minuend) symbol. */ - char *opcodeP; /* Where it is in a frag. */ - int dispsize; /* From top_dispsize: tahoe_operand_width (in bytes). */ - int is_undefined; /* 1 if operand expression's segment not known yet. */ - int pc_rel; /* Is this operand pc relative? */ - - /* Decode the operand. */ - tip (&t, instruction_string); - - /* Check to see if this operand decode properly. - Notice that we haven't made any frags yet. - If it goofed, then this instruction will wedge in any pass, - and we can safely flush it, without causing interpass symbol phase - errors. That is, without changing label values in different passes. */ - - if (*t.tit_error) - as_warn (_("Ignoring statement due to \"%s\""), t.tit_error); - else - { - /* We saw no errors in any operands - try to make frag(s). */ - /* Emit op-code. */ - /* Remember where it is, in case we want to modify the op-code later. */ - opcodeP = frag_more (1); - *opcodeP = t.tit_opcode; - /* Now do each operand. */ - for (operandP = t.tit_operand; - operandP < t.tit_operand + t.tit_operands; - operandP++) - { /* for each operand */ - expP = &(operandP->exp_of_operand); - if (operandP->top_ndx >= 0) - { - /* Indexed addressing byte - Legality of indexed mode already checked: it is OK. */ - FRAG_APPEND_1_CHAR (0x40 + operandP->top_ndx); - } /* if(top_ndx>=0) */ - - /* Here to make main operand frag(s). */ - this_add_number = expP->X_add_number; - this_add_symbol = expP->X_add_symbol; - to_seg = operandP->seg_of_operand; - know (to_seg == SEG_UNKNOWN \ - || to_seg == SEG_ABSOLUTE \ - || to_seg == SEG_DATA \ - || to_seg == SEG_TEXT \ - || to_seg == SEG_BSS); - is_undefined = (to_seg == SEG_UNKNOWN); - /* Do we know how big this operand is? */ - dispsize = operandP->top_dispsize; - pc_rel = 0; - /* Deal with the branch possibilities. (Note, this doesn't include jumps.) */ - if (operandP->top_access == 'b') - { - /* Branches must be expressions. A psuedo branch can also jump to - an absolute address. */ - if (to_seg == now_seg || is_undefined) - { - /* If is_undefined, then it might BECOME now_seg by relax time. */ - if (dispsize) - { - /* I know how big the branch is supposed to be (it's a normal - branch), so I set up the frag, and let GAS do the rest. */ - p = frag_more (dispsize); - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - size_to_fx (dispsize, 1), - NULL); - } - else - { - /* If we don't know how big it is, then its a synthetic branch, - so we set up a simple relax state. */ - switch (operandP->top_width) - { - case TAHOE_WIDTH_CONDITIONAL_JUMP: - /* Simple (conditional) jump. I may have to reverse the - condition of opcodeP, and then jump to my destination. - I set 1 byte aside for the branch off set, and could need 6 - more bytes for the pc_rel jump. */ - frag_var (rs_machine_dependent, 7, 1, - ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, - is_undefined ? STATE_UNDF : STATE_BYTE), - this_add_symbol, this_add_number, opcodeP); - break; - case TAHOE_WIDTH_ALWAYS_JUMP: - /* Simple (unconditional) jump. I may have to convert this to - a word branch, or an absolute jump. */ - frag_var (rs_machine_dependent, 5, 1, - ENCODE_RELAX (STATE_ALWAYS_BRANCH, - is_undefined ? STATE_UNDF : STATE_BYTE), - this_add_symbol, this_add_number, opcodeP); - break; - /* The smallest size for the next 2 cases is word. */ - case TAHOE_WIDTH_BIG_REV_JUMP: - frag_var (rs_machine_dependent, 8, 2, - ENCODE_RELAX (STATE_BIG_REV_BRANCH, - is_undefined ? STATE_UNDF : STATE_WORD), - this_add_symbol, this_add_number, - opcodeP); - break; - case TAHOE_WIDTH_BIG_NON_REV_JUMP: - frag_var (rs_machine_dependent, 10, 2, - ENCODE_RELAX (STATE_BIG_NON_REV_BRANCH, - is_undefined ? STATE_UNDF : STATE_WORD), - this_add_symbol, this_add_number, - opcodeP); - break; - default: - as_fatal (_("Compliler bug: Got a case (%d) I wasn't expecting."), - operandP->top_width); - } - } - } - else - { - /* to_seg != now_seg && to_seg != seg_unknown (still in branch) - In other words, I'm jumping out of my segment so extend the - branches to jumps, and let GAS fix them. */ - - /* These are "branches" what will always be branches around a jump - to the correct address in real life. - If to_seg is SEG_ABSOLUTE, just encode the branch in, - else let GAS fix the address. */ - - switch (operandP->top_width) - { - /* The theory: - For SEG_ABSOLUTE, then mode is ABSOLUTE_ADDR, jump - to that address (not pc_rel). - For other segs, address is a long word PC rel jump. */ - case TAHOE_WIDTH_CONDITIONAL_JUMP: - /* b<cond> */ - /* To reverse the condition in a TAHOE branch, - complement bit 4 */ - *opcodeP ^= 0x10; - p = frag_more (7); - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = (operandP->top_mode == - TAHOE_ABSOLUTE_ADDR ? TAHOE_ABSOLUTE_ADDR : - TAHOE_PC_REL_LONG); - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - (to_seg != SEG_ABSOLUTE) ? FX_PCREL32 : FX_32, NULL); - - /* Now (eg) BLEQ 1f - JMP foo - 1: */ - break; - - case TAHOE_WIDTH_ALWAYS_JUMP: - /* Br, just turn it into a jump. */ - *opcodeP = TAHOE_JMP; - p = frag_more (5); - *p++ = (operandP->top_mode == - TAHOE_ABSOLUTE_ADDR ? TAHOE_ABSOLUTE_ADDR : - TAHOE_PC_REL_LONG); - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - (to_seg != SEG_ABSOLUTE) ? FX_PCREL32 : FX_32, NULL); - /* Now (eg) JMP foo. */ - break; - - case TAHOE_WIDTH_BIG_REV_JUMP: - p = frag_more (8); - *opcodeP ^= 0x10; - *p++ = 0; - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = (operandP->top_mode == - TAHOE_ABSOLUTE_ADDR ? TAHOE_ABSOLUTE_ADDR : - TAHOE_PC_REL_LONG); - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - (to_seg != SEG_ABSOLUTE) ? FX_PCREL32 : FX_32, NULL); - /* Now (eg) ACBx 1f - JMP foo - 1: */ - break; - - case TAHOE_WIDTH_BIG_NON_REV_JUMP: - p = frag_more (10); - *p++ = 0; - *p++ = 2; - *p++ = TAHOE_BRB; - *p++ = 6; - *p++ = TAHOE_JMP; - *p++ = (operandP->top_mode == - TAHOE_ABSOLUTE_ADDR ? TAHOE_ABSOLUTE_ADDR : - TAHOE_PC_REL_LONG); - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - (to_seg != SEG_ABSOLUTE) ? FX_PCREL32 : FX_32, NULL); - /* Now (eg) xOBxxx 1f - BRB 2f - 1: JMP @#foo - 2: */ - break; - case 'b': - case 'w': - as_warn (_("Real branch displacements must be expressions.")); - break; - default: - as_fatal (_("Complier error: I got an unknown synthetic branch :%c"), - operandP->top_width); - break; - } - } - } - else - { - /* It ain't a branch operand. */ - switch (operandP->top_mode) - { - /* Auto-foo access, only works for one reg (SP) - so the only thing needed is the mode. */ - case TAHOE_AUTO_DEC: - case TAHOE_AUTO_INC: - case TAHOE_AUTO_INC_DEFERRED: - FRAG_APPEND_1_CHAR (operandP->top_mode); - break; - - /* Numbered Register only access. Only thing needed is the - mode + Register number. */ - case TAHOE_DIRECT_REG: - case TAHOE_REG_DEFERRED: - FRAG_APPEND_1_CHAR (operandP->top_mode + operandP->top_reg); - break; - - /* An absolute address. It's size is always 5 bytes. - (mode_type + 4 byte address). */ - case TAHOE_ABSOLUTE_ADDR: - know ((this_add_symbol == NULL)); - p = frag_more (5); - *p = TAHOE_ABSOLUTE_ADDR; - md_number_to_chars (p + 1, this_add_number, 4); - break; - - /* Immediate data. If the size isn't known, then it's an address - + and offset, which is 4 bytes big. */ - case TAHOE_IMMEDIATE: - if (this_add_symbol != NULL) - { - p = frag_more (5); - *p++ = TAHOE_IMMEDIATE_LONGWORD; - fix_new (frag_now, p - frag_now->fr_literal, - this_add_symbol, this_add_number, - FX_32, NULL); - } - else - { - /* It's an integer, and I know it's size. */ - if ((unsigned) this_add_number < 0x40) - /* Will it fit in a literal? */ - FRAG_APPEND_1_CHAR ((byte) this_add_number); - else - { - p = frag_more (dispsize + 1); - switch (dispsize) - { - case 1: - *p++ = TAHOE_IMMEDIATE_BYTE; - *p = (byte) this_add_number; - break; - case 2: - *p++ = TAHOE_IMMEDIATE_WORD; - md_number_to_chars (p, this_add_number, 2); - break; - case 4: - *p++ = TAHOE_IMMEDIATE_LONGWORD; - md_number_to_chars (p, this_add_number, 4); - break; - } - } - } - break; - - /* Distance from the PC. If the size isn't known, we have to relax - into it. The difference between this and disp(sp) is that - this offset is pc_rel, and disp(sp) isn't. - Note the drop through code. */ - - case TAHOE_DISPLACED_RELATIVE: - case TAHOE_DISP_REL_DEFERRED: - operandP->top_reg = PC_REG; - pc_rel = 1; - - /* Register, plus a displacement mode. Save the register number, - and weather its deffered or not, and relax the size if it isn't - known. */ - case TAHOE_REG_DISP: - case TAHOE_REG_DISP_DEFERRED: - if (operandP->top_mode == TAHOE_DISP_REL_DEFERRED - || operandP->top_mode == TAHOE_REG_DISP_DEFERRED) - /* Deffered mode is always 0x10 higher than it's non-deffered sibling. */ - operandP->top_reg += 0x10; - - /* Is this a value out of this segment? - The first part of this conditional is a cludge to make gas - produce the same output as 'as' when there is a lable, in - the current segment, displacing a register. It's strange, - and no one in their right mind would do it, but it's easy - to cludge. */ - if ((dispsize == 0 && !pc_rel) - || (to_seg != now_seg && !is_undefined && to_seg != SEG_ABSOLUTE)) - dispsize = 4; - - if (dispsize == 0) - { - /* We have a SEG_UNKNOWN symbol, or the size isn't cast. - It might turn out to be in the same segment as - the instruction, permitting relaxation. */ - p = frag_var (rs_machine_dependent, 5, 2, - ENCODE_RELAX (STATE_PC_RELATIVE, - is_undefined ? STATE_UNDF : STATE_BYTE), - this_add_symbol, this_add_number, 0); - *p = operandP->top_reg; - } - else - { - /* Either this is an abs, or a cast. */ - p = frag_more (dispsize + 1); - switch (dispsize) - { - case 1: - *p = TAHOE_PC_OR_BYTE + operandP->top_reg; - break; - case 2: - *p = TAHOE_PC_OR_WORD + operandP->top_reg; - break; - case 4: - *p = TAHOE_PC_OR_LONG + operandP->top_reg; - break; - }; - fix_new (frag_now, p + 1 - frag_now->fr_literal, - this_add_symbol, this_add_number, - size_to_fx (dispsize, pc_rel), NULL); - } - break; - default: - as_fatal (_("Barf, bad mode %x\n"), operandP->top_mode); - } - } - } - } -} - -/* We have no need to default values of symbols. */ - -symbolS * -md_undefined_symbol (char *name) -{ - return 0; -} - -/* Round up a section size to the appropriate boundary. */ - -valueT -md_section_align (segT segment, valueT size) -{ - /* Round all sects to multiple of 8. */ - return ((size + 7) & ~7); -} - -/* Exactly what point is a PC-relative offset relative TO? - On the sparc, they're relative to the address of the offset, plus - its size. This gets us to the following instruction. - (??? Is this right? FIXME-SOON) */ - -long -md_pcrel_from (fixS *fixP) -{ - return (((fixP->fx_type == FX_8 - || fixP->fx_type == FX_PCREL8) - ? 1 - : ((fixP->fx_type == FX_16 - || fixP->fx_type == FX_PCREL16) - ? 2 - : ((fixP->fx_type == FX_32 - || fixP->fx_type == FX_PCREL32) - ? 4 - : 0))) + fixP->fx_where + fixP->fx_frag->fr_address); -} - -int -tc_is_pcrel (fixS *fixP) -{ - /* Should never be called. */ - know (0); - return 0; -} diff --git a/gas/config/tc-tahoe.h b/gas/config/tc-tahoe.h deleted file mode 100644 index 8d64757..0000000 --- a/gas/config/tc-tahoe.h +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is tc-tahoe.h - - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_TAHOE 1 - -#define TARGET_BYTES_BIG_ENDIAN 1 - -#define NO_LISTING - -#define tc_headers_hook(a) {;} /* don't need it. */ -#define tc_crawl_symbol_chain(a) {;} /* don't need it. */ -#define tc_aout_pre_write_hook(a) {;} - -#define md_operand(x) - -extern const struct relax_type md_relax_table[]; -#define TC_GENERIC_RELAX_TABLE md_relax_table - -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c index dfdb4b0..b4acccc 100644 --- a/gas/config/tc-tic30.c +++ b/gas/config/tc-tic30.c @@ -38,8 +38,6 @@ static char *ordinal_names[] = "first", "second", "third", "fourth", "fifth" }; -const int md_reloc_size = 0; - const char comment_chars[] = ";"; const char line_comment_chars[] = "*"; const char line_separator_chars[] = ""; diff --git a/gas/config/tc-tic30.h b/gas/config/tc-tic30.h index c81f81d..1001707 100644 --- a/gas/config/tc-tic30.h +++ b/gas/config/tc-tic30.h @@ -48,6 +48,4 @@ extern int tic30_unrecognized_line (int); -#define tc_aout_pre_write_hook {} - #endif diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index a3ac44e..022ba52 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -257,7 +257,6 @@ const pseudo_typeS int md_short_jump_size = 4; int md_long_jump_size = 4; -const int md_reloc_size = RELSZ; /* Coff headers. */ /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ diff --git a/gas/config/tc-tic4x.h b/gas/config/tc-tic4x.h index f135389..fdc6eea 100644 --- a/gas/config/tc-tic4x.h +++ b/gas/config/tc-tic4x.h @@ -22,10 +22,6 @@ #define TC_TIC4X #define TIC4X -#ifndef BFD_ASSEMBLER -#error TMS320C4x requires BFD_ASSEMBLER -#endif - #define TARGET_ARCH bfd_arch_tic4x #define WORKING_DOT_WORD @@ -57,13 +53,6 @@ #define OCTETS_PER_BYTE_POWER 2 #define TARGET_ARCH bfd_arch_tic4x -#define BFD_ARCH TARGET_ARCH - -#define TC_COUNT_RELOC(x) (x->fx_addsy) -#define TC_CONS_RELOC RELOC_32 -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype (fixP) -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -#define NEED_FX_R_TYPE #define TIC_NOP_OPCODE 0x0c800000 diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index da1f4bc..b81041f 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -5549,17 +5549,6 @@ md_pcrel_from (fixP) return 0; } -#if defined OBJ_COFF - -short -tc_coff_fix2rtype (fixP) - fixS *fixP; -{ - return (fixP->fx_r_type); -} - -#endif /* OBJ_COFF */ - /* Mostly little-endian, but longwords (4 octets) get MS word stored first. */ diff --git a/gas/config/tc-tic54x.h b/gas/config/tc-tic54x.h index 39e4058..4d9b2c8 100644 --- a/gas/config/tc-tic54x.h +++ b/gas/config/tc-tic54x.h @@ -29,7 +29,6 @@ #define OCTETS_PER_BYTE_POWER 1 #define TARGET_ARCH bfd_arch_tic54x -#define BFD_ARCH TARGET_ARCH #define WORKING_DOT_WORD 1 @@ -48,10 +47,6 @@ /* affects preprocessor */ #define KEEP_WHITE_AROUND_COLON 1 -/* We need the extra field in the fixup struct to put the relocation in. */ - -#define NEED_FX_R_TYPE - struct bit_info { segT seg; diff --git a/gas/config/tc-tic80.c b/gas/config/tc-tic80.c deleted file mode 100644 index 55d6428..0000000 --- a/gas/config/tc-tic80.c +++ /dev/null @@ -1,894 +0,0 @@ -/* tc-tic80.c -- Assemble for the TI TMS320C80 (MV) - Copyright 1996, 1997, 2000, 2001, 2002, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "as.h" -#include "safe-ctype.h" -#include "opcode/tic80.h" - -#define internal_error(what) \ - as_fatal (_("internal error:%s:%d: %s\n"), __FILE__, __LINE__, what) - -#define internal_error_a(what,arg) \ - as_fatal (_("internal error:%s:%d: %s %ld\n"), __FILE__, __LINE__, what, arg) - -/* Generic assembler global variables which must be defined by all - targets. */ - -/* Characters which always start a comment. */ -const char comment_chars[] = ";"; - -/* Characters which start a comment at the beginning of a line. */ -const char line_comment_chars[] = ";*#"; - -/* Characters which may be used to separate multiple commands on a single - line. The semicolon is such a character by default and should not be - explicitly listed. */ -const char line_separator_chars[] = ""; - -/* Characters which are used to indicate an exponent in a floating - point number. */ -const char EXP_CHARS[] = "eE"; - -/* Characters which mean that a number is a floating point constant, - as in 0f1.0. */ -const char FLT_CHARS[] = "fF"; - -/* This table describes all the machine specific pseudo-ops the assembler - has to support. The fields are: - - pseudo-op name without dot - function to call to execute this pseudo-op - integer arg to pass to the function */ - -const pseudo_typeS md_pseudo_table[] = -{ - { "align", s_align_bytes, 4 }, /* Do byte alignment, default is a 4 byte boundary. */ - { "word", cons, 4 }, /* FIXME: Should this be machine independent? */ - { "bss", s_lcomm_bytes, 1 }, - { "sect", obj_coff_section, 0}, /* For compatibility with TI tools. */ - { "section", obj_coff_section, 0}, /* Standard COFF .section pseudo-op. */ - { NULL, NULL, 0 } -}; - -/* Opcode hash table. */ -static struct hash_control *tic80_hash; - -/* Replace short PC relative instructions with long form when - necessary. Currently this is off by default or when given the - -no-relax option. Turning it on by using the -relax option forces - all PC relative instructions to use the long form, which is why it - is currently not the default. */ -static int tic80_relax = 0; - -int -md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, - segT segment_type ATTRIBUTE_UNUSED) -{ - internal_error (_("Relaxation is a luxury we can't afford")); - return -1; -} - -/* We have no need to default values of symbols. */ - -symbolS * -md_undefined_symbol (char *name ATTRIBUTE_UNUSED) -{ - return NULL; -} - -/* Turn a string in input_line_pointer into a floating point constant - of type TYPE, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. */ - -#define MAX_LITTLENUMS 4 - -char * -md_atof (int type, char *litP, int *sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - default: - *sizeP = 0; - return _("bad call to md_atof ()"); - } - - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizeP = prec * sizeof (LITTLENUM_TYPE); - - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - - return NULL; -} - -/* Check to see if the constant value in NUM will fit in a field of - width BITS if it has flags FLAGS. */ - -static int -const_overflow (unsigned long num, int bits, int flags) -{ - long min, max; - int retval = 0; - - /* Only need to check fields less than 32 bits wide. */ - if (bits >= 32) - return retval; - - if (flags & TIC80_OPERAND_SIGNED) - { - max = (1 << (bits - 1)) - 1; - min = - (1 << (bits - 1)); - retval = (long) num > max || (long) num < min; - } - else - { - max = (1 << bits) - 1; - retval = num > (unsigned long) max; - } - return retval; -} - -/* get_operands () parses a string of operands and fills in a passed - array of expressions in EXP. - - Note that we use O_absent expressions to record additional information - about the previous non-O_absent expression, such as ":m" or ":s" - modifiers or register numbers enclosed in parens like "(r10)". - - Returns the number of expressions that were placed in EXP. */ - -static int -get_operands (expressionS exp[]) -{ - char *p = input_line_pointer; - int numexp = 0; - int parens = 0; - - while (*p) - { - /* Skip leading whitespace. */ - while (*p == ' ' || *p == '\t' || *p == ',') - p++; - - /* Check to see if we have any operands left to parse. */ - if (*p == 0 || *p == '\n' || *p == '\r') - break; - - /* Notice scaling or direct memory operand modifiers and save them in - an O_absent expression after the expression that they modify. */ - - if (*p == ':') - { - p++; - exp[numexp].X_op = O_absent; - if (*p == 'm') - { - p++; - /* This is a ":m" modifier. */ - exp[numexp].X_add_number = TIC80_OPERAND_M_SI | TIC80_OPERAND_M_LI; - } - else if (*p == 's') - { - p++; - /* This is a ":s" modifier. */ - exp[numexp].X_add_number = TIC80_OPERAND_SCALED; - } - else - as_bad (_("':' not followed by 'm' or 's'")); - - numexp++; - continue; - } - - /* Handle leading '(' on operands that use them, by recording that we - have entered a paren nesting level and then continuing. We complain - about multiple nesting. */ - - if (*p == '(') - { - if (++parens != 1) - as_bad (_("paren nesting")); - - p++; - continue; - } - - /* Handle trailing ')' on operands that use them, by reducing the - nesting level and then continuing. We complain if there were too - many closures. */ - - if (*p == ')') - { - /* Record that we have left a paren group and continue. */ - if (--parens < 0) - as_bad (_("mismatched parenthesis")); - - p++; - continue; - } - - /* Begin operand parsing at the current scan point. */ - input_line_pointer = p; - expression (&exp[numexp]); - - if (exp[numexp].X_op == O_illegal) - as_bad (_("illegal operand")); - else if (exp[numexp].X_op == O_absent) - as_bad (_("missing operand")); - - numexp++; - p = input_line_pointer; - } - - if (parens) - { - exp[numexp].X_op = O_absent; - exp[numexp++].X_add_number = TIC80_OPERAND_PARENS; - } - - /* Mark the end of the valid operands with an illegal expression. */ - exp[numexp].X_op = O_illegal; - - return numexp; -} - -/* find_opcode() gets a pointer to the entry in the opcode table that - matches the instruction being assembled, or returns NULL if no such match - is found. - - First it parses all the operands and save them as expressions. Note that - we use O_absent expressions to record additional information about the - previous non-O_absent expression, such as ":m" or ":s" modifiers or - register numbers enclosed in parens like "(r10)". - - It then looks at all opcodes with the same name and uses the operands to - choose the correct opcode. */ - -static struct tic80_opcode * -find_opcode (struct tic80_opcode *opcode, expressionS myops[]) -{ - int numexp; /* Number of expressions from parsing operands. */ - int expi; /* Index of current expression to match. */ - int opi; /* Index of current operand to match. */ - int match = 0; /* Set to 1 when an operand match is found. */ - struct tic80_opcode *opc = opcode; /* Pointer to current opcode table entry. */ - const struct tic80_opcode *end; /* Pointer to end of opcode table. */ - - /* First parse all the operands so we only have to do it once. There may - be more expressions generated than there are operands. */ - numexp = get_operands (myops); - - /* For each opcode with the same name, try to match it against the parsed - operands. */ - end = tic80_opcodes + tic80_num_opcodes; - while (!match && (opc < end) && (strcmp (opc->name, opcode->name) == 0)) - { - /* Start off assuming a match. If we find a mismatch, then this is - reset and the operand/expr matching loop terminates with match - equal to zero, which allows us to try the next opcode. */ - match = 1; - - /* For each expression, try to match it against the current operand - for the current opcode. Upon any mismatch, we abandon further - matching for the current opcode table entry. */ - for (expi = 0, opi = -1; (expi < numexp) && match; expi++) - { - int bits, flags, X_op, num; - - X_op = myops[expi].X_op; - num = myops[expi].X_add_number; - - /* The O_absent expressions apply to the same operand as the most - recent non O_absent expression. So only increment the operand - index when the current expression is not one of these special - expressions. */ - if (X_op != O_absent) - opi++; - - flags = tic80_operands[opc->operands[opi]].flags; - bits = tic80_operands[opc->operands[opi]].bits; - - switch (X_op) - { - case O_register: - /* Also check that registers that are supposed to be - even actually are even. */ - if (((flags & TIC80_OPERAND_GPR) != (num & TIC80_OPERAND_GPR)) || - ((flags & TIC80_OPERAND_FPA) != (num & TIC80_OPERAND_FPA)) || - ((flags & TIC80_OPERAND_CR) != (num & TIC80_OPERAND_CR)) || - ((flags & TIC80_OPERAND_EVEN) && (num & 1)) || - const_overflow (num & ~TIC80_OPERAND_MASK, bits, flags)) - match = 0; - break; - - case O_constant: - if ((flags & TIC80_OPERAND_ENDMASK) && (num == 32)) - /* Endmask values of 0 and 32 give identical - results. */ - num = 0; - - if ((flags & (TIC80_OPERAND_FPA | TIC80_OPERAND_GPR)) || - const_overflow (num, bits, flags)) - match = 0; - break; - - case O_symbol: - if ((bits < 32) && (flags & TIC80_OPERAND_PCREL) - && !tic80_relax) - { - /* The default is to prefer the short form of PC - relative relocations. This is the only form that - the TI assembler supports. If the -relax option - is given, we never use the short forms. - FIXME: Should be able to choose "best-fit". */ - } - else if ((bits == 32)) - { - /* The default is to prefer the long form of base - relative relocations. This is the only form that - the TI assembler supports. If the -no-relax - option is given, we always use the long form of - PC relative relocations. - FIXME: Should be able to choose "best-fit". */ - } - else - { - /* Symbols that don't match one of the above cases are - rejected as an operand. */ - match = 0; - } - break; - - case O_absent: - /* If this is an O_absent expression, then it may be an - expression that supplies additional information about - the operand, such as ":m" or ":s" modifiers. Check to - see that the operand matches this requirement. */ - if (!((num & flags & TIC80_OPERAND_M_SI) - || (num & flags & TIC80_OPERAND_M_LI) - || (num & flags & TIC80_OPERAND_SCALED))) - match = 0; - break; - - case O_big: - if ((num > 0) || !(flags & TIC80_OPERAND_FLOAT)) - match = 0; - break; - - case O_illegal: - case O_symbol_rva: - case O_uminus: - case O_bit_not: - case O_logical_not: - case O_multiply: - case O_divide: - case O_modulus: - case O_left_shift: - case O_right_shift: - case O_bit_inclusive_or: - case O_bit_or_not: - case O_bit_exclusive_or: - case O_bit_and: - case O_add: - case O_subtract: - case O_eq: - case O_ne: - case O_lt: - case O_le: - case O_ge: - case O_gt: - case O_logical_and: - case O_logical_or: - case O_max: - default: - internal_error_a (_("unhandled expression type"), (long) X_op); - } - } - if (!match) - opc++; - } - - return match ? opc : NULL; - -} - -/* build_insn takes a pointer to the opcode entry in the opcode table - and the array of operand expressions and writes out the instruction. - - Note that the opcode word and extended word may be written to different - frags, with the opcode at the end of one frag and the extension at the - beginning of the next. */ - -static void -build_insn (struct tic80_opcode *opcode, expressionS *opers) -{ - int expi; /* Index of current expression to match. */ - int opi; /* Index of current operand to match. */ - unsigned long insn[2]; /* Instruction and long immediate (if any). */ - char *f; /* Pointer to frag location for insn[0]. */ - fragS *ffrag; /* Frag containing location f. */ - char *fx = NULL; /* Pointer to frag location for insn[1]. */ - fragS *fxfrag; /* Frag containing location fx. */ - - /* Start with the raw opcode bits from the opcode table. */ - insn[0] = opcode->opcode; - insn[1] = 0; - - /* We are going to insert at least one 32 bit opcode so get the - frag now. */ - f = frag_more (4); - ffrag = frag_now; - - /* For each operand expression, insert the appropriate bits into the - instruction. */ - for (expi = 0, opi = -1; opers[expi].X_op != O_illegal; expi++) - { - int bits, shift, flags, X_op, num; - - X_op = opers[expi].X_op; - num = opers[expi].X_add_number; - - /* The O_absent expressions apply to the same operand as the most - recent non O_absent expression. So only increment the operand - index when the current expression is not one of these special - expressions. */ - if (X_op != O_absent) - opi++; - - flags = tic80_operands[opcode->operands[opi]].flags; - bits = tic80_operands[opcode->operands[opi]].bits; - shift = tic80_operands[opcode->operands[opi]].shift; - - switch (X_op) - { - case O_register: - num &= ~TIC80_OPERAND_MASK; - insn[0] = insn[0] | (num << shift); - break; - - case O_constant: - if ((flags & TIC80_OPERAND_ENDMASK) && (num == 32)) - /* Endmask values of 0 and 32 give identical results. */ - num = 0; - else if ((flags & TIC80_OPERAND_BITNUM)) - /* BITNUM values are stored in one's complement form. */ - num = (~num & 0x1F); - - /* Mask off upper bits, just it case it is signed and is - negative. */ - if (bits < 32) - { - num &= (1 << bits) - 1; - insn[0] = insn[0] | (num << shift); - } - else - { - fx = frag_more (4); - fxfrag = frag_now; - insn[1] = num; - } - break; - - case O_symbol: - if (bits == 32) - { - fx = frag_more (4); - fxfrag = frag_now; - insn[1] = 0; - - if (flags & TIC80_OPERAND_PCREL) - fix_new_exp (fxfrag, fx - (fxfrag->fr_literal), - 4, &opers[expi], 1, R_MPPCR); - else - fix_new_exp (fxfrag, fx - (fxfrag->fr_literal), - 4, &opers[expi], 0, R_RELLONGX); - } - else if (flags & TIC80_OPERAND_PCREL) - fix_new_exp (ffrag, f - (ffrag->fr_literal), - 4, /* FIXME! how is this used? */ - &opers[expi], 1, R_MPPCR15W); - else - internal_error (_("symbol reloc that is not PC relative or 32 bits")); - break; - - case O_absent: - /* Each O_absent expression can indicate exactly one - possible modifier. */ - if ((num & TIC80_OPERAND_M_SI) - && (flags & TIC80_OPERAND_M_SI)) - insn[0] = insn[0] | (1 << 17); - else if ((num & TIC80_OPERAND_M_LI) - && (flags & TIC80_OPERAND_M_LI)) - insn[0] = insn[0] | (1 << 15); - else if ((num & TIC80_OPERAND_SCALED) - && (flags & TIC80_OPERAND_SCALED)) - insn[0] = insn[0] | (1 << 11); - else if ((num & TIC80_OPERAND_PARENS) - && (flags & TIC80_OPERAND_PARENS)) - /* No code to generate, just accept and discard this - expression. */ - ; - else - internal_error_a (_("unhandled operand modifier"), - (long) opers[expi].X_add_number); - break; - - case O_big: - fx = frag_more (4); - fxfrag = frag_now; - - { - int precision = 2; - long exponent_bits = 8L; - LITTLENUM_TYPE words[2]; - - /* Value is still in generic_floating_point_number. */ - gen_to_words (words, precision, exponent_bits); - insn[1] = (words[0] << 16) | words[1]; - } - break; - - case O_illegal: - case O_symbol_rva: - case O_uminus: - case O_bit_not: - case O_logical_not: - case O_multiply: - case O_divide: - case O_modulus: - case O_left_shift: - case O_right_shift: - case O_bit_inclusive_or: - case O_bit_or_not: - case O_bit_exclusive_or: - case O_bit_and: - case O_add: - case O_subtract: - case O_eq: - case O_ne: - case O_lt: - case O_le: - case O_ge: - case O_gt: - case O_logical_and: - case O_logical_or: - case O_max: - default: - internal_error_a (_("unhandled expression"), (long) X_op); - break; - } - } - - /* Write out the instruction, either 4 or 8 bytes. */ - - md_number_to_chars (f, insn[0], 4); - if (fx != NULL) - md_number_to_chars (fx, insn[1], 4); -} - -/* This is the main entry point for the machine-dependent assembler. Gas - calls this function for each input line which does not contain a - pseudoop. - - STR points to a NULL terminated machine dependent instruction. This - function is supposed to emit the frags/bytes it assembles to. */ - -void -md_assemble (char *str) -{ - char *scan; - char *input_line_save; - struct tic80_opcode *opcode; - expressionS myops[16]; - - /* Ensure there is something there to assemble. */ - assert (str); - - /* Drop any leading whitespace. */ - while (ISSPACE (*str)) - str++; - - /* Isolate the mnemonic from the rest of the string by finding the first - whitespace character and zapping it to a null byte. */ - for (scan = str; *scan != '\000' && !ISSPACE (*scan); scan++) - ; - - if (*scan != '\000') - *scan++ = '\000'; - - /* Try to find this mnemonic in the hash table. */ - if ((opcode = (struct tic80_opcode *) hash_find (tic80_hash, str)) == NULL) - { - as_bad (_("Invalid mnemonic: '%s'"), str); - return; - } - - str = scan; - while (ISSPACE (*scan)) - scan++; - - input_line_save = input_line_pointer; - input_line_pointer = str; - - opcode = find_opcode (opcode, myops); - if (opcode == NULL) - as_bad (_("Invalid operands: '%s'"), input_line_save); - - input_line_pointer = input_line_save; - build_insn (opcode, myops); -} - -/* This function is called once at the start of assembly, after the command - line arguments have been parsed and all the machine independent - initializations have been completed. - - It should set up all the tables, etc., that the machine dependent part of - the assembler will need. */ - -void -md_begin (void) -{ - char *prev_name = ""; - register const struct tic80_opcode *op; - register const struct tic80_opcode *op_end; - const struct predefined_symbol *pdsp; - extern int coff_flags; /* Defined in obj-coff.c */ - - /* Set F_AR32WR in coff_flags, which will end up in the file header - f_flags field. */ - - coff_flags |= F_AR32WR; /* TIc80 is 32 bit little endian. */ - - /* Insert unique names into hash table. The TIc80 instruction set - has many identical opcode names that have different opcodes based - on the operands. This hash table then provides a quick index to - the first opcode with a particular name in the opcode table. */ - - tic80_hash = hash_new (); - op_end = tic80_opcodes + tic80_num_opcodes; - for (op = tic80_opcodes; op < op_end; op++) - { - if (strcmp (prev_name, op->name) != 0) - { - prev_name = (char *) op->name; - hash_insert (tic80_hash, op->name, (char *) op); - } - } - - /* Insert the predefined symbols into the symbol table. We use - symbol_create rather than symbol_new so that these symbols don't - end up in the object files' symbol table. Note that the values - of the predefined symbols include some upper bits that - distinguish the type of the symbol (register, bitnum, condition - code, etc) and these bits must be masked away before actually - inserting the values into the instruction stream. For registers - we put these bits in the symbol table since we use them later and - there is no question that they aren't part of the register - number. For constants we can't do that since the constant can be - any value, so they are masked off before putting them into the - symbol table. */ - - pdsp = NULL; - while ((pdsp = tic80_next_predefined_symbol (pdsp)) != NULL) - { - segT segment; - valueT valu; - int symtype; - - symtype = PDS_VALUE (pdsp) & TIC80_OPERAND_MASK; - switch (symtype) - { - case TIC80_OPERAND_GPR: - case TIC80_OPERAND_FPA: - case TIC80_OPERAND_CR: - segment = reg_section; - valu = PDS_VALUE (pdsp); - break; - case TIC80_OPERAND_CC: - case TIC80_OPERAND_BITNUM: - segment = absolute_section; - valu = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK; - break; - default: - internal_error_a (_("unhandled predefined symbol bits"), - (long) symtype); - break; - } - symbol_table_insert (symbol_create (PDS_NAME (pdsp), segment, valu, - &zero_address_frag)); - } -} - -/* The assembler adds md_shortopts to the string passed to getopt. */ - -const char *md_shortopts = ""; - -/* The assembler adds md_longopts to the machine independent long options - that are passed to getopt. */ - -struct option md_longopts[] = -{ -#define OPTION_RELAX (OPTION_MD_BASE) - {"relax", no_argument, NULL, OPTION_RELAX}, - -#define OPTION_NO_RELAX (OPTION_RELAX + 1) - {"no-relax", no_argument, NULL, OPTION_NO_RELAX}, - - {NULL, no_argument, NULL, 0} -}; - -size_t md_longopts_size = sizeof (md_longopts); - -/* The md_parse_option function will be called whenever getopt returns an - unrecognized code, presumably indicating a special code value which - appears in md_longopts for machine specific command line options. */ - -int -md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) -{ - switch (c) - { - case OPTION_RELAX: - tic80_relax = 1; - break; - case OPTION_NO_RELAX: - tic80_relax = 0; - break; - default: - return 0; - } - return 1; -} - -/* The md_show_usage function will be called whenever a usage message is - printed. It should print a description of the machine specific options - found in md_longopts. */ - -void -md_show_usage (FILE *stream) -{ - fprintf (stream, "\ -TIc80 options:\n\ --relax alter PC relative branch instructions to use long form when needed\n\ --no-relax always use short PC relative branch instructions, error on overflow\n"); -} - -/* Attempt to simplify or even eliminate a fixup. The return value is - ignored; perhaps it was once meaningful, but now it is historical. - To indicate that a fixup has been eliminated, set fixP->fx_done. */ - -void -md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) -{ - long val = * (long *) valP; - char *dest = fixP->fx_frag->fr_literal + fixP->fx_where; - int overflow; - - switch (fixP->fx_r_type) - { - case R_RELLONGX: - md_number_to_chars (dest, (valueT) val, 4); - break; - case R_MPPCR: - val >>= 2; - val += 1; /* Target address computed from inst start. */ - md_number_to_chars (dest, (valueT) val, 4); - break; - case R_MPPCR15W: - overflow = (val < -65536L) || (val > 65532L); - if (overflow) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("PC offset 0x%lx outside range 0x%lx-0x%lx"), - val, -65536L, 65532L); - else - { - val >>= 2; - *dest++ = val & 0xFF; - val >>= 8; - *dest = (*dest & 0x80) | (val & 0x7F); - } - break; - - case R_ABS: - md_number_to_chars (dest, (valueT) val, fixP->fx_size); - break; - - default: - internal_error_a (_("unhandled relocation type in fixup"), - (long) fixP->fx_r_type); - break; - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -/* Functions concerning relocs. */ - -/* The location from which a PC relative jump should be calculated, - given a PC relative reloc. - - For the TIc80, this is the address of the 32 bit opcode containing - the PC relative field. */ - -long -md_pcrel_from (fixS *fixP) -{ - return (fixP->fx_frag->fr_address + fixP->fx_where); -} - -/* Called after relax() is finished. - In: Address of frag. - fr_type == rs_machine_dependent. - fr_subtype is what the address relaxed to. - - Out: Any fixSs and constants are set up. - Caller will turn frag into a ".space 0". */ - -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - fragS *fragP ATTRIBUTE_UNUSED) -{ - internal_error (_("md_convert_frag() not implemented yet")); - abort (); -} - -void -tc_coff_symbol_emit_hook (symbolS *ignore ATTRIBUTE_UNUSED) -{ -} - -#if defined OBJ_COFF - -short -tc_coff_fix2rtype (fixS *fixP) -{ - return (fixP->fx_r_type); -} - -#endif /* OBJ_COFF */ diff --git a/gas/config/tc-tic80.h b/gas/config/tc-tic80.h deleted file mode 100644 index e830748..0000000 --- a/gas/config/tc-tic80.h +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is tc-tic80.h - Copyright 1996, 1997, 2000, 2002, 2005 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_TIC80 - -#define TARGET_BYTES_BIG_ENDIAN 0 - -#define TARGET_ARCH bfd_arch_tic80 -#define TARGET_FORMAT "coff-tic80" -#define BFD_ARCH TARGET_ARCH - -/* We need the extra field in the fixup struct to put the relocation in. */ - -#define NEED_FX_R_TYPE - -/* Define md_number_to_chars as the appropriate standard big endian or - little endian function. Should we someday support endianness as a - runtime decision, this will need to change. */ - -#define md_number_to_chars number_to_chars_littleendian - -/* Define away the call to md_operand in the expression parsing code. - This is called whenever the expression parser can't parse the input - and gives the assembler backend a chance to deal with it instead. */ - -#define md_operand(x) - -#ifdef OBJ_COFF - -/* COFF specific definitions. */ - -#define COFF_MAGIC TIC80_ARCH_MAGIC - -/* Whether a reloc should be output. */ - -#define TC_COUNT_RELOC(fixp) ((fixp) -> fx_addsy != NULL) - -/* This macro translates between an internal fix and a coff reloc type. */ - -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP) - -extern short tc_coff_fix2rtype (struct fix *); - -#endif /* OBJ_COFF */ diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h index 639971e..f9ec804 100644 --- a/gas/config/tc-v850.h +++ b/gas/config/tc-v850.h @@ -25,10 +25,6 @@ #define TARGET_BYTES_BIG_ENDIAN 0 -#ifndef BFD_ASSEMBLER - #error V850 support requires BFD_ASSEMBLER -#endif - /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_v850 diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index 0e0fbfa..bd09752 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -30,10 +30,6 @@ #include "elf/vax.h" #endif -#if defined (OBJ_AOUT) && !defined (BFD_ASSEMBLER) && defined (TE_NetBSD) -#include <netinet/in.h> -#endif - /* These chars start a comment anywhere in a source file (except inside another comment */ const char comment_chars[] = "#"; @@ -322,12 +318,11 @@ md_apply_fix (fixP, valueP, seg) segT seg ATTRIBUTE_UNUSED; { valueT value = * valueP; -#ifdef BFD_ASSEMBLER + if (((fixP->fx_addsy == NULL && fixP->fx_subsy == NULL) && fixP->fx_r_type != BFD_RELOC_32_PLT_PCREL && fixP->fx_r_type != BFD_RELOC_32_GOT_PCREL) || fixP->fx_r_type == NO_RELOC) -#endif number_to_chars_littleendian (fixP->fx_where + fixP->fx_frag->fr_literal, value, fixP->fx_size); @@ -751,13 +746,8 @@ md_assemble (instruction_string) this_add_number = expP->X_add_number; this_add_symbol = expP->X_add_symbol; to_seg = *segP; -#ifdef BFD_ASSEMBLER is_undefined = (to_seg == undefined_section); is_absolute = (to_seg == absolute_section); -#else - is_undefined = (to_seg == SEG_UNKNOWN); - is_absolute = (to_seg == SEG_ABSOLUTE); -#endif at = operandP->vop_mode & 1; length = (operandP->vop_short == 'b' ? 1 : (operandP->vop_short == 'w' @@ -834,11 +824,7 @@ md_assemble (instruction_string) p = frag_more (nbytes); /* Conventional relocation. */ fix_new (frag_now, p - frag_now->fr_literal, nbytes, -#ifdef BFD_ASSEMBLER section_symbol (absolute_section), -#else - &abs_symbol, -#endif this_add_number, 1, NO_RELOC); } else @@ -922,11 +908,7 @@ md_assemble (instruction_string) know (!(opcode_as_number & VIT_OPCODE_SYNTHETIC)); p = frag_more (nbytes); fix_new (frag_now, p - frag_now->fr_literal, nbytes, -#ifdef BFD_ASSEMBLER section_symbol (absolute_section), -#else - &abs_symbol, -#endif this_add_number, 1, NO_RELOC); } else @@ -1442,19 +1424,11 @@ md_estimate_size_before_relax (fragP, segment) * Out: Any fixSs and constants are set up. * Caller will turn frag into a ".space 0". */ -#ifdef BFD_ASSEMBLER void md_convert_frag (headers, seg, fragP) bfd *headers ATTRIBUTE_UNUSED; segT seg ATTRIBUTE_UNUSED; fragS *fragP; -#else -void -md_convert_frag (headers, seg, fragP) - object_headers *headers ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; - fragS *fragP; -#endif { char *addressP; /* -> _var to change. */ char *opcodeP; /* -> opcode char(s) to change. */ @@ -1619,42 +1593,6 @@ md_ri_to_chars (the_bytes, ri) #endif /* comment */ -#ifdef OBJ_AOUT -#ifndef BFD_ASSEMBLER -void -tc_aout_fix_to_chars (where, fixP, segment_address_in_file) - char *where; - fixS *fixP; - relax_addressT segment_address_in_file; -{ - /* - * In: length of relocation (or of address) in chars: 1, 2 or 4. - * Out: GNU LD relocation length code: 0, 1, or 2. - */ - - static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2}; - long r_symbolnum; - - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - where[6] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[4] = r_symbolnum & 0x0ff; - where[7] = ((((!S_IS_DEFINED (fixP->fx_addsy)) << 3) & 0x08) - | ((nbytes_r_length[fixP->fx_size] << 1) & 0x06) - | (((fixP->fx_pcrel << 0) & 0x01) & 0x0f)); -} -#endif /* !BFD_ASSEMBLER */ -#endif /* OBJ_AOUT */ - /* * BUGS, GRIPES, APOLOGIA, etc. * @@ -3279,7 +3217,6 @@ mumble (text, value) int md_short_jump_size = 3; int md_long_jump_size = 6; -const int md_reloc_size = 8; /* Size of relocation record */ void md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) @@ -3462,21 +3399,6 @@ md_pcrel_from (fixP) return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } -#ifdef OBJ_AOUT -#ifndef BFD_ASSEMBLER -void -tc_headers_hook(headers) - object_headers *headers; -{ -#ifdef TE_NetBSD - N_SET_INFO(headers->header, OMAGIC, M_VAX4K_NETBSD, 0); - headers->header.a_info = htonl (headers->header.a_info); -#endif -} -#endif /* !BFD_ASSEMBLER */ -#endif /* OBJ_AOUT */ - -#ifdef BFD_ASSEMBLER arelent * tc_gen_reloc (section, fixp) asection *section ATTRIBUTE_UNUSED; @@ -3552,6 +3474,5 @@ tc_gen_reloc (section, fixp) return reloc; } -#endif /* BFD_ASSEMBLER */ /* end of tc-vax.c */ diff --git a/gas/config/tc-vax.h b/gas/config/tc-vax.h index fdf23f6..10294c9 100644 --- a/gas/config/tc-vax.h +++ b/gas/config/tc-vax.h @@ -1,5 +1,5 @@ /* tc-vax.h -- Header file for tc-vax.c. - Copyright 1987, 1991, 1992, 1993, 1995, 1996, 1997, 2000, 2002 + Copyright 1987, 1991, 1992, 1993, 1995, 1996, 1997, 2000, 2002, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -40,18 +40,11 @@ #define TARGET_FORMAT "elf32-vax" #endif -#define BFD_ARCH bfd_arch_vax /* for non-BFD_ASSEMBLER */ -#define TARGET_ARCH bfd_arch_vax /* BFD_ASSEMBLER */ +#define TARGET_ARCH bfd_arch_vax -#ifdef BFD_ASSEMBLER #define NO_RELOC BFD_RELOC_NONE -#else -#define NO_RELOC 0 -#endif #define NOP_OPCODE 0x01 -#define tc_aout_pre_write_hook(x) {;} /* not used */ -#define tc_crawl_symbol_chain(a) {;} /* not used */ #define md_operand(x) long md_chars_to_number PARAMS ((unsigned char *, int)); @@ -59,7 +52,6 @@ long md_chars_to_number PARAMS ((unsigned char *, int)); extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table -#ifdef BFD_ASSEMBLER /* Values passed to md_apply_fix don't include symbol values. */ #define MD_APPLY_SYM_VALUE(FIX) 0 @@ -73,7 +65,6 @@ extern const struct relax_type md_relax_table[]; && (S_GET_SEGMENT ((FIX)->fx_subsy) \ == S_GET_SEGMENT ((FIX)->fx_addsy))) \ || S_IS_LOCAL ((FIX)->fx_addsy))) -#endif /* * Local Variables: diff --git a/gas/config/tc-w65.c b/gas/config/tc-w65.c deleted file mode 100644 index 05c95dc..0000000 --- a/gas/config/tc-w65.c +++ /dev/null @@ -1,1080 +0,0 @@ -/* tc-w65.c -- Assemble code for the W65816 - Copyright 1995, 1998, 2000, 2001, 2002, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Written By Steve Chamberlain <sac@cygnus.com>. */ - -#include <stdio.h> -#include "as.h" -#include "bfd.h" -#include "subsegs.h" -#define DEFINE_TABLE -#include "../opcodes/w65-opc.h" - -const char comment_chars[] = "!"; -const char line_separator_chars[] = ";"; -const char line_comment_chars[] = "!#"; - -/* This table describes all the machine specific pseudo-ops the assembler - has to support. The fields are: - - pseudo-op name without dot - function to call to execute this pseudo-op - Integer arg to pass to the function. */ - -#define OP_BCC 0x90 -#define OP_BCS 0xB0 -#define OP_BEQ 0xF0 -#define OP_BMI 0x30 -#define OP_BNE 0xD0 -#define OP_BPL 0x10 -#define OP_BRA 0x80 -#define OP_BRL 0x82 -#define OP_BVC 0x50 -#define OP_BVS 0x70 - -static int M; /* M flag. */ -static int X; /* X flag. */ - -/* This function is called once, at assembler startup time. This - should set up all the tables, etc that the MD part of the assembler - needs. */ - -static void -s_longa (int xmode) -{ - int *p = xmode ? &X : &M; - - while (*input_line_pointer == ' ') - input_line_pointer++; - if (strncmp (input_line_pointer, "on", 2) == 0) - { - input_line_pointer += 2; - *p = 0; - } - else if (strncmp (input_line_pointer, "off", 3) == 0) - { - *p = 1; - input_line_pointer += 3; - } - else - as_bad (_("need on or off.")); - demand_empty_rest_of_line (); -} - -const pseudo_typeS md_pseudo_table[] = -{ - {"int", cons, 2}, - {"word", cons, 2}, - {"longa", s_longa, 0}, - {"longi", s_longa, 1}, - {0, 0, 0} -}; - -const char EXP_CHARS[] = "eE"; - -/* Chars that mean this number is a floating point constant. */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ -const char FLT_CHARS[] = "rRsSfFdDxXpP"; - -/* Opcode mnemonics */ -static struct hash_control *opcode_hash_control; - -#define C(a, b) ENCODE_RELAX(a,b) -#define ENCODE_RELAX(what, length) (((what) << 2) + (length)) - -#define GET_WHAT(x) (((x) >> 2)) - -#define BYTE_DISP 1 -#define WORD_DISP 2 -#define UNDEF_BYTE_DISP 0 -#define UNDEF_WORD_DISP 3 -#define COND_BRANCH 1 -#define UNCOND_BRANCH 2 -#define END 3 - -#define BYTE_F 127 /* How far we can branch forwards. */ -#define BYTE_B -126 /* How far we can branch backwards. */ -#define WORD_F 32767 -#define WORD_B 32768 - -relax_typeS md_relax_table[C (END, 0)] = -{ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - - /* COND_BRANCH */ - { 0, 0, 0, 0 }, /* UNDEF_BYTE_DISP */ - { BYTE_F, BYTE_B, 2, C (COND_BRANCH, WORD_DISP) }, /* BYTE_DISP */ - { WORD_F, WORD_B, 5, 0 }, /* WORD_DISP */ - { 0, 0, 5, 0 }, /* UNDEF_WORD_DISP */ - - /* UNCOND_BRANCH */ - { 0, 0, 0, 0 }, /* UNDEF_BYTE_DISP */ - { BYTE_F, BYTE_B, 2, C (UNCOND_BRANCH, WORD_DISP) }, /* BYTE_DISP */ - { WORD_F, WORD_B, 3, 0 }, /* WORD_DISP */ - { 0, 0, 3, 0 } /* UNDEF_WORD_DISP */ -}; - -void -md_begin (void) -{ - const struct opinfo *opcode; - char *prev_name = ""; - - opcode_hash_control = hash_new (); - - /* Insert unique names into hash table. */ - for (opcode = optable; opcode->name; opcode++) - { - if (strcmp (prev_name, opcode->name)) - { - prev_name = opcode->name; - hash_insert (opcode_hash_control, opcode->name, (char *) opcode); - } - } - - flag_signed_overflow_ok = 1; -} - -static expressionS immediate; /* Absolute expression. */ -static expressionS immediate1; /* Absolute expression. */ -int expr_size; -int expr_shift; -int tc_cons_reloc; - -void -w65_expression (expressionS *dest) -{ - expr_size = 0; - expr_shift = 0; - tc_cons_reloc = 0; - while (*input_line_pointer == ' ') - input_line_pointer++; - - if (*input_line_pointer == '<') - { - expr_size = 1; - input_line_pointer++; - } - else if (*input_line_pointer == '>') - { - expr_shift = 1; - input_line_pointer++; - } - else if (*input_line_pointer == '^') - { - expr_shift = 2; - input_line_pointer++; - } - - expr (0, dest); -} - -int amode; - -static char * -parse_exp (char *s) -{ - char *save; - char *new; - - save = input_line_pointer; - input_line_pointer = s; - w65_expression (&immediate); - if (immediate.X_op == O_absent) - as_bad (_("missing operand")); - new = input_line_pointer; - input_line_pointer = save; - return new; -} - -static char * -get_operands (const struct opinfo *info, char *ptr) -{ - int override_len = 0; - int bytes = 0; - - while (*ptr == ' ') - ptr++; - - if (ptr[0] == '#') - { - ptr++; - switch (info->amode) - { - case ADDR_IMMTOI: - bytes = X ? 1 : 2; - amode = ADDR_IMMTOI; - break; - case ADDR_IMMTOA: - bytes = M ? 1 : 2; - amode = ADDR_IMMTOA; - break; - case ADDR_IMMCOP: - bytes = 1; - amode = ADDR_IMMCOP; - break; - case ADDR_DIR: - bytes = 2; - amode = ADDR_ABS; - break; - default: - abort (); - break; - } - ptr = parse_exp (ptr); - } - else if (ptr[0] == '!') - { - ptr = parse_exp (ptr + 1); - if (ptr[0] == ',') - { - if (ptr[1] == 'y') - { - amode = ADDR_ABS_IDX_Y; - bytes = 2; - ptr += 2; - } - else if (ptr[1] == 'x') - { - amode = ADDR_ABS_IDX_X; - bytes = 2; - ptr += 2; - } - else - as_bad (_("syntax error after <exp")); - } - else - { - amode = ADDR_ABS; - bytes = 2; - } - } - else if (ptr[0] == '>') - { - ptr = parse_exp (ptr + 1); - if (ptr[0] == ',' && ptr[1] == 'x') - { - amode = ADDR_ABS_LONG_IDX_X; - bytes = 3; - ptr += 2; - } - else - { - amode = ADDR_ABS_LONG; - bytes = 3; - } - } - else if (ptr[0] == '<') - { - ptr = parse_exp (ptr + 1); - if (ptr[0] == ',') - { - if (ptr[1] == 'y') - { - amode = ADDR_DIR_IDX_Y; - ptr += 2; - bytes = 2; - } - else if (ptr[1] == 'x') - { - amode = ADDR_DIR_IDX_X; - ptr += 2; - bytes = 2; - } - else - as_bad (_("syntax error after <exp")); - } - else - { - amode = ADDR_DIR; - bytes = 1; - } - } - else if (ptr[0] == 'a') - amode = ADDR_ACC; - else if (ptr[0] == '(') - { - /* Look for (exp),y - (<exp),y - (exp,x) - (<exp,x) - (exp) - (!exp) - (exp) - (<exp) - (exp,x) - (!exp,x) - (exp,s) - (exp,s),y */ - - ptr++; - if (ptr[0] == '<') - { - override_len = 1; - ptr++; - } - else if (ptr[0] == '!') - { - override_len = 2; - ptr++; - } - else if (ptr[0] == '>') - { - override_len = 3; - ptr++; - } - else - override_len = 0; - - ptr = parse_exp (ptr); - - if (ptr[0] == ',') - { - ptr++; - if (ptr[0] == 'x' && ptr[1] == ')') - { - ptr += 2; - - if (override_len == 1) - { - amode = ADDR_DIR_IDX_IND_X; - bytes = 2; - } - else - { - amode = ADDR_ABS_IND_IDX; - bytes = 2; - } - } - else if (ptr[0] == 's' && ptr[1] == ')' - && ptr[2] == ',' && ptr[3] == 'y') - { - amode = ADDR_STACK_REL_INDX_IDX; - bytes = 1; - ptr += 4; - } - } - else if (ptr[0] == ')') - { - if (ptr[1] == ',' && ptr[2] == 'y') - { - amode = ADDR_DIR_IND_IDX_Y; - ptr += 3; - bytes = 2; - } - else - { - if (override_len == 1) - { - amode = ADDR_DIR_IND; - bytes = 1; - } - else - { - amode = ADDR_ABS_IND; - bytes = 2; - } - ptr++; - } - } - } - else if (ptr[0] == '[') - { - ptr = parse_exp (ptr + 1); - - if (ptr[0] == ']') - { - ptr++; - if (ptr[0] == ',' && ptr[1] == 'y') - { - bytes = 1; - amode = ADDR_DIR_IND_IDX_Y_LONG; - ptr += 2; - } - else - { - if (info->code == O_jmp) - { - bytes = 2; - amode = ADDR_ABS_IND_LONG; - } - else - { - bytes = 1; - amode = ADDR_DIR_IND_LONG; - } - } - } - } - else - { - ptr = parse_exp (ptr); - if (ptr[0] == ',') - { - if (ptr[1] == 'y') - { - if (override_len == 1) - { - bytes = 1; - amode = ADDR_DIR_IDX_Y; - } - else - { - amode = ADDR_ABS_IDX_Y; - bytes = 2; - } - ptr += 2; - } - else if (ptr[1] == 'x') - { - if (override_len == 1) - { - amode = ADDR_DIR_IDX_X; - bytes = 1; - } - else - { - amode = ADDR_ABS_IDX_X; - bytes = 2; - } - ptr += 2; - } - else if (ptr[1] == 's') - { - bytes = 1; - amode = ADDR_STACK_REL; - ptr += 2; - } - else - { - bytes = 1; - immediate1 = immediate; - ptr = parse_exp (ptr + 1); - amode = ADDR_BLOCK_MOVE; - } - } - else - { - switch (info->amode) - { - case ADDR_PC_REL: - amode = ADDR_PC_REL; - bytes = 1; - break; - case ADDR_PC_REL_LONG: - amode = ADDR_PC_REL_LONG; - bytes = 2; - break; - default: - if (override_len == 1) - { - amode = ADDR_DIR; - bytes = 1; - } - else if (override_len == 3) - { - bytes = 3; - amode = ADDR_ABS_LONG; - } - else - { - amode = ADDR_ABS; - bytes = 2; - } - } - } - } - - switch (bytes) - { - case 1: - switch (expr_shift) - { - case 0: - if (amode == ADDR_DIR) - tc_cons_reloc = R_W65_DP; - else - tc_cons_reloc = R_W65_ABS8; - break; - case 1: - tc_cons_reloc = R_W65_ABS8S8; - break; - case 2: - tc_cons_reloc = R_W65_ABS8S16; - break; - } - break; - case 2: - switch (expr_shift) - { - case 0: - tc_cons_reloc = R_W65_ABS16; - break; - case 1: - tc_cons_reloc = R_W65_ABS16S8; - break; - case 2: - tc_cons_reloc = R_W65_ABS16S16; - break; - } - } - return ptr; -} - -/* Passed a pointer to a list of opcodes which use different - addressing modes, return the opcode which matches the opcodes - provided. */ - -static const struct opinfo * -get_specific (const struct opinfo *opcode) -{ - int ocode = opcode->code; - - for (; opcode->code == ocode; opcode++) - if (opcode->amode == amode) - return opcode; - - return 0; -} - -/* Now we know what sort of opcodes it is, let's build the bytes. */ - -static void -build_Mytes (const struct opinfo *opcode) -{ - int size; - int type; - int pcrel; - char *output; - - if (opcode->amode == ADDR_IMPLIED) - output = frag_more (1); - - else if (opcode->amode == ADDR_PC_REL) - { - int type; - - /* This is a relaxable insn, so we do some special handling. */ - type = opcode->val == OP_BRA ? UNCOND_BRANCH : COND_BRANCH; - output = frag_var (rs_machine_dependent, - md_relax_table[C (type, WORD_DISP)].rlx_length, - md_relax_table[C (type, BYTE_DISP)].rlx_length, - C (type, UNDEF_BYTE_DISP), - immediate.X_add_symbol, - immediate.X_add_number, - 0); - } - else - { - switch (opcode->amode) - { - GETINFO (size, type, pcrel); - default: - abort (); - } - - /* If something special was done in the expression modify the - reloc type. */ - if (tc_cons_reloc) - type = tc_cons_reloc; - - /* 1 byte for the opcode + the bytes for the addrmode. */ - output = frag_more (size + 1); - - if (opcode->amode == ADDR_BLOCK_MOVE) - { - /* Two relocs for this one. */ - fix_new_exp (frag_now, - output + 1 - frag_now->fr_literal, - 1, - &immediate, - 0, - R_W65_ABS8S16); - - fix_new_exp (frag_now, - output + 2 - frag_now->fr_literal, - 1, - &immediate1, - 0, - R_W65_ABS8S16); - } - else if (type >= 0 - && opcode->amode != ADDR_IMPLIED - && opcode->amode != ADDR_ACC - && opcode->amode != ADDR_STACK) - { - fix_new_exp (frag_now, - output + 1 - frag_now->fr_literal, - size, - &immediate, - pcrel, - type); - } - } - output[0] = opcode->val; -} - -/* This is the guts of the machine-dependent assembler. STR points to - a machine dependent instruction. This function is supposed to emit - the frags/bytes it assembles to. */ - -void -md_assemble (char *str) -{ - const struct opinfo *opcode; - char name[20]; - - /* Drop leading whitespace */ - while (*str == ' ') - str++; - - /* All opcodes are three letters. */ - name[0] = str[0]; - name[1] = str[1]; - name[2] = str[2]; - name[3] = 0; - - tc_cons_reloc = 0; - str += 3; - opcode = (struct opinfo *) hash_find (opcode_hash_control, name); - - if (opcode == NULL) - { - as_bad (_("unknown opcode")); - return; - } - - if (opcode->amode != ADDR_IMPLIED - && opcode->amode != ADDR_STACK) - { - get_operands (opcode, str); - opcode = get_specific (opcode); - } - - if (opcode == 0) - { - /* Couldn't find an opcode which matched the operands. */ - - char *where = frag_more (1); - - where[0] = 0x0; - where[1] = 0x0; - as_bad (_("invalid operands for opcode")); - return; - } - - build_Mytes (opcode); -} - -symbolS * -md_undefined_symbol (char *name ATTRIBUTE_UNUSED) -{ - return 0; -} - -/* Various routines to kill one day. */ -/* Equal to MAX_PRECISION in atof-ieee.c. */ -#define MAX_LITTLENUMS 6 - -/* Turn a string in input_line_pointer into a floating point constant - of type TYPE, and store the appropriate bytes in *LITP. The number - of LITTLENUMS emitted is stored in *SIZEP. An error message is - returned, or NULL on OK. */ - -char * -md_atof (int type, char *litP, int *sizeP) -{ - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_NTOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words + prec - 1; prec--;) - { - md_number_to_chars (litP, (valueT) (*wordP--), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; -} - -int -md_parse_option (int c ATTRIBUTE_UNUSED, char *a ATTRIBUTE_UNUSED) -{ - return 0; -} - -/* Called after relaxing, change the frags so they know how big they - are. */ - -void -md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, - segT seg ATTRIBUTE_UNUSED, - fragS *fragP) -{ - int disp_size = 0; - int inst_size = 0; - unsigned char *buffer = - (unsigned char *) (fragP->fr_fix + fragP->fr_literal); - - switch (fragP->fr_subtype) - { - case C (COND_BRANCH, BYTE_DISP): - case C (UNCOND_BRANCH, BYTE_DISP): - disp_size = 1; - inst_size = 1; - break; - - /* Conditional branches to a known 16 bit displacement. */ - case C (COND_BRANCH, WORD_DISP): - switch (buffer[0]) - { - case OP_BCC: - case OP_BCS: - case OP_BEQ: - case OP_BMI: - case OP_BNE: - case OP_BPL: - case OP_BVS: - case OP_BVC: - /* Invert the sense of the test. */ - buffer[0] ^= 0x20; - buffer[1] = 3; /* Jump over following brl. */ - buffer[2] = OP_BRL; - buffer[3] = 0; - buffer[4] = 0; - disp_size = 2; - inst_size = 3; - break; - default: - abort (); - } - break; - case C (UNCOND_BRANCH, WORD_DISP): - /* Unconditional branches to a known 16 bit displacement. */ - - switch (buffer[0]) - { - case OP_BRA: - buffer[0] = OP_BRL; - disp_size = 2; - inst_size = 1; - break; - default: - abort (); - } - break; - /* Got to create a branch over a reloc here. */ - case C (COND_BRANCH, UNDEF_WORD_DISP): - buffer[0] ^= 0x20; /* Invert test. */ - buffer[1] = 3; - buffer[2] = OP_BRL; - buffer[3] = 0; - buffer[4] = 0; - fix_new (fragP, - fragP->fr_fix + 3, - 4, - fragP->fr_symbol, - fragP->fr_offset, - 0, - R_W65_PCR16); - - fragP->fr_fix += disp_size + inst_size; - fragP->fr_var = 0; - break; - case C (UNCOND_BRANCH, UNDEF_WORD_DISP): - buffer[0] = OP_BRL; - buffer[1] = 0; - buffer[2] = 0; - fix_new (fragP, - fragP->fr_fix + 1, - 4, - fragP->fr_symbol, - fragP->fr_offset, - 0, - R_W65_PCR16); - - fragP->fr_fix += disp_size + inst_size; - fragP->fr_var = 0; - break; - default: - abort (); - } - if (inst_size) - { - /* Get the address of the end of the instruction. */ - int next_inst = (fragP->fr_fix + fragP->fr_address - + disp_size + inst_size); - int targ_addr = (S_GET_VALUE (fragP->fr_symbol) + - fragP->fr_offset); - int disp = targ_addr - next_inst; - - md_number_to_chars ((char *) buffer + inst_size, disp, disp_size); - fragP->fr_fix += disp_size + inst_size; - fragP->fr_var = 0; - } -} - -valueT -md_section_align (segT seg, valueT size) -{ - return ((size + (1 << section_alignment[(int) seg]) - 1) - & (-1 << section_alignment[(int) seg])); -} - -void -md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) -{ - long val = * (long *) valP; - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; - int addr = fixP->fx_frag->fr_address + fixP->fx_where; - - if (fixP->fx_r_type == 0) - { - if (fixP->fx_size == 1) - fixP->fx_r_type = R_W65_ABS8; - else - fixP->fx_r_type = R_W65_ABS16; - } - - switch (fixP->fx_r_type) - { - case R_W65_ABS8S16: - val >>= 8; - case R_W65_ABS8S8: - val >>= 8; - case R_W65_ABS8: - *buf++ = val; - break; - case R_W65_ABS16S16: - val >>= 8; - case R_W65_ABS16S8: - val >>= 8; - case R_W65_ABS16: - *buf++ = val >> 0; - *buf++ = val >> 8; - break; - case R_W65_ABS24: - *buf++ = val >> 0; - *buf++ = val >> 8; - *buf++ = val >> 16; - break; - case R_W65_PCR8: - *buf++ = val - addr - 1; - break; - case R_W65_PCR16: - val = val - addr - 1; - *buf++ = val; - *buf++ = val >> 8; - break; - case R_W65_DP: - *buf++ = val; - break; - - default: - abort (); - } - - if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0) - fixP->fx_done = 1; -} - -/* Put number into target byte order. */ - -void -md_number_to_chars (char *ptr, valueT use, int nbytes) -{ - number_to_chars_littleendian (ptr, use, nbytes); -} - -long -md_pcrel_from (fixS *fixP) -{ - int gap = fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address - 1; - return gap; -} - -void -tc_coff_symbol_emit_hook (symbolS *x ATTRIBUTE_UNUSED) -{ -} - -short -tc_coff_fix2rtype (fixS *fix_ptr) -{ - return fix_ptr->fx_r_type; -} - -void -tc_reloc_mangle (fixS *fix_ptr, - struct internal_reloc *intr, - bfd_vma base) - -{ - symbolS *symbol_ptr; - - symbol_ptr = fix_ptr->fx_addsy; - - /* If this relocation is attached to a symbol then it's ok - to output it */ - if (fix_ptr->fx_r_type == RELOC_32) - { - /* Cons likes to create reloc32's whatever the size of the reloc. */ - switch (fix_ptr->fx_size) - { - case 2: - intr->r_type = R_IMM16; - break; - case 1: - intr->r_type = R_IMM8; - break; - default: - abort (); - } - } - else - { - if (fix_ptr->fx_size == 4) - intr->r_type = R_W65_ABS24; - else - intr->r_type = fix_ptr->fx_r_type; - } - - intr->r_vaddr = fix_ptr->fx_frag->fr_address + fix_ptr->fx_where + base; - intr->r_offset = fix_ptr->fx_offset; - - /* Turn the segment of the symbol into an offset. */ - if (symbol_ptr) - { - symbolS *dot; - - dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot; - if (dot) - { - intr->r_offset += S_GET_VALUE (symbol_ptr); - intr->r_symndx = dot->sy_number; - } - else - intr->r_symndx = symbol_ptr->sy_number; - } - else - intr->r_symndx = -1; -} - -int -tc_coff_sizemachdep (fragS *frag) -{ - return md_relax_table[frag->fr_subtype].rlx_length; -} - -/* Called just before address relaxation, return the length by which a - fragment must grow to reach it's destination. */ - -int -md_estimate_size_before_relax (fragS *fragP, segT segment_type) -{ - int what; - - switch (fragP->fr_subtype) - { - default: - abort (); - - case C (COND_BRANCH, UNDEF_BYTE_DISP): - case C (UNCOND_BRANCH, UNDEF_BYTE_DISP): - what = GET_WHAT (fragP->fr_subtype); - /* Used to be a branch to somewhere which was unknown. */ - if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type) - /* Got a symbol and it's defined in this segment, become byte - sized - maybe it will fix up. */ - fragP->fr_subtype = C (what, BYTE_DISP); - else - /* Its got a segment, but its not ours, so it will always be - long. */ - fragP->fr_subtype = C (what, UNDEF_WORD_DISP); - break; - - case C (COND_BRANCH, BYTE_DISP): - case C (COND_BRANCH, WORD_DISP): - case C (COND_BRANCH, UNDEF_WORD_DISP): - case C (UNCOND_BRANCH, BYTE_DISP): - case C (UNCOND_BRANCH, WORD_DISP): - case C (UNCOND_BRANCH, UNDEF_WORD_DISP): - /* When relaxing a section for the second time, we don't need to - do anything besides return the current size. */ - break; - } - - fragP->fr_var = md_relax_table[fragP->fr_subtype].rlx_length; - return fragP->fr_var; -} - -const char *md_shortopts = ""; -struct option md_longopts[] = -{ -#define OPTION_RELAX (OPTION_MD_BASE) - {NULL, no_argument, NULL, 0} -}; - -void -md_show_usage (FILE *stream ATTRIBUTE_UNUSED) -{ -} - -size_t md_longopts_size = sizeof (md_longopts); diff --git a/gas/config/tc-w65.h b/gas/config/tc-w65.h deleted file mode 100644 index 19bb15b..0000000 --- a/gas/config/tc-w65.h +++ /dev/null @@ -1,60 +0,0 @@ -/* This file is tc-w65.h - Copyright 1995, 1997, 1998, 2000, 2001, 2002, 2005 - 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define TC_W65 - -#define TARGET_BYTES_BIG_ENDIAN 0 - -struct internal_reloc; -struct fix; - -#define WORKING_DOT_WORD - -/* This macro translates between an internal fix and a coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype (fixP) - -#define BFD_ARCH bfd_arch_w65 -#define COFF_MAGIC 0x6500 - -#define IGNORE_NONSTANDARD_ESCAPES - -#define TC_RELOC_MANGLE(s,a,b,c) tc_reloc_mangle (a,b,c) -extern void tc_reloc_mangle (struct fix *, struct internal_reloc *, bfd_vma); - -#define LISTING_HEADER "W65816 GAS " -#define NEED_FX_R_TYPE 1 -#define RELOC_32 1234 - -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -int tc_coff_sizemachdep (fragS *); - -#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) w65_expression (EXP) -void w65_expression (expressionS *); - -#define TC_COUNT_RELOC(x) (1) -#define TC_CONS_RELOC tc_cons_reloc -#define DONT_OVERFLOW -int tc_cons_reloc; - -#define md_operand(x) - -extern struct relax_type md_relax_table[]; -#define TC_GENERIC_RELAX_TABLE md_relax_table diff --git a/gas/config/tc-xstormy16.h b/gas/config/tc-xstormy16.h index df750be..5425874 100644 --- a/gas/config/tc-xstormy16.h +++ b/gas/config/tc-xstormy16.h @@ -20,11 +20,6 @@ #define TC_XSTORMY16 -#ifndef BFD_ASSEMBLER -/* Leading space so will compile with cc. */ - #error XSTORMY16 support requires BFD_ASSEMBLER -#endif - #define LISTING_HEADER "XSTORMY16 GAS " /* The target BFD architecture. */ diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h index fd72712..35717f0 100644 --- a/gas/config/tc-xtensa.h +++ b/gas/config/tc-xtensa.h @@ -1,5 +1,5 @@ /* tc-xtensa.h -- Header file for tc-xtensa.c. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,10 +23,6 @@ struct fix; -#ifndef BFD_ASSEMBLER -#error Xtensa support requires BFD_ASSEMBLER -#endif - #ifndef OBJ_ELF #error Xtensa support requires ELF object format #endif diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index ca80fe3..3b0f6d8 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -36,7 +36,6 @@ const char line_separator_chars[] = ";"; extern int machine; extern int coff_flags; int segmented_mode; -const int md_reloc_size; /* This is non-zero if target was set from the command line. */ static int z8k_target_from_cmdline; @@ -1260,12 +1259,6 @@ md_assemble (char *str) } } -void -tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_crawl_symbol_chain \n")); -} - /* We have no need to default values of symbols. */ symbolS * @@ -1274,12 +1267,6 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED) return 0; } -void -tc_headers_hook (object_headers *headers ATTRIBUTE_UNUSED) -{ - printf (_("call to tc_headers_hook \n")); -} - /* Various routines to kill one day. */ /* Equal to MAX_PRECISION in atof-ieee.c. */ #define MAX_LITTLENUMS 6 diff --git a/gas/config/tc-z8k.h b/gas/config/tc-z8k.h index f7c6e69..e48098c 100644 --- a/gas/config/tc-z8k.h +++ b/gas/config/tc-z8k.h @@ -1,6 +1,6 @@ /* This file is tc-z8k.h Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1997, 1998, - 2000, 2002, 2003 + 2000, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -27,16 +27,7 @@ struct internal_reloc; #define WORKING_DOT_WORD -#ifndef BFD_ASSEMBLER -#define LOCAL_LABEL(x) 0 -#endif - -/* This macro translates between an internal fix and a coff reloc type. */ -#define TC_COFF_FIX2RTYPE(fixP) abort (); - -#define BFD_ARCH bfd_arch_z8k #define COFF_MAGIC 0x8000 -#define TC_COUNT_RELOC(x) (1) #define IGNORE_NONSTANDARD_ESCAPES #undef WARN_SIGNED_OVERFLOW_WORD @@ -45,7 +36,6 @@ extern void tc_reloc_mangle PARAMS ((struct fix *, struct internal_reloc *, bfd_vma)); #define LISTING_HEADER "Zilog Z8000 GAS " -#define NEED_FX_R_TYPE 1 #define RELOC_32 1234 #define md_operand(x) diff --git a/gas/config/te-aux.h b/gas/config/te-aux.h deleted file mode 100644 index 38445d9..0000000 --- a/gas/config/te-aux.h +++ /dev/null @@ -1,17 +0,0 @@ -#define TE_AUX - -/* From obj-coff.h: - This internal_lineno crap is to stop namespace pollution from the - bfd internal coff headerfile. */ -#define internal_lineno bfd_internal_lineno -#include "coff/aux-coff.h" /* override bits in coff/internal.h */ -#undef internal_lineno - -#define COFF_NOLOAD_PROBLEM -#define KEEP_RELOC_INFO - -#include "obj-format.h" - -#ifndef LOCAL_LABELS_FB -#define LOCAL_LABELS_FB 1 -#endif diff --git a/gas/config/te-delt88.h b/gas/config/te-delt88.h deleted file mode 100644 index 1505183..0000000 --- a/gas/config/te-delt88.h +++ /dev/null @@ -1,13 +0,0 @@ -/* This file is te-delta88.h. */ - -#define TE_DELTA88 1 - -#define COFF_NOLOAD_PROBLEM 1 - -/* Added these, because if we don't know what we're targeting we may - need an assembler version of libgcc, and that will use local - labels. */ -#define LOCAL_LABELS_DOLLAR 1 -#define LOCAL_LABELS_FB 1 - -#include "obj-format.h" diff --git a/gas/config/te-delta.h b/gas/config/te-delta.h deleted file mode 100644 index f88b71e..0000000 --- a/gas/config/te-delta.h +++ /dev/null @@ -1,14 +0,0 @@ -#define TE_DELTA - -#include "obj-format.h" - -#define COFF_NOLOAD_PROBLEM 1 -#define COFF_COMMON_ADDEND 1 - -/* Added these, because if we don't know what we're targeting we may - need an assembler version of libgcc, and that will use local - labels. */ -#define LOCAL_LABELS_DOLLAR 1 -#define LOCAL_LABELS_FB 1 - -/* end of te-delta.h */ diff --git a/gas/config/te-dpx2.h b/gas/config/te-dpx2.h deleted file mode 100644 index 5daeb9f..0000000 --- a/gas/config/te-dpx2.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Machine specific defines for the dpx2 machine. */ - -/* The magic number is not the usual MC68MAGIC. */ -#define COFF_MAGIC MC68KBCSMAGIC - -#define REGISTER_PREFIX_OPTIONAL 1 - -#define TARGET_FORMAT "coff-m68k-un" - -#include "obj-format.h" - -/* end of te-dpx2.h */ diff --git a/gas/config/te-hp300.h b/gas/config/te-hp300.h deleted file mode 100644 index 0358d11..0000000 --- a/gas/config/te-hp300.h +++ /dev/null @@ -1,27 +0,0 @@ -/* te-hp300.h -- hpux 9000/300 target environment declarations. - Copyright 1987, 1990, 1991, 1992, 1993, 1995, 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#define LOCAL_LABELS_DOLLAR 1 -#define LOCAL_LABELS_FB 1 - -#include "obj-format.h" - -/* end of te-hp300.h */ diff --git a/gas/config/te-ic960.h b/gas/config/te-ic960.h deleted file mode 100644 index 36deb66..0000000 --- a/gas/config/te-ic960.h +++ /dev/null @@ -1,37 +0,0 @@ -/* This file is te-ic960.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1997, 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 2, 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* This file is te-ic960.h and is intended to define ic960 environment - specific differences. */ - -#define OBJ_COFF_OMIT_OPTIONAL_HEADER - -#ifndef BFD_ASSEMBLER -#define LOCAL_LABEL(name) ((name[0] =='L') \ - || (name[0] =='.' \ - && (name[1]=='C' \ - || name[1]=='I' \ - || name[1]=='.'))) -#endif - -#include "obj-format.h" - -/* end of te-ic960.h */ diff --git a/gas/config/vms-a-conf.h b/gas/config/vms-a-conf.h deleted file mode 100644 index 688fc68..0000000 --- a/gas/config/vms-a-conf.h +++ /dev/null @@ -1,129 +0,0 @@ -/* vms-alpha-conf.h. Generated manually from conf.in, - and used by config-gas-alpha.com when constructing config.h. */ - -/* Define if using alloca.c. */ -#ifdef __GNUC__ -#undef C_ALLOCA -#else -#define C_ALLOCA -#endif - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define as __inline if that's what the C compiler calls it. */ -#ifdef __GNUC__ -#undef inline -#else -#define inline -#endif - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#define STACK_DIRECTION (-1) - -/* Should gas use high-level BFD interfaces? */ -#define BFD_ASSEMBLER - -/* Some assert/preprocessor combinations are incapable of handling - certain kinds of constructs in the argument of assert. For example, - quoted strings (if requoting isn't done right) or newlines. */ -#ifdef __GNUC__ -#undef BROKEN_ASSERT -#else -#define BROKEN_ASSERT -#endif - -/* If we aren't doing cross-assembling, some operations can be optimized, - since byte orders and value sizes don't need to be adjusted. */ -#undef CROSS_COMPILE - -/* Some gas code wants to know these parameters. */ -#define TARGET_ALIAS "alpha-vms" -#define TARGET_CPU "alpha" -#define TARGET_CANONICAL "alpha-dec-vms" -#define TARGET_OS "openVMS/Alpha" -#define TARGET_VENDOR "dec" - -/* Sometimes the system header files don't declare malloc and realloc. */ -#undef NEED_DECLARATION_MALLOC - -/* Sometimes the system header files don't declare free. */ -#undef NEED_DECLARATION_FREE - -/* Sometimes errno.h doesn't declare errno itself. */ -#undef NEED_DECLARATION_ERRNO - -#undef MANY_SEGMENTS - -/* Needed only for sparc configuration */ -#undef sparcv9 - -/* Define if you have the remove function. */ -#define HAVE_REMOVE - -/* Define if you have the unlink function. */ -#undef HAVE_UNLINK - -/* Define if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H - -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H - -/* Define if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#define HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/types.h> header file. */ -#ifdef __GNUC__ -#define HAVE_SYS_TYPES_H -#else -#undef HAVE_SYS_TYPES_H -#endif - -/* Define if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H /* config-gas.com will make one if necessary */ - -/* Define if you have the <varargs.h> header file. */ -#undef HAVE_VARARGS_H - -/* VMS-specific: we need to set up EXIT_xxx here because the default - values in as.h are inappropriate for VMS, but we also want to prevent - as.h's inclusion of <stdlib.h> from triggering redefinition warnings. - <stdlib.h> guards itself against multiple inclusion, so including it - here turns as.h's later #include into a no-op. (We can't simply use - #ifndef HAVE_STDLIB_H here, because the <stdlib.h> in several older - gcc-vms distributions neglects to define these two required macros.) */ -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#if __DECC -#undef EXIT_SUCCESS -#undef EXIT_FAILURE -#define EXIT_SUCCESS 1 /* SS$_NORMAL, STS$K_SUCCESS */ -#define EXIT_FAILURE 0x10000002 /* (STS$K_ERROR | STS$M_INHIB_MSG) */ -#endif - -#include <unixlib.h> -#if __DECC -extern int strcasecmp (); -extern int strncasecmp (); -#endif diff --git a/gas/configure b/gas/configure index e212503..fcf6b62 100755 --- a/gas/configure +++ b/gas/configure @@ -856,7 +856,6 @@ Optional Features: --enable-static=PKGS build static libraries default=yes --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) - --enable-bfd-assembler use BFD back end for writing object files targets alternative target configurations besides the primary --enable-commonbfdlib build shared BFD/opcodes/libiberty library --enable-werror treat compile warnings as errors @@ -3812,7 +3811,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 3815 "configure"' > conftest.$ac_ext + echo '#line 3814 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4053,18 +4052,7 @@ exec 5>>./config.log -user_bfd_gas= -# Check whether --enable-bfd-assembler or --disable-bfd-assembler was given. -if test "${enable_bfd_assembler+set}" = set; then - enableval="$enable_bfd_assembler" - case "${enableval}" in - yes) need_bfd=yes user_bfd_gas=yes ;; - no) user_bfd_gas=no ;; - *) { { echo "$as_me:$LINENO: error: bad value ${enableval} given for bfd-assembler option" >&5 -echo "$as_me: error: bad value ${enableval} given for bfd-assembler option" >&2;} - { (exit 1); exit 1; }; } ;; -esac -fi; # Check whether --enable-targets or --disable-targets was given. +# Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" case "${enableval}" in @@ -4648,10 +4636,6 @@ _ACEOF *opcodes*) shared_opcodes=true ;; *) shared_opcodes=false ;; esac - if test "${shared_opcodes}" = "true"; then - # A shared libopcodes must be linked against libbfd. - need_bfd=yes - fi ;; esac @@ -4730,17 +4714,8 @@ _ACEOF # See if we really can support this configuration with the emulation code. if test $this_target = $target ; then - primary_bfd_gas=$bfd_gas obj_format=$fmt te_file=$em - - if test $bfd_gas = no ; then - # Can't support other configurations this way. - break - fi - elif test $bfd_gas = no ; then - # Can't support this configuration. - break fi # From target name and format, produce a list of supported emulations. @@ -4841,28 +4816,6 @@ echo "$as_me: error: GAS does not have support for object file format ${obj_form { (exit 1); exit 1; }; } fi -case ${user_bfd_gas}-${primary_bfd_gas} in - yes-yes | no-no) - # We didn't override user's choice. - ;; - no-yes) - { echo "$as_me:$LINENO: WARNING: Use of BFD is required for ${target}; overriding config options." >&5 -echo "$as_me: WARNING: Use of BFD is required for ${target}; overriding config options." >&2;} - ;; - no-preferred) - primary_bfd_gas=no - ;; - *-preferred) - primary_bfd_gas=yes - ;; - yes-*) - primary_bfd_gas=yes - ;; - -*) - # User specified nothing. - ;; -esac - # Some COFF configurations want these random other flags set. case ${obj_format} in coff) @@ -4887,8 +4840,8 @@ _ACEOF esac # Getting this done right is going to be a bitch. Each configuration specified -# with --enable-targets=... should be checked for environment, format, cpu, and -# bfd_gas setting. +# with --enable-targets=... should be checked for environment, format, cpu +# setting. # # For each configuration, the necessary object file support code must be linked # in. This might be only one, it might be up to four. The necessary emulation @@ -4991,11 +4944,6 @@ cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_GENERIC 1 _ACEOF ;; - hp300) -cat >>confdefs.h <<\_ACEOF -#define OBJ_MAYBE_HP300 1 -_ACEOF - ;; ieee) cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_IEEE 1 @@ -5038,16 +4986,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in - yes-*-coff) need_bfd=yes ;; - no-*-coff) need_bfd=yes - -cat >>confdefs.h <<\_ACEOF -#define MANY_SEGMENTS 1 -_ACEOF - ;; -esac - reject_dev_configs=yes case ${reject_dev_configs}-${dev} in @@ -5064,15 +5002,6 @@ esac -case "${primary_bfd_gas}" in - yes) -cat >>confdefs.h <<\_ACEOF -#define BFD_ASSEMBLER 1 -_ACEOF - - need_bfd=yes ;; -esac - # do we need the opcodes library? case "${need_opcodes}" in yes) @@ -5080,13 +5009,9 @@ yes) ;; esac -case "${need_bfd}" in -yes) - BFDLIB=../bfd/libbfd.la - BFDVER_H=../bfd/bfdver.h - ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - ;; -esac +BFDLIB=../bfd/libbfd.la +BFDVER_H=../bfd/bfdver.h +ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' diff --git a/gas/configure.in b/gas/configure.in index 2faf4b1..87c339e 100644 --- a/gas/configure.in +++ b/gas/configure.in @@ -22,14 +22,6 @@ AM_INIT_AUTOMAKE(gas, ${BFD_VERSION}) AM_PROG_LIBTOOL -user_bfd_gas= -AC_ARG_ENABLE(bfd-assembler, -[ --enable-bfd-assembler use BFD back end for writing object files], -[case "${enableval}" in - yes) need_bfd=yes user_bfd_gas=yes ;; - no) user_bfd_gas=no ;; - *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;; -esac])dnl AC_ARG_ENABLE(targets, [ targets alternative target configurations besides the primary], [case "${enableval}" in @@ -277,10 +269,6 @@ changequote([,])dnl *opcodes*) shared_opcodes=true ;; *) shared_opcodes=false ;; esac - if test "${shared_opcodes}" = "true"; then - # A shared libopcodes must be linked against libbfd. - need_bfd=yes - fi ;; esac @@ -355,17 +343,8 @@ changequote([,])dnl # See if we really can support this configuration with the emulation code. if test $this_target = $target ; then - primary_bfd_gas=$bfd_gas obj_format=$fmt te_file=$em - - if test $bfd_gas = no ; then - # Can't support other configurations this way. - break - fi - elif test $bfd_gas = no ; then - # Can't support this configuration. - break fi # From target name and format, produce a list of supported emulations. @@ -459,27 +438,6 @@ if test ! -r ${srcdir}/config/obj-${obj_format}.c; then AC_MSG_ERROR(GAS does not have support for object file format ${obj_format}) fi -case ${user_bfd_gas}-${primary_bfd_gas} in - yes-yes | no-no) - # We didn't override user's choice. - ;; - no-yes) - AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.) - ;; - no-preferred) - primary_bfd_gas=no - ;; - *-preferred) - primary_bfd_gas=yes - ;; - yes-*) - primary_bfd_gas=yes - ;; - -*) - # User specified nothing. - ;; -esac - # Some COFF configurations want these random other flags set. case ${obj_format} in coff) @@ -492,8 +450,8 @@ case ${obj_format} in esac # Getting this done right is going to be a bitch. Each configuration specified -# with --enable-targets=... should be checked for environment, format, cpu, and -# bfd_gas setting. +# with --enable-targets=... should be checked for environment, format, cpu +# setting. # # For each configuration, the necessary object file support code must be linked # in. This might be only one, it might be up to four. The necessary emulation @@ -536,7 +494,6 @@ if test `set . $formats ; shift ; echo $#` -gt 1 ; then ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;; elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;; generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;; - hp300) AC_DEFINE(OBJ_MAYBE_HP300, 1, [HP300 support?]) ;; ieee) AC_DEFINE(OBJ_MAYBE_IEEE, 1, [IEEE support?]) ;; som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;; esac @@ -560,12 +517,6 @@ AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.]) AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION", [Default emulation.]) -case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in - yes-*-coff) need_bfd=yes ;; - no-*-coff) need_bfd=yes - AC_DEFINE(MANY_SEGMENTS, 1, [old COFF support?]) ;; -esac - reject_dev_configs=yes case ${reject_dev_configs}-${dev} in @@ -581,11 +532,6 @@ AC_SUBST(install_tooldir) AC_SUBST(atof) dnl AC_SUBST(emulation) -case "${primary_bfd_gas}" in - yes) AC_DEFINE(BFD_ASSEMBLER, 1, [Use BFD interface?]) - need_bfd=yes ;; -esac - # do we need the opcodes library? case "${need_opcodes}" in yes) @@ -593,13 +539,9 @@ yes) ;; esac -case "${need_bfd}" in -yes) - BFDLIB=../bfd/libbfd.la - BFDVER_H=../bfd/bfdver.h - ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' - ;; -esac +BFDLIB=../bfd/libbfd.la +BFDVER_H=../bfd/bfdver.h +ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' AC_SUBST(BFDLIB) AC_SUBST(OPCODES_LIB) diff --git a/gas/configure.tgt b/gas/configure.tgt index bd98d83..b10bcf2 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -11,7 +11,6 @@ # cpu_type canonical gas cpu type; identifies the config/tc-* files # fmt output format; identifies the config/obj-* files # em emulation; identifies the config/te-* files -# bfd_gas set to "yes" if BFD_ASSEMBLER is required # Optional output shell variables; these are not always set: # arch the default architecture; sets DEFAULT_ARCH on some systems @@ -50,7 +49,6 @@ case ${cpu} in m680[012346]0) cpu_type=m68k ;; m6811|m6812|m68hc12) cpu_type=m68hc11 ;; m683??) cpu_type=m68k ;; - m8*) cpu_type=m88k ;; maxq) cpu_type=maxq ;; mips*el) cpu_type=mips endian=little ;; mips*) cpu_type=mips endian=big ;; @@ -90,12 +88,6 @@ esac generic_target=${cpu_type}-$vendor-$os # Note: This table is alpha-sorted, please try to keep it that way. case ${generic_target} in - a29k-*-coff) fmt=coff ;; - a29k-amd-udi) fmt=coff ;; - a29k-amd-ebmon) fmt=coff ;; - a29k-nyu-sym1) fmt=coff ;; - a29k-*-vxworks*) fmt=coff ;; - alpha-*-*vms*) fmt=evax ;; alpha-*-osf*) fmt=ecoff ;; alpha-*-linuxecoff*) fmt=ecoff ;; @@ -161,11 +153,7 @@ case ${generic_target} in hppa-*-bsd*) fmt=som em=hppa ;; hppa-*-hiux*) fmt=som em=hppa ;; - h8300-*-rtemscoff*) fmt=coff ;; - h8300-*-coff) fmt=coff ;; h8300-*-elf | h8300-*-rtems*) fmt=elf ;; - h8500-*-rtems*) fmt=coff ;; - h8500-*-coff) fmt=coff ;; i370-*-elf* | i370-*-linux*) fmt=elf ;; @@ -225,13 +213,6 @@ case ${generic_target} in i860-*-*) fmt=elf endian=little ;; - i960-*-bout) fmt=bout ;; - i960-*-coff) fmt=coff em=ic960 ;; - i960-*-rtems*) fmt=coff em=ic960 ;; - i960-*-nindy*) fmt=bout ;; - i960-*-vxworks5.0) fmt=bout ;; - i960-*-vxworks5.*) fmt=coff em=ic960 ;; - i960-*-vxworks*) fmt=bout ;; i960-*-elf*) fmt=elf ;; ia64-*-elf*) fmt=elf ;; @@ -252,31 +233,17 @@ case ${generic_target} in m68hc11-*-* | m6811-*-*) fmt=elf ;; m68hc12-*-* | m6812-*-*) fmt=elf ;; - m68k-*-vxworks*) fmt=aout em=sun3 ;; - m68k-ericsson-ose) fmt=aout em=sun3 ;; - m68k-*-sunos*) fmt=aout em=sun3 ;; - m68k-motorola-sysv*) fmt=coff em=delta ;; - m68k-bull-sysv3*) fmt=coff em=dpx2 ;; - m68k-apollo-*) fmt=coff em=apollo ;; m68k-*-elf*) fmt=elf ;; m68k-*-sysv4*) fmt=elf em=svr4 ;; - m68k-*-sysv*) fmt=coff ;; - m68k-*-coff | m68k-*-rtemscoff*) fmt=coff ;; m68k-*-rtems*) fmt=elf ;; - m68k-*-hpux*) fmt=hp300 em=hp300 ;; - m68k-*-linux*aout*) fmt=aout em=linux ;; m68k-*-linux-*) fmt=elf em=linux ;; m68k-*-uclinux*) fmt=elf ;; m68k-*-gnu*) fmt=elf ;; m68k-*-netbsdelf*) fmt=elf em=nbsd ;; m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - m68k-apple-aux*) fmt=coff em=aux ;; m68k-*-psos*) fmt=elf em=psos;; - m88k-motorola-sysv3*) fmt=coff em=delt88 ;; - m88k-*-coff*) fmt=coff ;; - maxq-*-coff) fmt=coff bfd_gas=yes ;; mcore-*-elf) fmt=elf ;; @@ -320,7 +287,6 @@ case ${generic_target} in openrisc-*-*) fmt=elf ;; or32-*-rtems*) fmt=elf ;; - or32-*-coff) fmt=coff ;; or32-*-elf) fmt=elf ;; pj*) fmt=elf ;; @@ -391,19 +357,14 @@ case ${generic_target} in tic30-*-*coff*) fmt=coff bfd_gas=yes ;; tic4x-*-* | c4x-*-*) fmt=coff bfd_gas=yes ;; tic54x-*-* | c54x*-*-*) fmt=coff bfd_gas=yes need_libm=yes;; - tic80-*-*) fmt=coff ;; v850-*-*) fmt=elf ;; v850e-*-*) fmt=elf ;; v850ea-*-*) fmt=elf ;; vax-*-netbsdelf*) fmt=elf em=nbsd ;; - vax-*-netbsd*) fmt=aout em=nbsd ;; - vax-*-bsd* | vax-*-ultrix*) fmt=aout ;; vax-*-linux-*) fmt=elf em=linux ;; - w65-*-*) fmt=coff ;; - xscale-*-coff) fmt=coff ;; xscale-*-elf) fmt=elf ;; @@ -415,7 +376,6 @@ case ${generic_target} in *-*-aout | *-*-scout) fmt=aout ;; *-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;; - *-*-nindy*) fmt=bout ;; *-*-bsd*) fmt=aout em=sun3 ;; *-*-generic) fmt=generic ;; *-*-xray | *-*-hms) fmt=coff ;; @@ -436,3 +396,8 @@ case ${fmt} in bfd_gas=yes ;; esac + +if test $bfd_gas != yes; then + echo This target is no longer supported in gas + exit 1 +fi diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am index cef2366..0fdbe83 100644 --- a/gas/doc/Makefile.am +++ b/gas/doc/Makefile.am @@ -24,14 +24,12 @@ asconfig.texi: $(CONFIG).texi || cp $(srcdir)/$(CONFIG).texi ./asconfig.texi CPU_DOCS = \ - c-a29k.texi \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ - c-h8500.texi \ c-hppa.texi \ c-i370.texi \ c-i386.texi \ @@ -42,7 +40,6 @@ CPU_DOCS = \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ - c-m88k.texi \ c-mips.texi \ c-mmix.texi \ c-msp430.texi \ diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index 20f8a9a..04de817 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -215,14 +215,12 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 info_TEXINFOS = as.texinfo CPU_DOCS = \ - c-a29k.texi \ c-alpha.texi \ c-arc.texi \ c-arm.texi \ c-d10v.texi \ c-cris.texi \ c-h8300.texi \ - c-h8500.texi \ c-hppa.texi \ c-i370.texi \ c-i386.texi \ @@ -233,7 +231,6 @@ CPU_DOCS = \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ - c-m88k.texi \ c-mips.texi \ c-mmix.texi \ c-msp430.texi \ diff --git a/gas/doc/all.texi b/gas/doc/all.texi index 622e8c4..6eb0e2a 100644 --- a/gas/doc/all.texi +++ b/gas/doc/all.texi @@ -20,14 +20,12 @@ @c Object formats of interest @c ========================== @set AOUT -@set BOUT @set COFF @set ELF @set SOM @c CPUs of interest @c ================ -@set A29K @set ALPHA @set ARC @set ARM @@ -35,7 +33,6 @@ @set D10V @set D30V @set H8/300 -@set H8/500 @set HPPA @set I370 @set I80386 @@ -47,7 +44,6 @@ @set M32R @set M68HC11 @set M680X0 -@set M880X0 @set MCORE @set MIPS @set MMIX @@ -60,7 +56,6 @@ @set TIC54X @set V850 @set VAX -@set VXWORKS @set XTENSA @set Z8000 diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 42580e4..a68a35c 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -45,9 +45,6 @@ @ifset H8/300 @set H8 @end ifset -@ifset H8/500 -@set H8 -@end ifset @ifset SH @set H8 @end ifset @@ -239,9 +236,6 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @c @c Target dependent options are listed below. Keep the list sorted. @c Add an empty line for separation. -@ifset A29K -@c am29k has no machine-dependent assembler options -@end ifset @ifset ALPHA @emph{Target Alpha options:} @@ -1177,10 +1171,6 @@ For information on the H8/300 machine instruction set, see @cite{H8/300 Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series Programming Manual} (Renesas). @end ifset -@ifset H8/500 -For information on the H8/500 machine instruction set, see @cite{H8/500 -Series Programming Manual} (Renesas M21T001). -@end ifset @ifset SH For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set, see @cite{SH-Microcomputer User's Manual} (Renesas) or @@ -1270,10 +1260,6 @@ For the @value{TARGET} target, @command{@value{AS}} is configured to produce @value{OBJ-NAME} format object files. @end ifclear @c The following should exhaust all configs that set MULTI-OBJ, ideally -@ifset A29K -On the @value{TARGET}, @command{@value{AS}} can be configured to produce either -@code{a.out} or COFF format object files. -@end ifset @ifset I960 On the @value{TARGET}, @command{@value{AS}} can be configured to produce either @code{b.out} or COFF format object files. @@ -1440,14 +1426,6 @@ the current input file is used. If a logical line number was given @ifset GENERIC (@pxref{Line,,@code{.line}}) @end ifset -@ifclear GENERIC -@ifclear A29K -(@pxref{Line,,@code{.line}}) -@end ifclear -@ifset A29K -(@pxref{Ln,,@code{.ln}}) -@end ifset -@end ifclear then it is used to calculate the number printed, otherwise the actual line in the current source file is printed. The message text is intended to be self explanatory (in the grand Unix @@ -2087,9 +2065,6 @@ This means you may not nest these comments. @cindex line comment character Anything from the @dfn{line comment} character to the next newline is considered a comment and is ignored. The line comment character is -@ifset A29K -@samp{;} for the AMD 29K family; -@end ifset @ifset ARC @samp{;} on the ARC; @end ifset @@ -2099,9 +2074,6 @@ is considered a comment and is ignored. The line comment character is @ifset H8/300 @samp{;} for the H8/300 family; @end ifset -@ifset H8/500 -@samp{!} for the H8/500 family; -@end ifset @ifset HPPA @samp{;} for the HPPA; @end ifset @@ -2141,9 +2113,6 @@ is considered a comment and is ignored. The line comment character is @ifset M68HC11 @samp{#} on the 68HC11 and 68HC12; @end ifset -@ifset M880X0 -@samp{;} on the M880x0; -@end ifset @ifset VAX @samp{#} on the Vax; @end ifset @@ -2236,12 +2205,6 @@ the preceding statement. Newlines and semicolons within character constants are an exception: they do not end statements. @end ifclear @ifset abnormal-separator -@ifset A29K -A @dfn{statement} ends at a newline character (@samp{\n}) or an ``at'' -sign (@samp{@@}). The newline or at sign is considered part of the -preceding statement. Newlines and at signs within character constants -are an exception: they do not end statements. -@end ifset @ifset HPPA A @dfn{statement} ends at a newline character (@samp{\n}) or an exclamation point (@samp{!}). The newline or exclamation point is considered part of the @@ -2250,9 +2213,7 @@ constants are an exception: they do not end statements. @end ifset @ifset H8 A @dfn{statement} ends at a newline character (@samp{\n}); or (for the -H8/300) a dollar sign (@samp{$}); or (for the -Renesas-SH or the -H8/500) a semicolon +H8/300) a dollar sign (@samp{$}); or (for the Renesas-SH) a semicolon (@samp{;}). The newline or separator character is considered part of the preceding statement. Newlines and separators within character constants are an exception: they do not end statements. @@ -2471,12 +2432,9 @@ grave accent. A newline (or semicolon @samp{;}) @end ifclear @ifset abnormal-separator -@ifset A29K -(or at sign @samp{@@}) -@end ifset @ifset H8 (or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the -Renesas SH or H8/500) +Renesas SH) @end ifset @end ifset @end ifclear @@ -2579,8 +2537,7 @@ A letter, to tell @command{@value{AS}} the rest of the number is a flonum. 4.2 assembler seems to allow any of @samp{defghDEFGH}.) @end ignore -On the H8/300, H8/500, -Renesas / SuperH SH, +On the H8/300, Renesas / SuperH SH, and AMD 29K architectures, the letter must be one of the letters @samp{DFPRSX} (in upper or lower case). @@ -2593,9 +2550,6 @@ one of the letters @samp{DFT} (in upper or lower case). On the HPPA architecture, the letter must be @samp{E} (upper case only). @end ifset @ifclear GENERIC -@ifset A29K -One of the letters @samp{DFPRSX} (in upper or lower case). -@end ifset @ifset ARC One of the letters @samp{DFRS} (in upper or lower case). @end ifset @@ -2716,8 +2670,7 @@ run-time addresses to sections is called @dfn{relocation}. It includes the task of adjusting mentions of object-file addresses so they refer to the proper run-time addresses. @ifset H8 -For the H8/300 and H8/500, -and for the Renesas / SuperH SH, +For the H8/300, and for the Renesas / SuperH SH, @command{@value{AS}} pads sections if needed to ensure they end on a word (sixteen bit) boundary. @end ifset @@ -3009,7 +2962,7 @@ of @command{@value{AS}}.) @end ifset @ifclear GENERIC @ifset H8 -On the H8/300 and H8/500 platforms, each subsection is zero-padded to a word +On the H8/300 platform, each subsection is zero-padded to a word boundary (two bytes). The same is true on the Renesas SH. @end ifset @@ -3021,10 +2974,6 @@ The same is true on the Renesas SH. @c these paragraphs might need to vanish from this manual, and be @c discussed in BFD chapter of binutils (or some such). @end ifset -@ifset A29K -On the AMD 29K family, no particular padding is added to section or -subsection sizes; @value{AS} forces no alignment on this platform. -@end ifset @end ifclear Subsections appear in your object file in numeric order, lowest numbered @@ -3170,15 +3119,10 @@ noted in @ref{Machine Dependencies}. That character may be followed by any string of digits, letters, dollar signs (unless otherwise noted in @ref{Machine Dependencies}), and underscores. @end ifclear -@ifset A29K -For the AMD 29K family, @samp{?} is also allowed in the -body of a symbol name, though not at its beginning. -@end ifset - @ifset SPECIAL-SYMS @ifset H8 Symbol names begin with a letter or with one of @samp{._}. On the -Renesas SH or the H8/500, you can also use @code{$} in symbol names. That +Renesas SH you can also use @code{$} in symbol names. That character may be followed by any string of digits, letters, dollar signs (save on the H8/300), and underscores. @end ifset @@ -3300,11 +3244,6 @@ directive. Thus, the expression @samp{.=.+4} is the same as saying @ifclear no-space-dir @samp{.space 4}. @end ifclear -@ifset no-space-dir -@ifset A29K -@samp{.block 4}. -@end ifset -@end ifset @node Symbol Attributes @section Symbol Attributes @@ -3937,7 +3876,7 @@ required alignment; this can be useful if you want the alignment to be filled with no-op instructions when appropriate. The way the required alignment is specified varies from system to system. -For the a29k, arc, hppa, i386 using ELF, i860, iq2000, m68k, m88k, or32, +For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32, s390, sparc, tic4x, tic80 and xtensa, the first expression is the alignment request in bytes. For example @samp{.align 8} advances the location counter until it is a multiple of 8. If the location counter @@ -4329,10 +4268,6 @@ recognized whether or not it is surrounded by quotes @samp{"}; but if you wish to specify an empty file name, you must give the quotes--@code{""}. This statement may go away in future: it is only recognized to be compatible with old @command{@value{AS}} programs. -@ifset A29K -In some configurations of @command{@value{AS}}, @code{.file} has already been -removed to avoid conflicts with other assemblers. @xref{Machine Dependencies}. -@end ifset @end ifclear @node Fill @@ -4588,7 +4523,7 @@ of target the assembly is for. @ifclear GENERIC @ifset H8 -On the H8/500 and most forms of the H8/300, @code{.int} emits 16-bit +On most forms of the H8/300, @code{.int} emits 16-bit integers. On the H8/300H and the Renesas SH, however, @code{.int} emits 32-bit integers. @end ifset @@ -4724,12 +4659,6 @@ reported as on logical line number @var{line-number} @minus{} 1. One day @command{@value{AS}} will no longer support this directive: it is recognized only for compatibility with existing assembler programs. -@ifset GENERIC -@ifset A29K -@emph{Warning:} In the AMD29K configuration of @value{AS}, this command is -not available; use the synonym @code{.ln} in that context. -@end ifset -@end ifset @end ifset @ifclear no-line-dir @@ -5625,21 +5554,6 @@ for a summary. @end ifset @end ifclear -@ifset A29K -@ifclear GENERIC -@node Space -@section @code{.space} -@cindex @code{space} directive -@end ifclear -On the AMD 29K, this directive is ignored; it is accepted for -compatibility with other AMD 29K assemblers. - -@quotation -@emph{Warning:} In most versions of the @sc{gnu} assembler, the directive -@code{.space} has the effect of @code{.block} @xref{Machine Dependencies}. -@end quotation -@end ifset - @ifset have-stabs @node Stab @section @code{.stabd, .stabn, .stabs} @@ -6088,9 +6002,6 @@ include details on any machine's instruction set. For details on that subject, see the hardware manufacturer's manual. @menu -@ifset A29K -* AMD29K-Dependent:: AMD 29K Dependent Features -@end ifset @ifset ALPHA * Alpha-Dependent:: Alpha Dependent Features @end ifset @@ -6112,9 +6023,6 @@ subject, see the hardware manufacturer's manual. @ifset H8/300 * H8/300-Dependent:: Renesas H8/300 Dependent Features @end ifset -@ifset H8/500 -* H8/500-Dependent:: Renesas H8/500 Dependent Features -@end ifset @ifset HPPA * HPPA-Dependent:: HPPA Dependent Features @end ifset @@ -6148,9 +6056,6 @@ subject, see the hardware manufacturer's manual. @ifset M68HC11 * M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features @end ifset -@ifset M880X0 -* M88K-Dependent:: M880x0 Dependent Features -@end ifset @ifset MIPS * MIPS-Dependent:: MIPS Dependent Features @end ifset @@ -6204,10 +6109,6 @@ subject, see the hardware manufacturer's manual. @c node and sectioning commands; hence the repetition of @chapter BLAH @c in both conditional blocks. -@ifset A29K -@include c-a29k.texi -@end ifset - @ifset ALPHA @include c-alpha.texi @end ifset @@ -6236,7 +6137,6 @@ family. @menu * H8/300-Dependent:: Renesas H8/300 Dependent Features -* H8/500-Dependent:: Renesas H8/500 Dependent Features * SH-Dependent:: Renesas SH Dependent Features @end menu @lowersections @@ -6255,10 +6155,6 @@ family. @include c-h8300.texi @end ifset -@ifset H8/500 -@include c-h8500.texi -@end ifset - @ifset HPPA @include c-hppa.texi @end ifset @@ -6303,10 +6199,6 @@ family. @include c-m68hc11.texi @end ifset -@ifset M880X0 -@include c-m88k.texi -@end ifset - @ifset MIPS @include c-mips.texi @end ifset @@ -6616,8 +6508,8 @@ Keith Knowles at the Open Software Foundation wrote the original MIPS back end (which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to support a.out format. -Support for the Zilog Z8k and Renesas H8/300 and H8/500 processors (tc-z8k, -tc-h8300, tc-h8500), and IEEE 695 object file format (obj-ieee), was written by +Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k, +tc-h8300), and IEEE 695 object file format (obj-ieee), was written by Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to use BFD for some low-level operations, for use with the H8/300 and AMD 29k targets. diff --git a/gas/doc/c-a29k.texi b/gas/doc/c-a29k.texi deleted file mode 100644 index 222cfef..0000000 --- a/gas/doc/c-a29k.texi +++ /dev/null @@ -1,182 +0,0 @@ -@c Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. -@ifset GENERIC -@page -@node AMD29K-Dependent -@chapter AMD 29K Dependent Features -@end ifset -@ifclear GENERIC -@node Machine Dependencies -@chapter AMD 29K Dependent Features -@end ifclear - -@cindex AMD 29K support -@cindex 29K support -@menu -* AMD29K Options:: Options -* AMD29K Syntax:: Syntax -* AMD29K Floating Point:: Floating Point -* AMD29K Directives:: AMD 29K Machine Directives -* AMD29K Opcodes:: Opcodes -@end menu - -@node AMD29K Options -@section Options -@cindex AMD 29K options (none) -@cindex options for AMD29K (none) -@code{@value{AS}} has no additional command-line options for the AMD -29K family. - -@node AMD29K Syntax -@section Syntax -@menu -* AMD29K-Macros:: Macros -* AMD29K-Chars:: Special Characters -* AMD29K-Regs:: Register Names -@end menu - -@node AMD29K-Macros -@subsection Macros - -@cindex Macros, AMD 29K -@cindex AMD 29K macros -The macro syntax used on the AMD 29K is like that described in the AMD -29K Family Macro Assembler Specification. Normal @code{@value{AS}} -macros should still work. - -@node AMD29K-Chars -@subsection Special Characters - -@cindex line comment character, AMD 29K -@cindex AMD 29K line comment character -@samp{;} is the line comment character. - -@cindex identifiers, AMD 29K -@cindex AMD 29K identifiers -The character @samp{?} is permitted in identifiers (but may not begin -an identifier). - -@node AMD29K-Regs -@subsection Register Names - -@cindex AMD 29K register names -@cindex register names, AMD 29K -General-purpose registers are represented by predefined symbols of the -form @samp{GR@var{nnn}} (for global registers) or @samp{LR@var{nnn}} -(for local registers), where @var{nnn} represents a number between -@code{0} and @code{127}, written with no leading zeros. The leading -letters may be in either upper or lower case; for example, @samp{gr13} -and @samp{LR7} are both valid register names. - -You may also refer to general-purpose registers by specifying the -register number as the result of an expression (prefixed with @samp{%%} -to flag the expression as a register number): -@smallexample -%%@var{expression} -@end smallexample -@noindent ----where @var{expression} must be an absolute expression evaluating to a -number between @code{0} and @code{255}. The range [0, 127] refers to -global registers, and the range [128, 255] to local registers. - -@cindex special purpose registers, AMD 29K -@cindex AMD 29K special purpose registers -@cindex protected registers, AMD 29K -@cindex AMD 29K protected registers -In addition, @code{@value{AS}} understands the following protected -special-purpose register names for the AMD 29K family: - -@smallexample - vab chd pc0 - ops chc pc1 - cps rbp pc2 - cfg tmc mmu - cha tmr lru -@end smallexample - -These unprotected special-purpose register names are also recognized: -@smallexample - ipc alu fpe - ipa bp inte - ipb fc fps - q cr exop -@end smallexample - -@node AMD29K Floating Point -@section Floating Point - -@cindex floating point, AMD 29K (@sc{ieee}) -@cindex AMD 29K floating point (@sc{ieee}) -The AMD 29K family uses @sc{ieee} floating-point numbers. - -@node AMD29K Directives -@section AMD 29K Machine Directives - -@cindex machine directives, AMD 29K -@cindex AMD 29K machine directives -@table @code -@cindex @code{block} directive, AMD 29K -@item .block @var{size} , @var{fill} -This directive emits @var{size} bytes, each of value @var{fill}. Both -@var{size} and @var{fill} are absolute expressions. If the comma -and @var{fill} are omitted, @var{fill} is assumed to be zero. - -In other versions of the @sc{gnu} assembler, this directive is called -@samp{.space}. -@end table - -@table @code -@cindex @code{cputype} directive, AMD 29K -@item .cputype -This directive is ignored; it is accepted for compatibility with other -AMD 29K assemblers. - -@cindex @code{file} directive, AMD 29K -@item .file -This directive is ignored; it is accepted for compatibility with other -AMD 29K assemblers. - -@quotation -@emph{Warning:} in other versions of the @sc{gnu} assembler, @code{.file} is -used for the directive called @code{.app-file} in the AMD 29K support. -@end quotation - -@cindex @code{line} directive, AMD 29K -@item .line -This directive is ignored; it is accepted for compatibility with other -AMD 29K assemblers. - -@ignore -@c since we're ignoring .lsym... -@cindex @code{reg} directive, AMD 29K -@item .reg @var{symbol}, @var{expression} -@code{.reg} has the same effect as @code{.lsym}; @pxref{Lsym,,@code{.lsym}}. -@end ignore - -@cindex @code{sect} directive, AMD 29K -@item .sect -This directive is ignored; it is accepted for compatibility with other -AMD 29K assemblers. - -@cindex @code{use} directive, AMD 29K -@item .use @var{section name} -Establishes the section and subsection for the following code; -@var{section name} may be one of @code{.text}, @code{.data}, -@code{.data1}, or @code{.lit}. With one of the first three @var{section -name} options, @samp{.use} is equivalent to the machine directive -@var{section name}; the remaining case, @samp{.use .lit}, is the same as -@samp{.data 200}. -@end table - -@node AMD29K Opcodes -@section Opcodes - -@cindex AMD 29K opcodes -@cindex opcodes for AMD 29K -@code{@value{AS}} implements all the standard AMD 29K opcodes. No -additional pseudo-instructions are needed on this family. - -For information on the 29K machine instruction set, see @cite{Am29000 -User's Manual}, Advanced Micro Devices, Inc. - diff --git a/gas/doc/c-h8500.texi b/gas/doc/c-h8500.texi deleted file mode 100644 index 837a35c..0000000 --- a/gas/doc/c-h8500.texi +++ /dev/null @@ -1,273 +0,0 @@ -@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 2003 -@c Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. -@page -@node H8/500-Dependent -@chapter H8/500 Dependent Features - -@cindex H8/500 support -@menu -* H8/500 Options:: Options -* H8/500 Syntax:: Syntax -* H8/500 Floating Point:: Floating Point -* H8/500 Directives:: H8/500 Machine Directives -* H8/500 Opcodes:: Opcodes -@end menu - -@node H8/500 Options -@section Options - -@cindex H8/500 options (none) -@cindex options, H8/500 (none) -@code{@value{AS}} has no additional command-line options for the -Renesas (formerly Hitachi) H8/500 family. - -@node H8/500 Syntax -@section Syntax - -@menu -* H8/500-Chars:: Special Characters -* H8/500-Regs:: Register Names -* H8/500-Addressing:: Addressing Modes -@end menu - -@node H8/500-Chars -@subsection Special Characters - -@cindex line comment character, H8/500 -@cindex H8/500 line comment character -@samp{!} is the line comment character. - -@cindex line separator, H8/500 -@cindex statement separator, H8/500 -@cindex H8/500 line separator -@samp{;} can be used instead of a newline to separate statements. - -@cindex symbol names, @samp{$} in -@cindex @code{$} in symbol names -Since @samp{$} has no special meaning, you may use it in symbol names. - -@node H8/500-Regs -@subsection Register Names - -@cindex H8/500 registers -@cindex registers, H8/500 -You can use the predefined symbols @samp{r0}, @samp{r1}, @samp{r2}, -@samp{r3}, @samp{r4}, @samp{r5}, @samp{r6}, and @samp{r7} to refer to -the H8/500 registers. - -The H8/500 also has these control registers: - -@table @code -@item cp -code pointer - -@item dp -data pointer - -@item bp -base pointer - -@item tp -stack top pointer - -@item ep -extra pointer - -@item sr -status register - -@item ccr -condition code register -@end table - -All registers are 16 bits long. To represent 32 bit numbers, use two -adjacent registers; for distant memory addresses, use one of the segment -pointers (@code{cp} for the program counter; @code{dp} for -@code{r0}--@code{r3}; @code{ep} for @code{r4} and @code{r5}; and -@code{tp} for @code{r6} and @code{r7}. - -@node H8/500-Addressing -@subsection Addressing Modes - -@cindex addressing modes, H8/500 -@cindex H8/500 addressing modes -@value{AS} understands the following addressing modes for the H8/500: -@table @code -@item R@var{n} -Register direct - -@item @@R@var{n} -Register indirect - -@item @@(d:8, R@var{n}) -Register indirect with 8 bit signed displacement - -@item @@(d:16, R@var{n}) -Register indirect with 16 bit signed displacement - -@item @@-R@var{n} -Register indirect with pre-decrement - -@item @@R@var{n}+ -Register indirect with post-increment - -@item @@@var{aa}:8 -8 bit absolute address - -@item @@@var{aa}:16 -16 bit absolute address - -@item #@var{xx}:8 -8 bit immediate - -@item #@var{xx}:16 -16 bit immediate -@end table - -@node H8/500 Floating Point -@section Floating Point - -@cindex floating point, H8/500 (@sc{ieee}) -@cindex H8/500 floating point (@sc{ieee}) -The H8/500 family has no hardware floating point, but the @code{.float} -directive generates @sc{ieee} floating-point numbers for compatibility -with other development tools. - -@node H8/500 Directives -@section H8/500 Machine Directives - -@cindex H8/500 machine directives (none) -@cindex machine directives, H8/500 (none) -@cindex @code{word} directive, H8/500 -@cindex @code{int} directive, H8/500 -@code{@value{AS}} has no machine-dependent directives for the H8/500. -However, on this platform the @samp{.int} and @samp{.word} directives -generate 16-bit numbers. - -@node H8/500 Opcodes -@section Opcodes - -@cindex H8/500 opcode summary -@cindex opcode summary, H8/500 -@cindex mnemonics, H8/500 -@cindex instruction summary, H8/500 -For detailed information on the H8/500 machine instruction set, see -@cite{H8/500 Series Programming Manual} (Renesas M21T001). - -@code{@value{AS}} implements all the standard H8/500 opcodes. No additional -pseudo-instructions are needed on this family. - -@ifset SMALL -@c this table, due to the multi-col faking and hardcoded order, looks silly -@c except in smallbook. See comments below "@set SMALL" near top of this file. - -The following table summarizes H8/500 opcodes and their operands: - -@c Use @group if it ever works, instead of @page -@page -@smallexample -@i{Legend:} -abs8 @r{8-bit absolute address} -abs16 @r{16-bit absolute address} -abs24 @r{24-bit absolute address} -crb @r{@code{ccr}, @code{br}, @code{ep}, @code{dp}, @code{tp}, @code{dp}} -disp8 @r{8-bit displacement} -ea @r{@code{rn}, @code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},} - @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16},} - @r{@code{#xx:8}, @code{#xx:16}} -ea_mem @r{@code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},} - @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16}} -ea_noimm @r{@code{rn}, @code{@@rn}, @code{@@(d:8, rn)}, @code{@@(d:16, rn)},} - @r{@code{@@-rn}, @code{@@rn+}, @code{@@aa:8}, @code{@@aa:16}} -fp r6 -imm4 @r{4-bit immediate data} -imm8 @r{8-bit immediate data} -imm16 @r{16-bit immediate data} -pcrel8 @r{8-bit offset from program counter} -pcrel16 @r{16-bit offset from program counter} -qim @r{@code{-2}, @code{-1}, @code{1}, @code{2}} -rd @r{any register} -rs @r{a register distinct from rd} -rlist @r{comma-separated list of registers in parentheses;} - @r{register ranges @code{rd-rs} are allowed} -sp @r{stack pointer (@code{r7})} -sr @r{status register} -sz @r{size; @samp{.b} or @samp{.w}. If omitted, default @samp{.w}} - -ldc[.b] ea,crb bcc[.w] pcrel16 -ldc[.w] ea,sr bcc[.b] pcrel8 -add[:q] sz qim,ea_noimm bhs[.w] pcrel16 -add[:g] sz ea,rd bhs[.b] pcrel8 -adds sz ea,rd bcs[.w] pcrel16 -addx sz ea,rd bcs[.b] pcrel8 -and sz ea,rd blo[.w] pcrel16 -andc[.b] imm8,crb blo[.b] pcrel8 -andc[.w] imm16,sr bne[.w] pcrel16 -bpt bne[.b] pcrel8 -bra[.w] pcrel16 beq[.w] pcrel16 -bra[.b] pcrel8 beq[.b] pcrel8 -bt[.w] pcrel16 bvc[.w] pcrel16 -bt[.b] pcrel8 bvc[.b] pcrel8 -brn[.w] pcrel16 bvs[.w] pcrel16 -brn[.b] pcrel8 bvs[.b] pcrel8 -bf[.w] pcrel16 bpl[.w] pcrel16 -bf[.b] pcrel8 bpl[.b] pcrel8 -bhi[.w] pcrel16 bmi[.w] pcrel16 -bhi[.b] pcrel8 bmi[.b] pcrel8 -bls[.w] pcrel16 bge[.w] pcrel16 -bls[.b] pcrel8 bge[.b] pcrel8 -@page -blt[.w] pcrel16 mov[:g][.b] imm8,ea_mem -blt[.b] pcrel8 mov[:g][.w] imm16,ea_mem -bgt[.w] pcrel16 movfpe[.b] ea,rd -bgt[.b] pcrel8 movtpe[.b] rs,ea_noimm -ble[.w] pcrel16 mulxu sz ea,rd -ble[.b] pcrel8 neg sz ea -bclr sz imm4,ea_noimm nop -bclr sz rs,ea_noimm not sz ea -bnot sz imm4,ea_noimm or sz ea,rd -bnot sz rs,ea_noimm orc[.b] imm8,crb -bset sz imm4,ea_noimm orc[.w] imm16,sr -bset sz rs,ea_noimm pjmp abs24 -bsr[.b] pcrel8 pjmp @@rd -bsr[.w] pcrel16 pjsr abs24 -btst sz imm4,ea_noimm pjsr @@rd -btst sz rs,ea_noimm prtd imm8 -clr sz ea prtd imm16 -cmp[:e][.b] imm8,rd prts -cmp[:i][.w] imm16,rd rotl sz ea -cmp[:g].b imm8,ea_noimm rotr sz ea -cmp[:g][.w] imm16,ea_noimm rotxl sz ea -Cmp[:g] sz ea,rd rotxr sz ea -dadd rs,rd rtd imm8 -divxu sz ea,rd rtd imm16 -dsub rs,rd rts -exts[.b] rd scb/f rs,pcrel8 -extu[.b] rd scb/ne rs,pcrel8 -jmp @@rd scb/eq rs,pcrel8 -jmp @@(imm8,rd) shal sz ea -jmp @@(imm16,rd) shar sz ea -jmp abs16 shll sz ea -jsr @@rd shlr sz ea -jsr @@(imm8,rd) sleep -jsr @@(imm16,rd) stc[.b] crb,ea_noimm -jsr abs16 stc[.w] sr,ea_noimm -ldm @@sp+,(rlist) stm (rlist),@@-sp -link fp,imm8 sub sz ea,rd -link fp,imm16 subs sz ea,rd -mov[:e][.b] imm8,rd subx sz ea,rd -mov[:i][.w] imm16,rd swap[.b] rd -mov[:l][.w] abs8,rd tas[.b] ea -mov[:l].b abs8,rd trapa imm4 -mov[:s][.w] rs,abs8 trap/vs -mov[:s].b rs,abs8 tst sz ea -mov[:f][.w] @@(disp8,fp),rd unlk fp -mov[:f][.w] rs,@@(disp8,fp) xch[.w] rs,rd -mov[:f].b @@(disp8,fp),rd xor sz ea,rd -mov[:f].b rs,@@(disp8,fp) xorc.b imm8,crb -mov[:g] sz rs,ea_mem xorc.w imm16,sr -mov[:g] sz ea,rd -@end smallexample -@end ifset diff --git a/gas/doc/c-m88k.texi b/gas/doc/c-m88k.texi deleted file mode 100644 index c7bdb26..0000000 --- a/gas/doc/c-m88k.texi +++ /dev/null @@ -1,66 +0,0 @@ -@c Copyright 2001 Free Software Foundation, Inc. -@c This is part of the GAS manual. -@c For copying conditions, see the file as.texinfo. -@page -@node M88K-Dependent -@chapter Motorola M88K Dependent Features - -@cindex M88K support -@menu -* M88K Directives:: M88K Machine Directives -@end menu - -@node M88K Directives -@section M88K Machine Directives - -The M88K version of the assembler supports the following machine -directives: - -@table @code -@cindex @code{align} directive, M88K -@item .align -This directive aligns the section program counter on the next 4-byte -boundary. - -@cindex @code{dfloat} directive, M88K -@item .dfloat @var{expr} -This assembles a double precision (64-bit) floating point constant. - -@cindex @code{ffloat} directive, M88K -@item .ffloat @var{expr} -This assembles a single precision (32-bit) floating point constant. - -@cindex @code{half} directive, M88K -@item .half @var{expr} -This directive assembles a half-word (16-bit) constant. - -@cindex @code{word} directive, M88K -@item .word @var{expr} -This assembles a word (32-bit) constant. - -@cindex @code{string} directive, M88K -@item .string "@var{str}" -This directive behaves like the standard @code{.ascii} directive for -copying @var{str} into the object file. The string is not terminated -with a null byte. - -@cindex @code{set} directive, M88K -@item .set @var{symbol}, @var{value} -This directive creates a symbol named @var{symbol} which is an alias for -another symbol (possibly not yet defined). This should not be confused -with the mnemonic @code{set}, which is a legitimate M88K instruction. - -@cindex @code{def} directive, M88K -@item .def @var{symbol}, @var{value} -This directive is synonymous with @code{.set} and is presumably provided -for compatibility with other M88K assemblers. - -@cindex @code{bss} directive, M88K -@item .bss @var{symbol}, @var{length}, @var{align} -Reserve @var{length} bytes in the bss section for a local @var{symbol}, -aligned to the power of two specified by @var{align}. @var{length} and -@var{align} must be positive absolute expressions. This directive -differs from @samp{.lcomm} only in that it permits you to specify -an alignment. @xref{Lcomm,,@code{.lcomm}}. - -@end table diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index 150804a..d54e233 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -42,11 +42,7 @@ #endif #ifndef EH_FRAME_ALIGNMENT -# ifdef BFD_ASSEMBLER -# define EH_FRAME_ALIGNMENT (bfd_get_arch_size (stdoutput) == 64 ? 3 : 2) -# else -# define EH_FRAME_ALIGNMENT 2 -# endif +# define EH_FRAME_ALIGNMENT (bfd_get_arch_size (stdoutput) == 64 ? 3 : 2) #endif #ifndef tc_cfi_frame_initial_instructions @@ -1032,10 +1028,8 @@ cfi_finish (void) /* Open .eh_frame section. */ cfi_seg = subseg_new (".eh_frame", 0); -#ifdef BFD_ASSEMBLER bfd_set_section_flags (stdoutput, cfi_seg, SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY); -#endif subseg_set (cfi_seg, 0); record_alignment (cfi_seg, EH_FRAME_ALIGNMENT); diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 346f350..281177e 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -53,8 +53,6 @@ # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8) #endif -#ifdef BFD_ASSEMBLER - #include "subsegs.h" #include "elf/dwarf2.h" @@ -1424,54 +1422,3 @@ dwarf2_finish (void) out_debug_info (info_seg, abbrev_seg, line_seg); } } - -#else -void -dwarf2_finish () -{ -} - -int -dwarf2dbg_estimate_size_before_relax (frag) - fragS *frag ATTRIBUTE_UNUSED; -{ - as_fatal (_("dwarf2 is not supported for this object file format")); - return 0; -} - -int -dwarf2dbg_relax_frag (frag) - fragS *frag ATTRIBUTE_UNUSED; -{ - as_fatal (_("dwarf2 is not supported for this object file format")); - return 0; -} - -void -dwarf2dbg_convert_frag (frag) - fragS *frag ATTRIBUTE_UNUSED; -{ - as_fatal (_("dwarf2 is not supported for this object file format")); -} - -void -dwarf2_emit_insn (size) - int size ATTRIBUTE_UNUSED; -{ -} - -char * -dwarf2_directive_file (dummy) - int dummy ATTRIBUTE_UNUSED; -{ - s_app_file (0); - return NULL; -} - -void -dwarf2_directive_loc (dummy) - int dummy ATTRIBUTE_UNUSED; -{ - as_fatal (_("dwarf2 is not supported for this object file format")); -} -#endif /* BFD_ASSEMBLER */ diff --git a/gas/ehopt.c b/gas/ehopt.c index 73dd192..6b0ac51 100644 --- a/gas/ehopt.c +++ b/gas/ehopt.c @@ -1,5 +1,5 @@ /* ehopt.c--optimize gcc exception frame information. - Copyright 1998, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@cygnus.com>. This file is part of GAS, the GNU Assembler. @@ -111,16 +111,8 @@ get_cie_info (struct cie_info *info) /* We should find the CIE at the start of the section. */ -#if defined (BFD_ASSEMBLER) || defined (MANY_SEGMENTS) f = seg_info (now_seg)->frchainP->frch_root; -#else - f = frchain_now->frch_root; -#endif -#ifdef BFD_ASSEMBLER fix = seg_info (now_seg)->frchainP->fix_root; -#else - fix = *seg_fix_rootP; -#endif /* Look through the frags of the section to find the code alignment. */ diff --git a/gas/input-file.c b/gas/input-file.c index facd4d6..343f049 100644 --- a/gas/input-file.c +++ b/gas/input-file.c @@ -143,9 +143,7 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ if (f_in == NULL) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("Can't open %s for reading"), file_name); return; } @@ -154,9 +152,7 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ if (ferror (f_in)) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("Can't open %s for reading"), file_name); fclose (f_in); @@ -219,9 +215,7 @@ input_file_get (char *buf, int buflen) size = fread (buf, sizeof (char), buflen, f_in); if (size < 0) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("Can't read from %s"), file_name); size = 0; } @@ -248,9 +242,7 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new size = fread (where, sizeof (char), BUFFER_SIZE, f_in); if (size < 0) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("Can't read from %s"), file_name); size = 0; } @@ -260,9 +252,7 @@ input_file_give_next_buffer (char *where /* Where to place 1st character of new { if (fclose (f_in)) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("Can't close %s"), file_name); } f_in = (FILE *) 0; diff --git a/gas/listing.c b/gas/listing.c index e563b5c..61ef6f5 100644 --- a/gas/listing.c +++ b/gas/listing.c @@ -749,11 +749,10 @@ list_symbol_table (void) if (SEG_NORMAL (S_GET_SEGMENT (ptr)) || S_GET_SEGMENT (ptr) == absolute_section) { -#ifdef BFD_ASSEMBLER /* Don't report section symbols. They are not interesting. */ if (symbol_section_p (ptr)) continue; -#endif + if (S_GET_NAME (ptr)) { char buf[30], fmt[8]; @@ -1086,9 +1085,7 @@ listing_print (char *name) using_stdout = 0; else { -#ifdef BFD_ASSEMBLER - bfd_set_error (bfd_error_system_call); -#endif + bfd_set_error (bfd_error_system_call); as_perror (_("can't open list file: %s"), name); list_file = stdout; using_stdout = 1; @@ -1108,9 +1105,7 @@ listing_print (char *name) { if (fclose (list_file) == EOF) { -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_system_call); -#endif as_perror (_("error closing list file: %s"), name); } } diff --git a/gas/literal.c b/gas/literal.c index ea19e38..cc3a257 100644 --- a/gas/literal.c +++ b/gas/literal.c @@ -1,5 +1,5 @@ -/* as.c - GAS literal pool management. - Copyright 1994, 2000 Free Software Foundation, Inc. +/* literal.c - GAS literal pool management. + Copyright 1994, 2000, 2005 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com). This file is part of GAS, the GNU Assembler. @@ -39,7 +39,7 @@ #include "as.h" #include "subsegs.h" -#if defined (BFD_ASSEMBLER) && defined (NEED_LITERAL_POOL) +#ifdef NEED_LITERAL_POOL valueT add_to_literal_pool (sym, addend, sec, size) @@ -92,4 +92,4 @@ add_to_literal_pool (sym, addend, sec, size) seginfo->literal_pool_size += size; return offset; } -#endif /* BFD_ASSEMBLER */ +#endif diff --git a/gas/makefile.vms b/gas/makefile.vms deleted file mode 100644 index 41373c6..0000000 --- a/gas/makefile.vms +++ /dev/null @@ -1,115 +0,0 @@ -# -# makefile for gas -# -# Created by Klaus K"ampf, kkaempf@progis.de -# -CC=gcc -ifeq ($(ARCH),ALPHA) -ifeq ($(CC),gcc) -DEFS= -CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) -LFLAGS= -LIBS=,GNU_CC_LIBRARY:libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU_CC_LIBRARY:crt0.obj -else -DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\ -"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ -"_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec","const=") -CFLAGS=/noopt/nodebug/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS)\ -/warnings=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec) -LFLAGS= -LIBS=,sys$$library:vaxcrtl.olb/lib -endif - -else # ARCH not ALPHA - -ifeq ($(CC),gcc) -DEFS= -CFLAGS=/include=([],[.config],[-.include],[-])$(DEFS) -LFLAGS= -LIBS=,GNU_CC_LIBRARY:libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU_CC_LIBRARY:crtbegin.obj,GNU_CC_LIBRARY:crtend.obj -#LIBS=,gnu_cc:[000000]gcclib.olb/lib,sys$$library:vaxcrtl.olb/lib -else -error DECC is broken on VAX -DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten","const=") -CFLAGS=/noopt/debug/include=([],[.config],[-.include],[-])$(DEFS)\ -/warnings=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec) -LFLAGS= -LIBS=,sys$$library:vaxcrtl.olb/lib -endif -endif - - -OBJS=targ-cpu.obj,obj-format.obj,atof-targ.obj,app.obj,as.obj,atof-generic.obj,\ - cond.obj,depend.obj,expr.obj,flonum-konst.obj,flonum-copy.obj,\ - flonum-mult.obj,frags.obj,hash.obj,input-file.obj,input-scrub.obj,\ - literal.obj,messages.obj,output-file.obj,read.obj,subsegs.obj,symbols.obj,\ - write.obj,listing.obj,ecoff.obj,stabs.obj,sb.obj,macro.obj,ehopt.obj - -LIBIBERTY = [-.libiberty]libiberty.olb - -ifeq ($(ARCH),ALPHA) -LIBBFD = [-.bfd]libbfd.olb -LIBOPCODES = [-.opcodes]libopcodes.olb -BFDDEP = [-.bfd]bfd.h -else -LIBBFD = -LIBOPCODES = -BFDDEP = -endif - -all: config.status $(BFDDEP) as.exe - -as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY) -ifeq ($(ARCH),ALPHA) - link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) -else - link$(LFLAGS)/exe=$@ $(OBJS),$(LIBIBERTY)/lib$(LIBS) -endif - -config.status: - $$ @config-gas - -ifeq ($(ARCH),ALPHA) -CPU=alpha -OBJFORMAT=evax -FLTFORMAT=ieee -else -CPU=vax -OBJFORMAT=vms -FLTFORMAT=vax -endif - -targ-cpu.c: [.config]tc-$(CPU).c - copy $< $@ -targ-cpu.h: [.config]tc-$(CPU).h - copy $< $@ -targ-env.h: [.config]te-generic.h - copy $< $@ -obj-format.h: [.config]obj-$(OBJFORMAT).h - copy $< $@ -obj-format.c: [.config]obj-$(OBJFORMAT).c - copy $< $@ -atof-targ.c: [.config]atof-$(FLTFORMAT).c - copy $< $@ - -targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c - -[-.bfd]bfd.h: - $(CD) [-.bfd] - gmake -f makefile.vms "CC=$(CC)" - $(CD) [-.gas] - -install: as.exe - $(CP) $^ GNU_ROOT\:[BIN] - -clean: - $$ purge - $(RM) *.obj; - $(RM) *.exe; - $(RM) atof-targ.c; - $(RM) obj-format.c; - $(RM) obj-format.h; - $(RM) targ-env.h; - $(RM) targ-cpu.h; - $(RM) targ-cpu.c; - $(RM) config.status; diff --git a/gas/messages.c b/gas/messages.c index 8ce6bc7..a8e309d 100644 --- a/gas/messages.c +++ b/gas/messages.c @@ -1,6 +1,6 @@ /* messages.c - error reporter - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2003, 2004 + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -150,16 +150,10 @@ as_perror (const char *gripe, /* Unpunctuated error theme. */ as_show_where (); fprintf (stderr, gripe, filename); errno = saved_errno; -#ifdef BFD_ASSEMBLER errtxt = bfd_errmsg (bfd_get_error ()); -#else - errtxt = xstrerror (errno); -#endif fprintf (stderr, ": %s\n", errtxt); errno = 0; -#ifdef BFD_ASSEMBLER bfd_set_error (bfd_error_no_error); -#endif } /* Send to stderr a string as a warning, and locate warning @@ -477,13 +471,11 @@ sprint_value (char *buf, valueT val) sprintf (buf, "%ld", (long) val); return; } -#ifdef BFD_ASSEMBLER if (sizeof (val) <= sizeof (bfd_vma)) { sprintf_vma (buf, val); return; } -#endif abort (); } @@ -504,14 +496,12 @@ as_internal_value_out_of_range (char * prefix, if (prefix == NULL) prefix = ""; -#ifdef BFD_ASSEMBLER if ( val < HEX_MAX_THRESHOLD && min < HEX_MAX_THRESHOLD && max < HEX_MAX_THRESHOLD && val > HEX_MIN_THRESHOLD && min > HEX_MIN_THRESHOLD && max > HEX_MIN_THRESHOLD) -#endif { /* xgettext:c-format */ err = _("%s out of range (%d is not between %d and %d)"); @@ -523,7 +513,6 @@ as_internal_value_out_of_range (char * prefix, as_warn_where (file, line, err, prefix, (int) val, (int) min, (int) max); } -#ifdef BFD_ASSEMBLER else { char val_buf [sizeof (val) * 3 + 2]; @@ -545,7 +534,6 @@ as_internal_value_out_of_range (char * prefix, else as_warn_where (file, line, err, prefix, val_buf, min_buf, max_buf); } -#endif } void @@ -2,7 +2,7 @@ format backends. Copyright 1987, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999, 2000, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -29,13 +29,6 @@ void obj_emit_symbols (char **where, symbolS * symbols); #ifndef obj_read_begin_hook void obj_read_begin_hook (void); #endif -#ifndef BFD_ASSEMBLER -void obj_crawl_symbol_chain (object_headers * headers); -void obj_header_append (char **where, object_headers * headers); -#ifndef obj_pre_write_hook -void obj_pre_write_hook (object_headers * headers); -#endif -#endif #ifndef obj_symbol_new_hook void obj_symbol_new_hook (symbolS * symbolP); @@ -45,7 +38,6 @@ void obj_symbol_to_chars (char **where, symbolS * symbolP); extern const pseudo_typeS obj_pseudo_table[]; -#ifdef BFD_ASSEMBLER struct format_ops { int flavor; unsigned dfl_leading_underscore : 1; @@ -89,6 +81,5 @@ extern const struct format_ops aout_format_ops; #ifndef this_format COMMON const struct format_ops *this_format; #endif -#endif /* end of obj.h */ diff --git a/gas/output-file.c b/gas/output-file.c index 3ca3586..f94359a 100644 --- a/gas/output-file.c +++ b/gas/output-file.c @@ -1,6 +1,6 @@ /* output-file.c - Deal with the output file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,18 +25,10 @@ #include "output-file.h" -#ifdef BFD_HEADERS -#define USE_BFD -#endif - -#ifdef BFD_ASSEMBLER -#define USE_BFD #ifndef TARGET_MACH #define TARGET_MACH 0 #endif -#endif -#ifdef USE_BFD #include "bfd.h" bfd *stdoutput; @@ -56,9 +48,7 @@ output_file_create (char *name) } bfd_set_format (stdoutput, bfd_object); -#ifdef BFD_ASSEMBLER bfd_set_arch_mach (stdoutput, TARGET_ARCH, TARGET_MACH); -#endif if (flag_traditional_format) stdoutput->flags |= BFD_TRADITIONAL_FORMAT; } @@ -66,7 +56,6 @@ output_file_create (char *name) void output_file_close (char *filename) { -#ifdef BFD_ASSEMBLER /* Close the bfd. */ if (bfd_close (stdoutput) == 0) { @@ -74,84 +63,5 @@ output_file_close (char *filename) as_perror (_("FATAL: can't close %s\n"), filename); exit (EXIT_FAILURE); } -#else - /* Close the bfd without getting bfd to write out anything by itself. */ - if (bfd_close_all_done (stdoutput) == 0) - { - as_perror (_("FATAL: can't close %s\n"), filename); - exit (EXIT_FAILURE); - } -#endif stdoutput = NULL; /* Trust nobody! */ } - -#ifndef BFD_ASSEMBLER -void -output_file_append (char *where ATTRIBUTE_UNUSED, - long length ATTRIBUTE_UNUSED, - char *filename ATTRIBUTE_UNUSED) -{ - abort (); -} -#endif - -#else - -static FILE *stdoutput; - -void -output_file_create (char *name) -{ - if (name[0] == '-' && name[1] == '\0') - { - stdoutput = stdout; - return; - } - - stdoutput = fopen (name, FOPEN_WB); - if (stdoutput == NULL) - { -#ifdef BFD_ASSEMBLER - bfd_set_error (bfd_error_system_call); -#endif - as_perror (_("FATAL: can't create %s"), name); - exit (EXIT_FAILURE); - } -} - -void -output_file_close (char *filename) -{ - if (EOF == fclose (stdoutput)) - { -#ifdef BFD_ASSEMBLER - bfd_set_error (bfd_error_system_call); -#endif - as_perror (_("FATAL: can't close %s"), filename); - exit (EXIT_FAILURE); - } - - /* Trust nobody! */ - stdoutput = NULL; -} - -void -output_file_append (char * where, long length, char * filename) -{ - for (; length; length--, where++) - { - (void) putc (*where, stdoutput); - - if (ferror (stdoutput)) - { -#ifdef BFD_ASSEMBLER - bfd_set_error (bfd_error_system_call); -#endif - as_perror (_("Failed to emit an object byte"), filename); - as_fatal (_("can't continue")); - } - } -} - -#endif - diff --git a/gas/po/POTFILES.in b/gas/po/POTFILES.in index 285a017..14b172f 100644 --- a/gas/po/POTFILES.in +++ b/gas/po/POTFILES.in @@ -16,8 +16,6 @@ config/e-mipsecoff.c config/e-mipself.c config/obj-aout.c config/obj-aout.h -config/obj-bout.c -config/obj-bout.h config/obj-coff.c config/obj-coff.h config/obj-ecoff.c @@ -26,14 +24,10 @@ config/obj-elf.c config/obj-elf.h config/obj-evax.c config/obj-evax.h -config/obj-hp300.c -config/obj-hp300.h config/obj-ieee.c config/obj-ieee.h config/obj-som.c config/obj-som.h -config/tc-a29k.c -config/tc-a29k.h config/tc-alpha.c config/tc-alpha.h config/tc-arc.c @@ -58,8 +52,6 @@ config/tc-frv.c config/tc-frv.h config/tc-h8300.c config/tc-h8300.h -config/tc-h8500.c -config/tc-h8500.h config/tc-hppa.c config/tc-hppa.h config/tc-i370.c @@ -82,8 +74,6 @@ config/tc-m68hc11.c config/tc-m68hc11.h config/tc-m68k.c config/tc-m68k.h -config/tc-m88k.c -config/tc-m88k.h config/tc-mcore.c config/tc-mcore.h config/tc-mips.c @@ -116,20 +106,14 @@ config/tc-sh.c config/tc-sh.h config/tc-sparc.c config/tc-sparc.h -config/tc-tahoe.c -config/tc-tahoe.h config/tc-tic30.c config/tc-tic30.h config/tc-tic54x.c config/tc-tic54x.h -config/tc-tic80.c -config/tc-tic80.h config/tc-v850.c config/tc-v850.h config/tc-vax.c config/tc-vax.h -config/tc-w65.c -config/tc-w65.h config/tc-xstormy16.c config/tc-xstormy16.h config/tc-xtensa.c @@ -72,7 +72,6 @@ die horribly; #endif #ifndef LEX_AT -/* The m88k unfortunately uses @ as a label beginner. */ #define LEX_AT 0 #endif @@ -98,7 +97,6 @@ die horribly; #endif #ifndef LEX_DOLLAR -/* The a29k assembler does not permits labels to start with $. */ #define LEX_DOLLAR 3 #endif @@ -246,7 +244,6 @@ read_begin (void) } #ifndef TC_ADDRESS_BYTES -#ifdef BFD_ASSEMBLER #define TC_ADDRESS_BYTES address_bytes static inline int @@ -261,7 +258,6 @@ address_bytes (void) return n; } #endif -#endif /* Set up pseudo-op tables. */ @@ -823,8 +819,8 @@ read_a_source_file (char *name) #endif if (NO_PSEUDO_DOT || flag_m68k_mri) { - /* The MRI assembler and the m88k use pseudo-ops - without a period. */ + /* The MRI assembler uses pseudo-ops without + a period. */ pop = (pseudo_typeS *) hash_find (po_hash, s); if (pop != NULL && pop->poc_handler == NULL) pop = NULL; @@ -1265,11 +1261,7 @@ do_align (int n, char *fill, int len, int max) fill pattern. BYTES_P is non-zero if the alignment value should be interpreted as the byte boundary, rather than the power of 2. */ -#ifdef BFD_ASSEMBLER #define ALIGN_LIMIT (stdoutput->arch_info->bits_per_address - 1) -#else -#define ALIGN_LIMIT 15 -#endif static void s_align (int arg, int bytes_p) @@ -1449,9 +1441,7 @@ s_comm_internal (int param, temp = get_absolute_expr (&exp); size = temp; -#ifdef BFD_ASSEMBLER size &= ((offsetT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1; -#endif if (exp.X_op == O_absent) { as_bad (_("missing size expression")); @@ -2015,7 +2005,6 @@ s_linkonce (int ignore ATTRIBUTE_UNUSED) #ifdef obj_handle_link_once obj_handle_link_once (type); #else /* ! defined (obj_handle_link_once) */ -#ifdef BFD_ASSEMBLER { flagword flags; @@ -2045,9 +2034,6 @@ s_linkonce (int ignore ATTRIBUTE_UNUSED) as_bad (_("bfd_set_section_flags: %s"), bfd_errmsg (bfd_get_error ())); } -#else /* ! defined (BFD_ASSEMBLER) */ - as_warn (_(".linkonce is not supported for this object file format")); -#endif /* ! defined (BFD_ASSEMBLER) */ #endif /* ! defined (obj_handle_link_once) */ demand_empty_rest_of_line (); @@ -2070,11 +2056,9 @@ bss_alloc (symbolS *symbolP, addressT size, int align) { bss_seg = subseg_new (".sbss", 1); seg_info (bss_seg)->bss = 1; -#ifdef BFD_ASSEMBLER if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC)) as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ())); -#endif } } #endif @@ -2487,8 +2471,7 @@ s_org (int ignore ATTRIBUTE_UNUSED) called by the obj-format routine which handles section changing when in MRI mode. It will create a new section, and return it. It will set *TYPE to the section type: one of 'C' (code), 'D' (data), - 'M' (mixed), or 'R' (romable). If BFD_ASSEMBLER is defined, the - flags will be set in the section. */ + 'M' (mixed), or 'R' (romable). The flags will be set in the section. */ void s_mri_sect (char *type ATTRIBUTE_UNUSED) @@ -2542,7 +2525,6 @@ s_mri_sect (char *type ATTRIBUTE_UNUSED) as_bad (_("unrecognized section type")); ++input_line_pointer; -#ifdef BFD_ASSEMBLER { flagword flags; @@ -2561,7 +2543,6 @@ s_mri_sect (char *type ATTRIBUTE_UNUSED) bfd_errmsg (bfd_get_error ())); } } -#endif } /* Ignore the HP type. */ @@ -3201,9 +3182,6 @@ pseudo_set (symbolS *symbolP) { expressionS exp; segT seg; -#if (defined (OBJ_AOUT) || defined (OBJ_BOUT)) && ! defined (BFD_ASSEMBLER) - int ext; -#endif /* OBJ_AOUT or OBJ_BOUT */ know (symbolP); /* NULL pointer is logic error. */ @@ -3235,9 +3213,6 @@ pseudo_set (symbolS *symbolP) as_bad ("attempt to set value of section symbol"); return; } -#if (defined (OBJ_AOUT) || defined (OBJ_BOUT)) && ! defined (BFD_ASSEMBLER) - ext = S_IS_EXTERNAL (symbolP); -#endif /* OBJ_AOUT or OBJ_BOUT */ switch (exp.X_op) { @@ -3294,13 +3269,6 @@ pseudo_set (symbolS *symbolP) set_zero_frag (symbolP); break; } - -#if (defined (OBJ_AOUT) || defined (OBJ_BOUT)) && ! defined (BFD_ASSEMBLER) - if (ext) - S_SET_EXTERNAL (symbolP); - else - S_CLEAR_EXTERNAL (symbolP); -#endif /* OBJ_AOUT or OBJ_BOUT */ } /* cons() @@ -3720,16 +3688,8 @@ emit_expr (expressionS *exp, unsigned int nbytes) { memset (p, 0, nbytes); - /* Now we need to generate a fixS to record the symbol value. - This is easy for BFD. For other targets it can be more - complex. For very complex cases (currently, the HPPA and - NS32K), you can define TC_CONS_FIX_NEW to do whatever you - want. For simpler cases, you can define TC_CONS_RELOC to be - the name of the reloc code that should be stored in the fixS. - If neither is defined, the code uses NO_RELOC if it is - defined, and otherwise uses 0. */ + /* Now we need to generate a fixS to record the symbol value. */ -#ifdef BFD_ASSEMBLER #ifdef TC_CONS_FIX_NEW TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp); #else @@ -3759,24 +3719,6 @@ emit_expr (expressionS *exp, unsigned int nbytes) 0, r); } #endif -#else -#ifdef TC_CONS_FIX_NEW - TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp); -#else - /* Figure out which reloc number to use. Use TC_CONS_RELOC if - it is defined, otherwise use NO_RELOC if it is defined, - otherwise use 0. */ -#ifndef TC_CONS_RELOC -#ifdef NO_RELOC -#define TC_CONS_RELOC NO_RELOC -#else -#define TC_CONS_RELOC 0 -#endif -#endif - fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp, 0, - TC_CONS_RELOC); -#endif /* TC_CONS_FIX_NEW */ -#endif /* BFD_ASSEMBLER */ } } @@ -5207,10 +5149,7 @@ do_s_func (int end_p, const char *default_prefix) asprintf (&label, "%s%s", default_prefix, name); else { - char leading_char = 0; -#ifdef BFD_ASSEMBLER - leading_char = bfd_get_symbol_leading_char (stdoutput); -#endif + char leading_char = bfd_get_symbol_leading_char (stdoutput); /* Missing entry point, use function's name with the leading char prepended. */ if (leading_char) diff --git a/gas/stabs.c b/gas/stabs.c index 10e1461..0b5c83b 100644 --- a/gas/stabs.c +++ b/gas/stabs.c @@ -107,11 +107,9 @@ get_stab_string_offset (const char *string, const char *stabstr_secname) p = frag_more (1); *p = 0; retval = seg_info (seg)->stabu.stab_string_size = 1; -#ifdef BFD_ASSEMBLER bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING); if (seg->name == stabstr_secname) seg->name = xstrdup (stabstr_secname); -#endif } if (length > 0) @@ -331,10 +329,8 @@ s_stab_generic (int what, char *stab_secname, char *stabstr_secname) if (! seg_info (seg)->hadone) { -#ifdef BFD_ASSEMBLER bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING); -#endif #ifdef INIT_STAB_SECTION INIT_STAB_SECTION (seg); #endif diff --git a/gas/struc-symbol.h b/gas/struc-symbol.h index 3d7f48f..0b2d520 100644 --- a/gas/struc-symbol.h +++ b/gas/struc-symbol.h @@ -1,5 +1,5 @@ /* struct_symbol.h - Internal symbol structure - Copyright 1987, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001 + Copyright 1987, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,43 +22,21 @@ #ifndef __struc_symbol_h__ #define __struc_symbol_h__ -#ifdef BFD_ASSEMBLER -/* The BFD code wants to walk the list in both directions. */ -#undef SYMBOLS_NEED_BACKPOINTERS -#define SYMBOLS_NEED_BACKPOINTERS -#endif - /* The information we keep for a symbol. Note that the symbol table holds pointers both to this and to local_symbol structures. See below. */ struct symbol { -#ifdef BFD_ASSEMBLER /* BFD symbol */ asymbol *bsym; -#else - /* The (4-origin) position of sy_name in the symbol table of the object - file. This will be 0 for (nameless) .stabd symbols. - - Not used until write_object_file() time. */ - unsigned long sy_name_offset; - - /* What we write in .o file (if permitted). */ - obj_symbol_type sy_symbol; - - /* The 24 bit symbol number. Symbol numbers start at 0 and are unsigned. */ - long sy_number; -#endif /* The value of the symbol. */ expressionS sy_value; /* Forwards and (optionally) backwards chain pointers. */ struct symbol *sy_next; -#ifdef SYMBOLS_NEED_BACKPOINTERS struct symbol *sy_previous; -#endif /* SYMBOLS_NEED_BACKPOINTERS */ /* Pointer to the frag this symbol is attached to, if any. Otherwise, NULL. */ @@ -101,8 +79,6 @@ struct symbol #endif }; -#ifdef BFD_ASSEMBLER - /* A pointer in the symbol may point to either a complete symbol (struct symbol above) or to a local symbol (struct local_symbol defined here). The symbol code can detect the case by examining @@ -154,6 +130,4 @@ struct local_symbol #define local_symbol_get_real_symbol(l) ((l)->u.lsy_sym) #define local_symbol_set_real_symbol(l, s) ((l)->u.lsy_sym = (s)) -#endif /* BFD_ASSEMBLER */ - #endif /* __struc_symbol_h__ */ diff --git a/gas/subsegs.c b/gas/subsegs.c index 50343b6..b1cb8e4 100644 --- a/gas/subsegs.c +++ b/gas/subsegs.c @@ -31,45 +31,11 @@ frchainS *frchain_root, *frchain_now; static struct obstack frchains; -#ifndef BFD_ASSEMBLER -#ifdef MANY_SEGMENTS -segment_info_type segment_info[SEG_MAXIMUM_ORDINAL]; - -#else -/* Commented in "subsegs.h". */ -frchainS *data0_frchainP, *bss0_frchainP; - -#endif /* MANY_SEGMENTS */ -char const *const seg_name[] = { - "absolute", -#ifdef MANY_SEGMENTS - "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", - "e10", "e11", "e12", "e13", "e14", "e15", "e16", "e17", "e18", "e19", - "e20", "e21", "e22", "e23", "e24", "e25", "e26", "e27", "e28", "e29", - "e30", "e31", "e32", "e33", "e34", "e35", "e36", "e37", "e38", "e39", -#else - "text", - "data", - "bss", -#endif /* MANY_SEGMENTS */ - "unknown", - "ASSEMBLER-INTERNAL-LOGIC-ERROR!", - "expr", - "debug", - "transfert vector preload", - "transfert vector postload", - "register", - "", -}; /* Used by error reporters, dumpers etc. */ -#else /* BFD_ASSEMBLER */ - /* Gas segment information for bfd_abs_section_ptr and bfd_und_section_ptr. */ static segment_info_type *abs_seg_info; static segment_info_type *und_seg_info; -#endif /* BFD_ASSEMBLER */ - static void subseg_set_rest (segT, subsegT); static fragS dummy_frag; @@ -79,22 +45,6 @@ static frchainS absolute_frchain; void subsegs_begin (void) { - /* Check table(s) seg_name[], seg_N_TYPE[] is in correct order */ -#if !defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER) - know (SEG_ABSOLUTE == 0); - know (SEG_TEXT == 1); - know (SEG_DATA == 2); - know (SEG_BSS == 3); - know (SEG_UNKNOWN == 4); - know (SEG_GOOF == 5); - know (SEG_EXPR == 6); - know (SEG_DEBUG == 7); - know (SEG_NTV == 8); - know (SEG_PTV == 9); - know (SEG_REGISTER == 10); - know (SEG_MAXIMUM_ORDINAL == SEG_REGISTER); -#endif - obstack_begin (&frchains, chunksize); #if __GNUC__ >= 2 obstack_alignment_mask (&frchains) = __alignof__ (frchainS) - 1; @@ -105,32 +55,9 @@ subsegs_begin (void) frag_now = &dummy_frag; -#ifndef BFD_ASSEMBLER - now_subseg = 42; /* Lie for 1st call to subseg_new. */ -#ifdef MANY_SEGMENTS - { - int i; - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - subseg_set (i, 0); - segment_info[i].frchainP = frchain_now; - } - } -#else - subseg_set (SEG_DATA, 0); /* .data 0 */ - data0_frchainP = frchain_now; - - subseg_set (SEG_BSS, 0); - bss0_frchainP = frchain_now; - -#endif /* ! MANY_SEGMENTS */ -#endif /* ! BFD_ASSEMBLER */ - absolute_frchain.frch_seg = absolute_section; absolute_frchain.frch_subseg = 0; -#ifdef BFD_ASSEMBLER absolute_frchain.fix_root = absolute_frchain.fix_tail = 0; -#endif absolute_frchain.frch_frag_now = &zero_address_frag; absolute_frchain.frch_root = absolute_frchain.frch_last = &zero_address_frag; } @@ -150,54 +77,27 @@ subseg_change (register segT seg, register int subseg) { now_seg = seg; now_subseg = subseg; + segment_info_type *seginfo; if (now_seg == absolute_section) return; -#ifdef BFD_ASSEMBLER - { - segment_info_type *seginfo; - seginfo = (segment_info_type *) bfd_get_section_userdata (stdoutput, seg); - if (! seginfo) - { - seginfo = (segment_info_type *) xmalloc (sizeof (*seginfo)); - memset ((PTR) seginfo, 0, sizeof (*seginfo)); - seginfo->fix_root = NULL; - seginfo->fix_tail = NULL; - seginfo->bfd_section = seg; - seginfo->sym = 0; - if (seg == bfd_abs_section_ptr) - abs_seg_info = seginfo; - else if (seg == bfd_und_section_ptr) - und_seg_info = seginfo; - else - bfd_set_section_userdata (stdoutput, seg, (PTR) seginfo); - } - } -#else -#ifdef MANY_SEGMENTS - seg_fix_rootP = &segment_info[seg].fix_root; - seg_fix_tailP = &segment_info[seg].fix_tail; -#else - if (seg == SEG_DATA) - { - seg_fix_rootP = &data_fix_root; - seg_fix_tailP = &data_fix_tail; - } - else if (seg == SEG_TEXT) - { - seg_fix_rootP = &text_fix_root; - seg_fix_tailP = &text_fix_tail; - } - else + seginfo = (segment_info_type *) bfd_get_section_userdata (stdoutput, seg); + if (! seginfo) { - know (seg == SEG_BSS); - seg_fix_rootP = &bss_fix_root; - seg_fix_tailP = &bss_fix_tail; + seginfo = (segment_info_type *) xmalloc (sizeof (*seginfo)); + memset ((PTR) seginfo, 0, sizeof (*seginfo)); + seginfo->fix_root = NULL; + seginfo->fix_tail = NULL; + seginfo->bfd_section = seg; + seginfo->sym = 0; + if (seg == bfd_abs_section_ptr) + abs_seg_info = seginfo; + else if (seg == bfd_und_section_ptr) + und_seg_info = seginfo; + else + bfd_set_section_userdata (stdoutput, seg, (PTR) seginfo); } - -#endif -#endif } static void @@ -274,13 +174,13 @@ subseg_set_rest (segT seg, subsegT subseg) /* * This should be the only code that creates a frchainS. */ + segment_info_type *seginfo; + newP = (frchainS *) obstack_alloc (&frchains, sizeof (frchainS)); newP->frch_subseg = subseg; newP->frch_seg = seg; -#ifdef BFD_ASSEMBLER newP->fix_root = NULL; newP->fix_tail = NULL; -#endif obstack_begin (&newP->frch_obstack, chunksize); #if __GNUC__ >= 2 obstack_alignment_mask (&newP->frch_obstack) = __alignof__ (fragS) - 1; @@ -293,14 +193,9 @@ subseg_set_rest (segT seg, subsegT subseg) *lastPP = newP; newP->frch_next = frcP; /* perhaps NULL */ -#ifdef BFD_ASSEMBLER - { - segment_info_type *seginfo; - seginfo = seg_info (seg); - if (seginfo && seginfo->frchainP == frcP) - seginfo->frchainP = newP; - } -#endif + seginfo = seg_info (seg); + if (seginfo && seginfo->frchainP == frcP) + seginfo->frchainP = newP; frcP = newP; } @@ -329,73 +224,6 @@ subseg_set_rest (segT seg, subsegT subseg) * Frchain_root updated if needed. */ -#ifndef BFD_ASSEMBLER - -segT -subseg_new (segname, subseg) - const char *segname; - subsegT subseg; -{ - int i; - - for (i = 0; i < (int) SEG_MAXIMUM_ORDINAL; i++) - { - const char *s; - - s = segment_name ((segT) i); - if (strcmp (segname, s) == 0 - || (segname[0] == '.' - && strcmp (segname + 1, s) == 0)) - { - subseg_set ((segT) i, subseg); - return (segT) i; - } -#ifdef obj_segment_name - s = obj_segment_name ((segT) i); - if (strcmp (segname, s) == 0 - || (segname[0] == '.' - && strcmp (segname + 1, s) == 0)) - { - subseg_set ((segT) i, subseg); - return (segT) i; - } -#endif - } - -#ifdef obj_add_segment - { - segT new_seg; - new_seg = obj_add_segment (segname); - subseg_set (new_seg, subseg); - return new_seg; - } -#else - as_bad (_("attempt to switch to nonexistent segment \"%s\""), segname); - return now_seg; -#endif -} - -void -subseg_set (seg, subseg) /* begin assembly for a new sub-segment */ - register segT seg; /* SEG_DATA or SEG_TEXT */ - register subsegT subseg; -{ -#ifndef MANY_SEGMENTS - know (seg == SEG_DATA - || seg == SEG_TEXT - || seg == SEG_BSS - || seg == SEG_ABSOLUTE); -#endif - - if (seg != now_seg || subseg != now_subseg) - { /* we just changed sub-segments */ - subseg_set_rest (seg, subseg); - } - mri_common_symbol = NULL; -} - -#else /* BFD_ASSEMBLER */ - segT subseg_get (const char *segname, int force_new) { @@ -550,49 +378,12 @@ section_symbol (segT sec) return s; } -#endif /* BFD_ASSEMBLER */ - /* Return whether the specified segment is thought to hold text. */ -#ifndef BFD_ASSEMBLER -const char * const nontext_section_names[] = { - ".eh_frame", - ".gcc_except_table", -#ifdef OBJ_COFF -#ifndef COFF_LONG_SECTION_NAMES - ".eh_fram", - ".gcc_exc", -#endif -#endif - NULL -}; -#endif /* ! BFD_ASSEMBLER */ - int subseg_text_p (segT sec) { -#ifdef BFD_ASSEMBLER return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0; -#else /* ! BFD_ASSEMBLER */ - const char * const *p; - - if (sec == data_section || sec == bss_section || sec == absolute_section) - return 0; - - for (p = nontext_section_names; *p != NULL; ++p) - { - if (strcmp (segment_name (sec), *p) == 0) - return 0; - -#ifdef obj_segment_name - if (strcmp (obj_segment_name (sec), *p) == 0) - return 0; -#endif - } - - return 1; - -#endif /* ! BFD_ASSEMBLER */ } /* Return non zero if SEC has at least one byte of data. It is diff --git a/gas/subsegs.h b/gas/subsegs.h index 01af884..23ab4f9 100644 --- a/gas/subsegs.h +++ b/gas/subsegs.h @@ -47,10 +47,8 @@ struct frchain /* control building of a frag chain */ struct frchain *frch_next; /* next in chain of struct frchain-s */ segT frch_seg; /* SEG_TEXT or SEG_DATA. */ subsegT frch_subseg; /* subsegment number of this chain */ -#ifdef BFD_ASSEMBLER fixS *fix_root; /* Root of fixups for this subsegment. */ fixS *fix_tail; /* Last fixup for this subsegment. */ -#endif struct obstack frch_obstack; /* for objects in this frag chain */ fragS *frch_frag_now; /* frag_now for this subsegment */ }; @@ -77,30 +75,22 @@ typedef struct segment_info_struct { int user_stuff; - /* Fixups for this segment. If BFD_ASSEMBLER, this is only valid - after the frchains are run together. */ + /* Fixups for this segment. This is only valid after the frchains + are run together. */ fixS *fix_root; fixS *fix_tail; -#if defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER) - struct internal_scnhdr scnhdr; - enum linkonce_type linkonce; - const char *name; -#endif - symbolS *dot; struct lineno_list *lineno_list_head; struct lineno_list *lineno_list_tail; -#ifdef BFD_ASSEMBLER /* Which BFD section does this gas segment correspond to? */ asection *bfd_section; /* NULL, or pointer to the gas symbol that is the section symbol for this section. sym->bsym and bfd_section->symbol should be the same. */ symbolS *sym; -#endif union { /* Current size of section holding stabs strings. */ @@ -119,30 +109,7 @@ typedef struct segment_info_struct { #endif } segment_info_type; -#ifdef BFD_ASSEMBLER - extern segment_info_type *seg_info (segT); extern symbolS *section_symbol (segT); -#else /* ! BFD_ASSEMBLER */ - -#ifdef MANY_SEGMENTS - -extern segment_info_type segment_info[]; - -#define seg_info(SEC) (&segment_info[SEC]) - -#else - -/* Sentinel for frchain crawling. Points to the 1st data-segment - frchain. (Which is pointed to by the last text-segment frchain.) */ -extern frchainS *data0_frchainP; -extern frchainS *bss0_frchainP; - -#define seg_info(S) (abort (), (segment_info_type *) 0) - -#endif - -#endif /* ! BFD_ASSEMBLER */ - extern void subsegs_print_statistics (FILE *); diff --git a/gas/symbols.c b/gas/symbols.c index ebcad5b..49d546d 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -88,13 +88,11 @@ symbol_new (const char *name, segT segment, valueT valu, fragS *frag) symbolS *symbolP = symbol_create (name, segment, valu, frag); /* Link to end of symbol chain. */ -#ifdef BFD_ASSEMBLER { extern int symbol_table_frozen; if (symbol_table_frozen) abort (); } -#endif symbol_append (symbolP, symbol_lastP, &symbol_rootP, &symbol_lastP); return symbolP; @@ -144,12 +142,10 @@ symbol_create (const char *name, /* It is copied, the caller can destroy/modify. /* symbol must be born in some fixed state. This seems as good as any. */ memset (symbolP, 0, sizeof (symbolS)); -#ifdef BFD_ASSEMBLER symbolP->bsym = bfd_make_empty_symbol (stdoutput); if (symbolP->bsym == NULL) as_perror ("%s", "bfd_make_empty_symbol"); symbolP->bsym->udata.p = (PTR) symbolP; -#endif S_SET_NAME (symbolP, preserved_copy_of_name); S_SET_SEGMENT (symbolP, segment); @@ -157,10 +153,6 @@ symbol_create (const char *name, /* It is copied, the caller can destroy/modify. symbol_clear_list_pointers (symbolP); symbolP->sy_frag = frag; -#ifndef BFD_ASSEMBLER - symbolP->sy_number = ~0; - symbolP->sy_name_offset = (unsigned int) ~0; -#endif obj_symbol_new_hook (symbolP); @@ -171,7 +163,6 @@ symbol_create (const char *name, /* It is copied, the caller can destroy/modify. return symbolP; } -#ifdef BFD_ASSEMBLER /* Local symbol support. If we can get away with it, we keep only a small amount of information for local symbols. */ @@ -255,13 +246,6 @@ local_symbol_convert (struct local_symbol *locsym) return ret; } - -#else /* ! BFD_ASSEMBLER */ - -#define LOCAL_SYMBOL_CHECK(s) 0 -#define local_symbol_convert(s) ((symbolS *) s) - -#endif /* ! BFD_ASSEMBLER */ /* We have just seen "<name>:". Creates a struct symbol unless it already exists. @@ -277,19 +261,9 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ /* Sun local labels go out of scope whenever a non-local symbol is defined. */ - if (LOCAL_LABELS_DOLLAR) - { - int local; - -#ifdef BFD_ASSEMBLER - local = bfd_is_local_label_name (stdoutput, sym_name); -#else - local = LOCAL_LABEL (sym_name); -#endif - - if (! local) - dollar_label_clear (); - } + if (LOCAL_LABELS_DOLLAR + && !bfd_is_local_label_name (stdoutput, sym_name)) + dollar_label_clear (); #ifndef WORKING_DOT_WORD if (new_broken_words) @@ -342,7 +316,6 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ /* Now check for undefined symbols. */ if (LOCAL_SYMBOL_CHECK (symbolP)) { -#ifdef BFD_ASSEMBLER struct local_symbol *locsym = (struct local_symbol *) symbolP; if (locsym->lsy_section != undefined_section @@ -357,7 +330,6 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ locsym->lsy_section = now_seg; local_symbol_set_frag (locsym, frag_now); locsym->lsy_value = frag_now_fix (); -#endif } else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP)) { @@ -428,9 +400,7 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ #else 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)); @@ -453,14 +423,12 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ } } -#ifdef BFD_ASSEMBLER else if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, sym_name)) { symbolP = (symbolS *) local_symbol_make (sym_name, now_seg, (valueT) frag_now_fix (), frag_now); } -#endif /* BFD_ASSEMBLER */ else { symbolP = symbol_new (sym_name, now_seg, (valueT) frag_now_fix (), @@ -535,7 +503,6 @@ symbol_find_or_make (const char *name) if (symbolP == NULL) { -#ifdef BFD_ASSEMBLER if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, name)) { symbolP = md_undefined_symbol ((char *) name); @@ -547,7 +514,6 @@ symbol_find_or_make (const char *name) &zero_address_frag); return symbolP; } -#endif symbolP = symbol_make (name); @@ -597,15 +563,11 @@ symbol_temp_make (void) symbolS * symbol_find_exact (const char *name) { -#ifdef BFD_ASSEMBLER - { - struct local_symbol *locsym; + struct local_symbol *locsym; - locsym = (struct local_symbol *) hash_find (local_hash, name); - if (locsym != NULL) - return (symbolS *) locsym; - } -#endif + locsym = (struct local_symbol *) hash_find (local_hash, name); + if (locsym != NULL) + return (symbolS *) locsym; return ((symbolS *) hash_find (sy_hash, name)); } @@ -665,9 +627,7 @@ symbol_append (symbolS *addme, symbolS *target, know (*rootPP == NULL); know (*lastPP == NULL); addme->sy_next = NULL; -#ifdef SYMBOLS_NEED_BACKPOINTERS addme->sy_previous = NULL; -#endif *rootPP = addme; *lastPP = addme; return; @@ -675,9 +635,7 @@ symbol_append (symbolS *addme, symbolS *target, if (target->sy_next != NULL) { -#ifdef SYMBOLS_NEED_BACKPOINTERS target->sy_next->sy_previous = addme; -#endif /* SYMBOLS_NEED_BACKPOINTERS */ } else { @@ -687,10 +645,7 @@ symbol_append (symbolS *addme, symbolS *target, addme->sy_next = target->sy_next; target->sy_next = addme; - -#ifdef SYMBOLS_NEED_BACKPOINTERS addme->sy_previous = target; -#endif /* SYMBOLS_NEED_BACKPOINTERS */ debug_verify_symchain (symbol_rootP, symbol_lastP); } @@ -703,12 +658,9 @@ symbol_clear_list_pointers (symbolS *symbolP) if (LOCAL_SYMBOL_CHECK (symbolP)) abort (); symbolP->sy_next = NULL; -#ifdef SYMBOLS_NEED_BACKPOINTERS symbolP->sy_previous = NULL; -#endif } -#ifdef SYMBOLS_NEED_BACKPOINTERS /* Remove SYMBOLP from the list. */ void @@ -768,8 +720,6 @@ symbol_insert (symbolS *addme, symbolS *target, debug_verify_symchain (*rootPP, *lastPP); } -#endif /* SYMBOLS_NEED_BACKPOINTERS */ - void verify_symbol_chain (symbolS *rootP, symbolS *lastP) { @@ -780,15 +730,8 @@ verify_symbol_chain (symbolS *rootP, symbolS *lastP) for (; symbol_next (symbolP) != NULL; symbolP = symbol_next (symbolP)) { -#ifdef BFD_ASSEMBLER assert (symbolP->bsym != NULL); -#endif -#ifdef SYMBOLS_NEED_BACKPOINTERS assert (symbolP->sy_next->sy_previous == symbolP); -#else - /* Walk the list anyways, to make sure pointers are still good. */ - ; -#endif /* SYMBOLS_NEED_BACKPOINTERS */ } assert (lastP == symbolP); @@ -860,7 +803,6 @@ resolve_symbol_value (symbolS *symp) valueT final_val = 0; segT final_seg; -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (symp)) { struct local_symbol *locsym = (struct local_symbol *) symp; @@ -879,7 +821,6 @@ resolve_symbol_value (symbolS *symp) return final_val; } -#endif if (symp->sy_resolved) { @@ -965,7 +906,7 @@ resolve_symbol_value (symbolS *symp) relocation to be against the symbol to which this symbol is equated. */ if (! S_IS_DEFINED (add_symbol) -#if defined (OBJ_COFF) && defined (TE_PE) && (defined(BFD_ASSEMBLER) || defined(S_IS_WEAK)) +#if defined (OBJ_COFF) && defined (TE_PE) || S_IS_WEAK (add_symbol) #endif || S_IS_COMMON (add_symbol)) @@ -1211,11 +1152,6 @@ resolve_symbol_value (symbolS *symp) exit_dont_set_value: /* Always set the segment, even if not finalizing the value. The segment is used to determine whether a symbol is defined. */ -#if defined (OBJ_AOUT) && ! defined (BFD_ASSEMBLER) - /* The old a.out backend does not handle S_SET_SEGMENT correctly - for a stab symbol, so we use this bad hack. */ - if (final_seg != S_GET_SEGMENT (symp)) -#endif S_SET_SEGMENT (symp, final_seg); /* Don't worry if we can't resolve an expr_section symbol. */ @@ -1234,8 +1170,6 @@ exit_dont_set_value: return final_val; } -#ifdef BFD_ASSEMBLER - static void resolve_local_symbol (const char *, PTR); /* A static function passed to hash_traverse. */ @@ -1247,16 +1181,12 @@ resolve_local_symbol (const char *key ATTRIBUTE_UNUSED, PTR value) resolve_symbol_value (value); } -#endif - /* Resolve all local symbols. */ void resolve_local_symbol_values (void) { -#ifdef BFD_ASSEMBLER hash_traverse (local_hash, resolve_local_symbol); -#endif } /* Dollar labels look like a number followed by a dollar sign. Eg, "42$". @@ -1625,10 +1555,8 @@ decode_local_label_name (char *s) valueT S_GET_VALUE (symbolS *s) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) return resolve_symbol_value (s); -#endif if (!s->sy_resolved) { @@ -1661,13 +1589,11 @@ S_GET_VALUE (symbolS *s) void S_SET_VALUE (symbolS *s, valueT val) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) { ((struct local_symbol *) s)->lsy_value = val; return; } -#endif s->sy_value.X_op = O_constant; s->sy_value.X_add_number = (offsetT) val; @@ -1682,20 +1608,16 @@ copy_symbol_attributes (symbolS *dest, symbolS *src) if (LOCAL_SYMBOL_CHECK (src)) src = local_symbol_convert ((struct local_symbol *) src); -#ifdef BFD_ASSEMBLER /* In an expression, transfer the settings of these flags. The user can override later, of course. */ #define COPIED_SYMFLAGS (BSF_FUNCTION | BSF_OBJECT) dest->bsym->flags |= src->bsym->flags & COPIED_SYMFLAGS; -#endif #ifdef OBJ_COPY_SYMBOL_ATTRIBUTES OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src); #endif } -#ifdef BFD_ASSEMBLER - int S_IS_FUNCTION (symbolS *s) { @@ -1949,9 +1871,6 @@ S_SET_NAME (symbolS *s, const char *name) } s->bsym->name = name; } -#endif /* BFD_ASSEMBLER */ - -#ifdef SYMBOLS_NEED_BACKPOINTERS /* Return the previous symbol in a chain. */ @@ -1963,8 +1882,6 @@ symbol_previous (symbolS *s) return s->sy_previous; } -#endif /* SYMBOLS_NEED_BACKPOINTERS */ - /* Return the next symbol in a chain. */ symbolS * @@ -2000,10 +1917,8 @@ symbol_set_value_expression (symbolS *s, const expressionS *exp) offsetT * symbol_X_add_number (symbolS *s) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) return (offsetT *) &((struct local_symbol *) s)->lsy_value; -#endif return &s->sy_value.X_add_number; } @@ -2023,13 +1938,11 @@ symbol_set_value_now (symbolS *sym) void symbol_set_frag (symbolS *s, fragS *f) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) { local_symbol_set_frag ((struct local_symbol *) s, f); return; } -#endif s->sy_frag = f; } @@ -2038,10 +1951,8 @@ symbol_set_frag (symbolS *s, fragS *f) fragS * symbol_get_frag (symbolS *s) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) return local_symbol_get_frag ((struct local_symbol *) s); -#endif return s->sy_frag; } @@ -2170,13 +2081,11 @@ symbol_written_p (symbolS *s) void symbol_mark_resolved (symbolS *s) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) { local_symbol_mark_resolved ((struct local_symbol *) s); return; } -#endif s->sy_resolved = 1; } @@ -2185,10 +2094,8 @@ symbol_mark_resolved (symbolS *s) int symbol_resolved_p (symbolS *s) { -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (s)) return local_symbol_resolved_p ((struct local_symbol *) s); -#endif return s->sy_resolved; } @@ -2199,12 +2106,7 @@ symbol_section_p (symbolS *s ATTRIBUTE_UNUSED) { if (LOCAL_SYMBOL_CHECK (s)) return 0; -#ifdef BFD_ASSEMBLER return (s->bsym->flags & BSF_SECTION_SYM) != 0; -#else - /* FIXME. */ - return 0; -#endif } /* Return whether a symbol is equated to another symbol. */ @@ -2229,7 +2131,7 @@ symbol_equated_reloc_p (symbolS *s) resolve_symbol_value to flag expression syms that have been equated. */ return (s->sy_value.X_op == O_symbol -#if defined (OBJ_COFF) && defined (TE_PE) && (defined(BFD_ASSEMBLER) || defined(S_IS_WEAK)) +#if defined (OBJ_COFF) && defined (TE_PE) && ! S_IS_WEAK (s) #endif && ((s->sy_resolved && s->sy_value.X_op_symbol != NULL) @@ -2247,8 +2149,6 @@ symbol_constant_p (symbolS *s) return s->sy_value.X_op == O_constant; } -#ifdef BFD_ASSEMBLER - /* Return the BFD symbol for a symbol. */ asymbol * @@ -2278,8 +2178,6 @@ symbol_set_bfdsym (symbolS *s, asymbol *bsym) /* else XXX - What do we do now ? */ } -#endif /* BFD_ASSEMBLER */ - #ifdef OBJ_SYMFIELD_TYPE /* Get a pointer to the object format information for a symbol. */ @@ -2334,19 +2232,12 @@ symbol_begin (void) symbol_lastP = NULL; symbol_rootP = NULL; /* In case we have 0 symbols (!!) */ sy_hash = hash_new (); -#ifdef BFD_ASSEMBLER local_hash = hash_new (); -#endif memset ((char *) (&abs_symbol), '\0', sizeof (abs_symbol)); -#ifdef BFD_ASSEMBLER #if defined (EMIT_SECTION_SYMBOLS) || !defined (RELOC_REQUIRES_SYMBOL) abs_symbol.bsym = bfd_abs_section.symbol; #endif -#else - /* Can't initialise a union. Sigh. */ - S_SET_SEGMENT (&abs_symbol, absolute_section); -#endif abs_symbol.sy_value.X_op = O_constant; abs_symbol.sy_frag = &zero_address_frag; @@ -2370,7 +2261,6 @@ print_symbol_value_1 (FILE *file, symbolS *sym) if (LOCAL_SYMBOL_CHECK (sym)) { -#ifdef BFD_ASSEMBLER struct local_symbol *locsym = (struct local_symbol *) sym; if (local_symbol_get_frag (locsym) != &zero_address_frag && local_symbol_get_frag (locsym) != NULL) @@ -2378,7 +2268,6 @@ print_symbol_value_1 (FILE *file, symbolS *sym) if (local_symbol_resolved_p (locsym)) fprintf (file, " resolved"); fprintf (file, " local"); -#endif } else { @@ -2417,12 +2306,10 @@ print_symbol_value_1 (FILE *file, symbolS *sym) { indent_level++; fprintf (file, "\n%*s<", indent_level * 4, ""); -#ifdef BFD_ASSEMBLER if (LOCAL_SYMBOL_CHECK (sym)) fprintf (file, "constant %lx", (long) ((struct local_symbol *) sym)->lsy_value); else -#endif print_expr_1 (file, &sym->sy_value); fprintf (file, ">"); indent_level--; @@ -2573,9 +2460,7 @@ void symbol_print_statistics (FILE *file) { hash_print_statistics (file, "symbol table", sy_hash); -#ifdef BFD_ASSEMBLER hash_print_statistics (file, "mini local symbol table", local_hash); fprintf (file, "%lu mini local symbols created, %lu converted\n", local_symbol_count, local_symbol_conversion_count); -#endif } diff --git a/gas/symbols.h b/gas/symbols.h index ebad440..3d029ff 100644 --- a/gas/symbols.h +++ b/gas/symbols.h @@ -19,18 +19,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef BFD_ASSEMBLER -/* The BFD code wants to walk the list in both directions. */ -#undef SYMBOLS_NEED_BACKPOINTERS -#define SYMBOLS_NEED_BACKPOINTERS -#endif - -#ifndef BFD_ASSEMBLER -/* The non-BFD code expects to be able to manipulate the symbol fields - directly. */ -#include "struc-symbol.h" -#endif - extern struct obstack notes; /* eg FixS live here. */ extern struct obstack cond_obstack; /* this is where we track .ifdef/.endif @@ -87,7 +75,6 @@ extern void copy_symbol_attributes (symbolS *, symbolS *); extern valueT S_GET_VALUE (symbolS *); extern void S_SET_VALUE (symbolS *, valueT); -#ifdef BFD_ASSEMBLER extern int S_IS_FUNCTION (symbolS *); extern int S_IS_EXTERNAL (symbolS *); extern int S_IS_WEAK (symbolS *); @@ -105,7 +92,6 @@ extern void S_SET_NAME (symbolS *, const char *); extern void S_CLEAR_EXTERNAL (symbolS *); extern void S_SET_WEAK (symbolS *); extern void S_SET_THREAD_LOCAL (symbolS *); -#endif #ifndef WORKING_DOT_WORD struct broken_word @@ -150,8 +136,6 @@ extern const short seg_N_TYPE[];/* subseg.c */ void symbol_clear_list_pointers (symbolS * symbolP); -#ifdef SYMBOLS_NEED_BACKPOINTERS - void symbol_insert (symbolS * addme, symbolS * target, symbolS ** rootP, symbolS ** lastP); void symbol_remove (symbolS * symbolP, symbolS ** rootP, @@ -159,8 +143,6 @@ void symbol_remove (symbolS * symbolP, symbolS ** rootP, extern symbolS *symbol_previous (symbolS *); -#endif /* SYMBOLS_NEED_BACKPOINTERS */ - void verify_symbol_chain (symbolS * rootP, symbolS * lastP); void symbol_append (symbolS * addme, symbolS * target, @@ -192,11 +174,8 @@ extern int symbol_section_p (symbolS *); extern int symbol_equated_p (symbolS *); extern int symbol_equated_reloc_p (symbolS *); extern int symbol_constant_p (symbolS *); - -#ifdef BFD_ASSEMBLER extern asymbol *symbol_get_bfdsym (symbolS *); extern void symbol_set_bfdsym (symbolS *, asymbol *); -#endif #ifdef OBJ_SYMFIELD_TYPE OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *); @@ -25,12 +25,9 @@ extern const pseudo_typeS md_pseudo_table[]; -extern const int md_reloc_size; /* Size of a relocation record. */ - char * md_atof (int, char *, int *); int md_parse_option (int, char *); void md_show_usage (FILE *); -short tc_coff_fix2rtype (fixS *); void md_assemble (char *); void md_begin (void); void md_number_to_chars (char *, valueT, int); @@ -69,30 +66,11 @@ valueT md_section_align (segT, valueT); symbolS *md_undefined_symbol (char *); #endif -#ifdef BFD_ASSEMBLER - #ifndef md_convert_frag void md_convert_frag (bfd *, segT, fragS *); #endif -#ifndef tc_headers_hook -void tc_headers_hook (segT *, fixS *); -#endif #ifndef RELOC_EXPANSION_POSSIBLE extern arelent *tc_gen_reloc (asection *, fixS *); #else extern arelent **tc_gen_reloc (asection *, fixS *); #endif - -#else /* not BFD_ASSEMBLER */ - -#ifndef md_convert_frag -void md_convert_frag (object_headers *, segT, fragS *); -#endif -#ifndef tc_crawl_symbol_chain -void tc_crawl_symbol_chain (object_headers *); -#endif -#ifndef tc_headers_hook -void tc_headers_hook (object_headers *); -#endif - -#endif /* BFD_ASSEMBLER */ diff --git a/gas/vmsconf.sh b/gas/vmsconf.sh deleted file mode 100644 index 014538a..0000000 --- a/gas/vmsconf.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -cat << 'EOF' -$!make-gas.com -$! Set the def dir to proper place for use in batch. Works for interactive to. -$flnm = f$enviroment("PROCEDURE") ! get current procedure name -$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' -$v = 'f$verify(0)' -$! -$! Command file to build a GNU assembler on VMS -$! -$! If you are using a version of GCC that supports global constants -$! you should remove the define="const=" from the gcc lines. -$! -$! Caution: Versions 1.38.1 and earlier had a bug in the handling of -$! some static constants. If you are using such a version of the -$! assembler, and you wish to compile without the "const=" hack, -$! you should first build this version *with* the "const=" -$! definition, and then use that assembler to rebuild it without the -$! "const=" definition. Failure to do this will result in an assembler -$! that will mung floating point constants. -$! -$! Note: The version of gas shipped on the GCC VMS tapes has been patched -$! to fix the above mentioned bug. -$! -$ !The gcc-vms driver was modified to use `-1' quite some time ago, -$ !so don't echo this text any more... -$ !write sys$output "If this assembler is going to be used with GCC 1.n, you" -$ !write sys$output "need to modify the driver to supply the -1 switch to gas." -$ !write sys$output "This is required because of a small change in how global" -$ !write sys$output "constant variables are handled. Failure to include this" -$ !write sys$output "will result in linker warning messages about mismatched -$ !write sys$output "psect attributes." -$! -$ gas_host="vms" -$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 -$ arch = f$element(arch_indx,"|","|VAX|Alpha|") -$ if arch.eqs."VAX" -$ then -$ cpu_type="vax" -$ obj_format="vms" -$ atof="vax" -$ else -$ cpu_type="alpha" -$ obj_format="evax" -$ atof="ieee" -$ endif -$ emulation="generic" -$! -$ COPY = "copy/noLog" -$! -$ C_DEFS :="""VMS""" -$! C_DEFS :="""VMS""","""const=""" -$ C_INCLUDES = "/Include=([],[.config],[-.include],[-.include.aout])" -$ C_FLAGS = "/noVerbose/Debug" + c_includes -$! -$! -$ on error then goto bail -$ if f$search("[-.libiberty]liberty.olb").eqs."" -$ then @[-.libiberty]vmsbuild.com -$ write sys$output "Now building gas." -$ endif -$ if "''p1'" .eqs. "LINK" then goto Link -$! -$! This helps gcc 1.nn find the aout/* files. -$! -$ aout_dev = f$parse(flnm,,,"DEVICE") -$ tmp = aout_dev - ":" -$if f$trnlnm(tmp).nes."" then aout_dev = f$trnlnm(tmp) -$ aout_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - - - "GAS]" + "INCLUDE.AOUT.]" - "][" -$assign 'aout_dir' aout/tran=conc -$ opcode_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - - - "GAS]" + "INCLUDE.OPCODE.]" - "][" -$assign 'opcode_dir' opcode/tran=conc -$! -$ set verify -$! -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]tc-'cpu_type'.obj [.config]tc-'cpu_type'.c -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]obj-'obj_format'.obj [.config]obj-'obj_format'.c -$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]atof-'atof'.obj [.config]atof-'atof'.c -EOF - -cfiles="`echo $* | sed -e 's/\.o/.c/g' -e 's!../\([^ /]*\)/\([^ /]*\.c\)![-.\1]\2!g'`" - -for cfile in $cfiles ; do - case $cfile in - "[-."*) - base=`echo $cfile | sed -e 's/\[.*\]//' -e 's/\.c$//'` - echo "\$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]$base.obj $cfile" - ;; - *) - echo "\$ gcc 'c_flags'/Define=('C_DEFS') $cfile" - ;; - esac -done - -cat << 'EOF' -$link: -$!'f$verify(0)' -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ create gcc-as.opt -! -! Linker options file for GNU assembler -! -$ open/Append ifile$ gcc-as.opt -$ write ifile$ "tc-''cpu_type'.obj" -$ write ifile$ "obj-''obj_format'.obj" -$ write ifile$ "atof-''atof'.obj" -$ COPY sys$input: ifile$: -EOF - -for obj in $* ; do - # Change "foo.o" into "foo.obj". - echo ${obj}bj,- | sed 's!.*/!!g' -done - -cat << 'EOF' -[-.libiberty]liberty.olb/Lib -gnu_cc:[000000]gcclib.olb/Lib,sys$library:vaxcrtl.olb/Lib -! Tell linker exactly what psect attributes we want -- match VAXCRTL. -psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt -$ close ifile$ -$ set verify=(Proc,noImag) -$ link/noMap/Exec=gcc-as.exe gcc-as.opt/Opt,version.opt/Opt -$! -$bail: exit $status + 0*f$verify(v) !'f$verify(0)' -EOF diff --git a/gas/write.c b/gas/write.c index ba6219d..ee80050 100644 --- a/gas/write.c +++ b/gas/write.c @@ -71,13 +71,9 @@ /* The PA needs this for PIC code generation. */ #define TC_VALIDATE_FIX_SUB(FIX) 1 #else -#ifdef BFD_ASSEMBLER #define TC_VALIDATE_FIX_SUB(FIX) \ ((FIX)->fx_r_type == BFD_RELOC_GPREL32 \ || (FIX)->fx_r_type == BFD_RELOC_GPREL16) -#else -#define TC_VALIDATE_FIX_SUB(FIX) 0 -#endif #endif #endif @@ -113,7 +109,6 @@ addressT dot_value; void print_fixup (fixS *); -#ifdef BFD_ASSEMBLER static void renumber_sections (bfd *, asection *, PTR); /* We generally attach relocs to frag chains. However, after we have @@ -121,53 +116,18 @@ static void renumber_sections (bfd *, asection *, PTR); that must be attached to a segment. This will include relocs added in md_estimate_size_for_relax, for example. */ static int frags_chained = 0; -#endif - -#ifndef BFD_ASSEMBLER - -#ifndef MANY_SEGMENTS -struct frag *text_frag_root; -struct frag *data_frag_root; -struct frag *bss_frag_root; - -struct frag *text_last_frag; /* Last frag in segment. */ -struct frag *data_last_frag; /* Last frag in segment. */ -static struct frag *bss_last_frag; /* Last frag in segment. */ -#endif - -#ifndef BFD -static object_headers headers; -#endif - -long string_byte_count; -char *next_object_file_charP; /* Tracks object file bytes. */ - -#ifndef OBJ_VMS -int magic_number_for_object_file = DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE; -#endif - -#endif /* BFD_ASSEMBLER */ static int n_fixups; -#ifdef BFD_ASSEMBLER #define RELOC_ENUM enum bfd_reloc_code_real -#else -#define RELOC_ENUM int -#endif static fixS *fix_new_internal (fragS *, int where, int size, symbolS *add, symbolS *sub, offsetT offset, int pcrel, RELOC_ENUM r_type); -#if defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS)) static long fixup_segment (fixS *, segT); -#endif static relax_addressT relax_align (relax_addressT addr, int align); -#if defined (BFD_ASSEMBLER) || ! defined (BFD) static fragS *chain_frchains_together_1 (segT, struct frchain *); -#endif -#ifdef BFD_ASSEMBLER static void chain_frchains_together (bfd *, segT, PTR); static void cvt_frag_to_fill (segT, fragS *); static void adjust_reloc_syms (bfd *, asection *, PTR); @@ -175,15 +135,7 @@ static void fix_segment (bfd *, asection *, PTR); static void write_relocs (bfd *, asection *, PTR); static void write_contents (bfd *, asection *, PTR); static void set_symtab (void); -#endif -#if defined (BFD_ASSEMBLER) || (! defined (BFD) && ! defined (OBJ_AOUT)) static void merge_data_into_text (void); -#endif -#if ! defined (BFD_ASSEMBLER) && ! defined (BFD) -static void cvt_frag_to_fill (object_headers *, segT, fragS *); -static void remove_subsegs (frchainS *, int, fragS **, fragS **); -static void relax_and_size_all_segments (void); -#endif /* Create a fixS in obstack 'notes'. */ @@ -218,9 +170,7 @@ fix_new_internal (fragS *frag, /* Which frag? */ fixP->fx_dot_value = dot_value; fixP->fx_pcrel = pcrel; fixP->fx_plt = 0; -#if defined(NEED_FX_R_TYPE) || defined (BFD_ASSEMBLER) fixP->fx_r_type = r_type; -#endif fixP->fx_im_disp = 0; fixP->fx_pcrel_adjust = 0; fixP->fx_bit_fixP = 0; @@ -247,14 +197,12 @@ fix_new_internal (fragS *frag, /* Which frag? */ time option. xoxorich. */ { -#ifdef BFD_ASSEMBLER fixS **seg_fix_rootP = (frags_chained ? &seg_info (now_seg)->fix_root : &frchain_now->fix_root); fixS **seg_fix_tailP = (frags_chained ? &seg_info (now_seg)->fix_tail : &frchain_now->fix_tail); -#endif #ifdef REVERSE_SORT_RELOCS @@ -334,16 +282,7 @@ fix_new_exp (fragS *frag, /* Which frag? */ case O_symbol_rva: add = exp->X_add_symbol; off = exp->X_add_number; - -#if defined(BFD_ASSEMBLER) r_type = BFD_RELOC_RVA; -#else -#if defined(TC_RVA_RELOC) - r_type = TC_RVA_RELOC; -#else - as_fatal (_("rva not supported")); -#endif -#endif break; case O_uminus: @@ -373,11 +312,10 @@ fix_new_exp (fragS *frag, /* Which frag? */ int generic_force_reloc (fixS *fix) { -#ifdef BFD_ASSEMBLER if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 1; -#endif + return S_FORCE_RELOC (fix->fx_addsy, fix->fx_subsy == NULL); } @@ -393,10 +331,6 @@ append (char **charPP, char *fromP, unsigned long length) *charPP += length; } -#ifndef BFD_ASSEMBLER -int section_alignment[SEG_MAXIMUM_ORDINAL]; -#endif - /* This routine records the largest alignment seen for each segment. If the beginning of the segment is aligned on the worst-case boundary, all of the other alignments within it will work. At @@ -411,13 +345,9 @@ record_alignment (/* Segment to which alignment pertains. */ { if (seg == absolute_section) return; -#ifdef BFD_ASSEMBLER + if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg)) bfd_set_section_alignment (stdoutput, seg, align); -#else - if (align > section_alignment[(int) seg]) - section_alignment[(int) seg] = align; -#endif } int @@ -425,15 +355,10 @@ get_recorded_alignment (segT seg) { if (seg == absolute_section) return 0; -#ifdef BFD_ASSEMBLER + return bfd_get_section_alignment (stdoutput, seg); -#else - return section_alignment[(int) seg]; -#endif } -#ifdef BFD_ASSEMBLER - /* Reset the section indices after removing the gas created sections. */ static void @@ -445,24 +370,17 @@ renumber_sections (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, PTR countparg) ++*countp; } -#endif /* defined (BFD_ASSEMBLER) */ - -#if defined (BFD_ASSEMBLER) || ! defined (BFD) - static fragS * chain_frchains_together_1 (segT section, struct frchain *frchp) { fragS dummy, *prev_frag = &dummy; -#ifdef BFD_ASSEMBLER fixS fix_dummy, *prev_fix = &fix_dummy; -#endif for (; frchp && frchp->frch_seg == section; frchp = frchp->frch_next) { prev_frag->fr_next = frchp->frch_root; prev_frag = frchp->frch_last; assert (prev_frag->fr_type != 0); -#ifdef BFD_ASSEMBLER if (frchp->fix_root != (fixS *) NULL) { if (seg_info (section)->fix_root == (fixS *) NULL) @@ -471,17 +389,12 @@ chain_frchains_together_1 (segT section, struct frchain *frchp) seg_info (section)->fix_tail = frchp->fix_tail; prev_fix = frchp->fix_tail; } -#endif } assert (prev_frag->fr_type != 0); prev_frag->fr_next = 0; return prev_frag; } -#endif - -#ifdef BFD_ASSEMBLER - static void chain_frchains_together (bfd *abfd ATTRIBUTE_UNUSED, segT section, @@ -501,28 +414,8 @@ chain_frchains_together (bfd *abfd ATTRIBUTE_UNUSED, frags_chained = 1; } -#endif - -#if !defined (BFD) && !defined (BFD_ASSEMBLER) - -static void -remove_subsegs (frchainS *head, int seg, fragS **root, fragS **last) -{ - *root = head->frch_root; - *last = chain_frchains_together_1 (seg, head); -} - -#endif /* BFD */ - -#if defined (BFD_ASSEMBLER) || !defined (BFD) - -#ifdef BFD_ASSEMBLER static void cvt_frag_to_fill (segT sec ATTRIBUTE_UNUSED, fragS *fragP) -#else -static void -cvt_frag_to_fill (object_headers *headersP, segT sec, fragS *fragP) -#endif { switch (fragP->fr_type) { @@ -576,11 +469,7 @@ cvt_frag_to_fill (object_headers *headersP, segT sec, fragS *fragP) break; case rs_machine_dependent: -#ifdef BFD_ASSEMBLER md_convert_frag (stdoutput, sec, fragP); -#else - md_convert_frag (headersP, sec, fragP); -#endif assert (fragP->fr_next == NULL || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address) @@ -620,9 +509,6 @@ cvt_frag_to_fill (object_headers *headersP, segT sec, fragS *fragP) #endif } -#endif /* defined (BFD_ASSEMBLER) || !defined (BFD) */ - -#ifdef BFD_ASSEMBLER static void relax_seg (bfd *, asection *, PTR); static void @@ -1195,126 +1081,17 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED, } } } -#endif -#if defined(BFD_ASSEMBLER) || (!defined (BFD) && !defined(OBJ_AOUT)) static void merge_data_into_text (void) { -#if defined(BFD_ASSEMBLER) || defined(MANY_SEGMENTS) seg_info (text_section)->frchainP->frch_last->fr_next = seg_info (data_section)->frchainP->frch_root; seg_info (text_section)->frchainP->frch_last = seg_info (data_section)->frchainP->frch_last; seg_info (data_section)->frchainP = 0; -#else - fixS *tmp; - - text_last_frag->fr_next = data_frag_root; - text_last_frag = data_last_frag; - data_last_frag = NULL; - data_frag_root = NULL; - if (text_fix_root) - { - for (tmp = text_fix_root; tmp->fx_next; tmp = tmp->fx_next);; - tmp->fx_next = data_fix_root; - text_fix_tail = data_fix_tail; - } - else - text_fix_root = data_fix_root; - data_fix_root = NULL; -#endif -} -#endif /* BFD_ASSEMBLER || (! BFD && ! OBJ_AOUT) */ - -#if !defined (BFD_ASSEMBLER) && !defined (BFD) -static void -relax_and_size_all_segments () -{ - fragS *fragP; - - relax_segment (text_frag_root, SEG_TEXT); - relax_segment (data_frag_root, SEG_DATA); - relax_segment (bss_frag_root, SEG_BSS); - - /* Now the addresses of frags are correct within the segment. */ - know (text_last_frag->fr_type == rs_fill && text_last_frag->fr_offset == 0); - H_SET_TEXT_SIZE (&headers, text_last_frag->fr_address); - text_last_frag->fr_address = H_GET_TEXT_SIZE (&headers); - - /* Join the 2 segments into 1 huge segment. - To do this, re-compute every rn_address in the SEG_DATA frags. - Then join the data frags after the text frags. - - Determine a_data [length of data segment]. */ - if (data_frag_root) - { - register relax_addressT slide; - - know ((text_last_frag->fr_type == rs_fill) - && (text_last_frag->fr_offset == 0)); - - H_SET_DATA_SIZE (&headers, data_last_frag->fr_address); - data_last_frag->fr_address = H_GET_DATA_SIZE (&headers); - slide = H_GET_TEXT_SIZE (&headers); /* & in file of the data segment. */ -#ifdef OBJ_BOUT -#define RoundUp(N,S) (((N)+(S)-1)&-(S)) - /* For b.out: If the data section has a strict alignment - requirement, its load address in the .o file will be - rounded up from the size of the text section. These - two values are *not* the same! Similarly for the bss - section.... */ - slide = RoundUp (slide, 1 << section_alignment[SEG_DATA]); -#endif - - for (fragP = data_frag_root; fragP; fragP = fragP->fr_next) - fragP->fr_address += slide; - - know (text_last_frag != 0); - text_last_frag->fr_next = data_frag_root; - } - else - { - H_SET_DATA_SIZE (&headers, 0); - } - -#ifdef OBJ_BOUT - /* See above comments on b.out data section address. */ - { - addressT bss_vma; - if (data_last_frag == 0) - bss_vma = H_GET_TEXT_SIZE (&headers); - else - bss_vma = data_last_frag->fr_address; - bss_vma = RoundUp (bss_vma, 1 << section_alignment[SEG_BSS]); - bss_address_frag.fr_address = bss_vma; - } -#else /* ! OBJ_BOUT */ - bss_address_frag.fr_address = (H_GET_TEXT_SIZE (&headers) + - H_GET_DATA_SIZE (&headers)); - -#endif /* ! OBJ_BOUT */ - - /* Slide all the frags. */ - if (bss_frag_root) - { - relax_addressT slide = bss_address_frag.fr_address; - - for (fragP = bss_frag_root; fragP; fragP = fragP->fr_next) - fragP->fr_address += slide; - } - - if (bss_last_frag) - H_SET_BSS_SIZE (&headers, - bss_last_frag->fr_address - bss_frag_root->fr_address); - else - H_SET_BSS_SIZE (&headers, 0); } -#endif /* ! BFD_ASSEMBLER && ! BFD */ - -#if defined (BFD_ASSEMBLER) || !defined (BFD) -#ifdef BFD_ASSEMBLER static void set_symtab (void) { @@ -1350,7 +1127,6 @@ set_symtab (void) assert (result); symbol_table_frozen = 1; } -#endif /* Finish the subsegments. After every sub-segment, we fake an ".align ...". This conforms to BSD4.2 brane-damage. We then fake @@ -1367,11 +1143,7 @@ set_symtab (void) (!(FRCHAIN)->frch_next || (FRCHAIN)->frch_next->frch_seg != (SEG) \ ? get_recorded_alignment (SEG) : 0) #else -#ifdef BFD_ASSEMBLER #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 -#else -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 2 -#endif #endif #endif @@ -1392,7 +1164,6 @@ subsegs_finish (void) if (!had_errors ()) { alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP); -#ifdef BFD_ASSEMBLER if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE) && now_seg->entsize) { @@ -1407,7 +1178,6 @@ subsegs_finish (void) if (entalign > alignment) alignment = entalign; } -#endif } if (subseg_text_p (now_seg)) @@ -1431,7 +1201,7 @@ subsegs_finish (void) void write_object_file (void) { -#if ! defined (BFD_ASSEMBLER) || ! defined (WORKING_DOT_WORD) +#ifndef WORKING_DOT_WORD fragS *fragP; /* Track along all frags. */ #endif @@ -1468,7 +1238,6 @@ write_object_file (void) /* From now on, we don't care about sub-segments. Build one frag chain for each segment. Linked thru fr_next. */ -#ifdef BFD_ASSEMBLER /* Remove the sections created by gas for its own purposes. */ { int i; @@ -1481,23 +1250,15 @@ write_object_file (void) } bfd_map_over_sections (stdoutput, chain_frchains_together, (char *) 0); -#else - remove_subsegs (frchain_root, SEG_TEXT, &text_frag_root, &text_last_frag); - remove_subsegs (data0_frchainP, SEG_DATA, &data_frag_root, &data_last_frag); - remove_subsegs (bss0_frchainP, SEG_BSS, &bss_frag_root, &bss_last_frag); -#endif /* We have two segments. If user gave -R flag, then we must put the data frags into the text segment. Do this before relaxing so we know to take advantage of -R and make shorter addresses. */ -#if !defined (OBJ_AOUT) || defined (BFD_ASSEMBLER) if (flag_readonly_data_in_text) { merge_data_into_text (); } -#endif -#ifdef BFD_ASSEMBLER while (1) { int changed; @@ -1538,9 +1299,6 @@ write_object_file (void) finalize_syms = TC_FINALIZE_SYMS_BEFORE_SIZE_SEG; bfd_map_over_sections (stdoutput, size_seg, (char *) 0); -#else - relax_and_size_all_segments (); -#endif /* BFD_ASSEMBLER */ /* Relaxation has completed. Freeze all syms. */ finalize_syms = 1; @@ -1549,64 +1307,6 @@ write_object_file (void) md_post_relax_hook; #endif -#ifndef BFD_ASSEMBLER - /* Crawl the symbol chain. - - For each symbol whose value depends on a frag, take the address of - that frag and subsume it into the value of the symbol. - After this, there is just one way to lookup a symbol value. - Values are left in their final state for object file emission. - We adjust the values of 'L' local symbols, even if we do - not intend to emit them to the object file, because their values - are needed for fix-ups. - - Unless we saw a -L flag, remove all symbols that begin with 'L' - from the symbol chain. (They are still pointed to by the fixes.) - - Count the remaining symbols. - Assign a symbol number to each symbol. - Count the number of string-table chars we will emit. - Put this info into the headers as appropriate. */ - know (zero_address_frag.fr_address == 0); - string_byte_count = 4; - - obj_crawl_symbol_chain (&headers); - - if (string_byte_count == 4) - string_byte_count = 0; - - H_SET_STRING_SIZE (&headers, string_byte_count); - - /* Addresses of frags now reflect addresses we use in the object file. - Symbol values are correct. - Scan the frags, converting any ".org"s and ".align"s to ".fill"s. - Also converting any machine-dependent frags using md_convert_frag(); */ - subseg_change (SEG_TEXT, 0); - - for (fragP = text_frag_root; fragP; fragP = fragP->fr_next) - { - /* At this point we have linked all the frags into a single - chain. However, cvt_frag_to_fill may call md_convert_frag - which may call fix_new. We need to ensure that fix_new adds - the fixup to the right section. */ - if (fragP == data_frag_root) - subseg_change (SEG_DATA, 0); - - cvt_frag_to_fill (&headers, SEG_TEXT, fragP); - - /* Some assert macros don't work with # directives mixed in. */ -#ifndef NDEBUG - if (!(fragP->fr_next == NULL -#ifdef OBJ_BOUT - || fragP->fr_next == data_frag_root -#endif - || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address) - == (fragP->fr_fix + fragP->fr_offset * fragP->fr_var)))) - abort (); -#endif - } -#endif /* ! BFD_ASSEMBLER */ - #ifndef WORKING_DOT_WORD { struct broken_word *lie; @@ -1623,7 +1323,6 @@ write_object_file (void) exp.X_add_symbol = lie->add; exp.X_op_symbol = lie->sub; exp.X_add_number = lie->addnum; -#ifdef BFD_ASSEMBLER #ifdef TC_CONS_FIX_NEW TC_CONS_FIX_NEW (lie->frag, lie->word_goes_here - lie->frag->fr_literal, @@ -1633,23 +1332,6 @@ write_object_file (void) lie->word_goes_here - lie->frag->fr_literal, 2, &exp, 0, BFD_RELOC_16); #endif -#else -#if defined(TC_SPARC) || defined(TC_A29K) || defined(NEED_FX_R_TYPE) - fix_new_exp (lie->frag, - lie->word_goes_here - lie->frag->fr_literal, - 2, &exp, 0, NO_RELOC); -#else -#ifdef TC_NS32K - fix_new_ns32k_exp (lie->frag, - lie->word_goes_here - lie->frag->fr_literal, - 2, &exp, 0, 0, 2, 0, 0); -#else - fix_new_exp (lie->frag, - lie->word_goes_here - lie->frag->fr_literal, - 2, &exp, 0, 0); -#endif /* TC_NS32K */ -#endif /* TC_SPARC|TC_A29K|NEED_FX_R_TYPE */ -#endif /* BFD_ASSEMBLER */ *prevP = lie->next_broken_word; } else @@ -1720,132 +1402,6 @@ write_object_file (void) } #endif /* not WORKING_DOT_WORD */ -#ifndef BFD_ASSEMBLER -#ifndef OBJ_VMS - { /* not vms */ - char *the_object_file; - long object_file_size; - /* Scan every FixS performing fixups. We had to wait until now to - do this because md_convert_frag() may have made some fixSs. */ - int trsize, drsize; - - subseg_change (SEG_TEXT, 0); - trsize = md_reloc_size * fixup_segment (text_fix_root, SEG_TEXT); - subseg_change (SEG_DATA, 0); - drsize = md_reloc_size * fixup_segment (data_fix_root, SEG_DATA); - H_SET_RELOCATION_SIZE (&headers, trsize, drsize); - - /* FIXME: Move this stuff into the pre-write-hook. */ - H_SET_MAGIC_NUMBER (&headers, magic_number_for_object_file); - H_SET_ENTRY_POINT (&headers, 0); - - obj_pre_write_hook (&headers); /* Extra coff stuff. */ - - object_file_size = H_GET_FILE_SIZE (&headers); - next_object_file_charP = the_object_file = xmalloc (object_file_size); - - output_file_create (out_file_name); - - obj_header_append (&next_object_file_charP, &headers); - - know ((next_object_file_charP - the_object_file) - == H_GET_HEADER_SIZE (&headers)); - - /* Emit code. */ - for (fragP = text_frag_root; fragP; fragP = fragP->fr_next) - { - register long count; - register char *fill_literal; - register long fill_size; - - PROGRESS (1); - know (fragP->fr_type == rs_fill); - append (&next_object_file_charP, fragP->fr_literal, - (unsigned long) fragP->fr_fix); - fill_literal = fragP->fr_literal + fragP->fr_fix; - fill_size = fragP->fr_var; - know (fragP->fr_offset >= 0); - - for (count = fragP->fr_offset; count; count--) - append (&next_object_file_charP, fill_literal, - (unsigned long) fill_size); - } - - know ((next_object_file_charP - the_object_file) - == (H_GET_HEADER_SIZE (&headers) - + H_GET_TEXT_SIZE (&headers) - + H_GET_DATA_SIZE (&headers))); - - /* Emit relocations. */ - obj_emit_relocations (&next_object_file_charP, text_fix_root, - (relax_addressT) 0); - know ((next_object_file_charP - the_object_file) - == (H_GET_HEADER_SIZE (&headers) - + H_GET_TEXT_SIZE (&headers) - + H_GET_DATA_SIZE (&headers) - + H_GET_TEXT_RELOCATION_SIZE (&headers))); -#ifdef TC_I960 - /* Make addresses in data relocation directives relative to beginning of - first data fragment, not end of last text fragment: alignment of the - start of the data segment may place a gap between the segments. */ - obj_emit_relocations (&next_object_file_charP, data_fix_root, - data0_frchainP->frch_root->fr_address); -#else /* TC_I960 */ - obj_emit_relocations (&next_object_file_charP, data_fix_root, - text_last_frag->fr_address); -#endif /* TC_I960 */ - - know ((next_object_file_charP - the_object_file) - == (H_GET_HEADER_SIZE (&headers) - + H_GET_TEXT_SIZE (&headers) - + H_GET_DATA_SIZE (&headers) - + H_GET_TEXT_RELOCATION_SIZE (&headers) - + H_GET_DATA_RELOCATION_SIZE (&headers))); - - /* Emit line number entries. */ - OBJ_EMIT_LINENO (&next_object_file_charP, lineno_rootP, the_object_file); - know ((next_object_file_charP - the_object_file) - == (H_GET_HEADER_SIZE (&headers) - + H_GET_TEXT_SIZE (&headers) - + H_GET_DATA_SIZE (&headers) - + H_GET_TEXT_RELOCATION_SIZE (&headers) - + H_GET_DATA_RELOCATION_SIZE (&headers) - + H_GET_LINENO_SIZE (&headers))); - - /* Emit symbols. */ - obj_emit_symbols (&next_object_file_charP, symbol_rootP); - know ((next_object_file_charP - the_object_file) - == (H_GET_HEADER_SIZE (&headers) - + H_GET_TEXT_SIZE (&headers) - + H_GET_DATA_SIZE (&headers) - + H_GET_TEXT_RELOCATION_SIZE (&headers) - + H_GET_DATA_RELOCATION_SIZE (&headers) - + H_GET_LINENO_SIZE (&headers) - + H_GET_SYMBOL_TABLE_SIZE (&headers))); - - /* Emit strings. */ - if (string_byte_count > 0) - obj_emit_strings (&next_object_file_charP); - -#ifdef BFD_HEADERS - bfd_seek (stdoutput, (file_ptr) 0, 0); - bfd_bwrite (the_object_file, (bfd_size_type) object_file_size, stdoutput); -#else - - /* Write the data to the file. */ - output_file_append (the_object_file, object_file_size, out_file_name); - free (the_object_file); -#endif - } -#else /* OBJ_VMS */ - /* Now do the VMS-dependent part of writing the object file. */ - vms_write_object_file (H_GET_TEXT_SIZE (&headers), - H_GET_DATA_SIZE (&headers), - H_GET_BSS_SIZE (&headers), - text_frag_root, data_frag_root); -#endif /* OBJ_VMS */ -#else /* BFD_ASSEMBLER */ - /* Resolve symbol values. This needs to be done before processing the relocations. */ if (symbol_rootP) @@ -2032,12 +1588,9 @@ write_object_file (void) #endif bfd_map_over_sections (stdoutput, write_contents, (char *) 0); -#endif /* BFD_ASSEMBLER */ } -#endif /* ! BFD */ #ifdef TC_GENERIC_RELAX_TABLE - /* Relax a fragment by scanning TC_GENERIC_RELAX_TABLE. */ long @@ -2068,12 +1621,6 @@ relax_frag (segT segment, fragS *fragP, long stretch) sym_frag = symbol_get_frag (symbolP); #ifndef DIFF_EXPR_OK -#if !defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER) - know ((S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE) - || (S_GET_SEGMENT (symbolP) == SEG_DATA) - || (S_GET_SEGMENT (symbolP) == SEG_BSS) - || (S_GET_SEGMENT (symbolP) == SEG_TEXT)); -#endif know (sym_frag != NULL); #endif know (S_GET_SEGMENT (symbolP) != absolute_section @@ -2178,9 +1725,6 @@ relax_segment (struct frag *segment_frag_root, segT segment) register relax_addressT address; int ret; -#if !defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER) - know (segment == SEG_DATA || segment == SEG_TEXT || segment == SEG_BSS); -#endif /* In case md_estimate_size_before_relax() wants to make fixSs. */ subseg_change (segment, 0); @@ -2387,22 +1931,11 @@ relax_segment (struct frag *segment_frag_root, segT segment) if (symbolP) { -#if !defined (MANY_SEGMENTS) && !defined (BFD_ASSEMBLER) - know ((S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE) - || (S_GET_SEGMENT (symbolP) == SEG_DATA) - || (S_GET_SEGMENT (symbolP) == SEG_TEXT) - || S_GET_SEGMENT (symbolP) == SEG_BSS); - know (symbolP->sy_frag); - know (!(S_GET_SEGMENT (symbolP) == SEG_ABSOLUTE) - || (symbolP->sy_frag == &zero_address_frag)); -#endif /* Convert from an actual address to an octet offset into the section. Here it is assumed that the section's VMA is zero, and can omit subtracting it from the symbol's value to get the address offset. */ -#ifdef BFD_ASSEMBLER know (S_GET_SEGMENT (symbolP)->vma == 0); -#endif target += S_GET_VALUE (symbolP) * OCTETS_PER_BYTE; } @@ -2515,8 +2048,6 @@ relax_segment (struct frag *segment_frag_root, segT segment) return ret; } -#if defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS)) - /* fixup_segment() Go through all the fixS's in a segment and see which ones can be @@ -2537,13 +2068,7 @@ fixup_segment (fixS *fixP, segT this_segment) segT add_symbol_segment = absolute_section; if (fixP != NULL && abs_section_sym == NULL) - { -#ifndef BFD_ASSEMBLER - abs_section_sym = &abs_symbol; -#else - abs_section_sym = section_symbol (absolute_section); -#endif - } + abs_section_sym = section_symbol (absolute_section); /* If the linker is doing the relaxing, we must not do any fixups. @@ -2682,9 +2207,7 @@ fixup_segment (fixS *fixP, segT this_segment) fixP->fx_addsy = NULL; } else if (add_symbol_segment != undefined_section -#ifdef BFD_ASSEMBLER && ! bfd_is_com_section (add_symbol_segment) -#endif && MD_APPLY_SYM_VALUE (fixP)) add_number += S_GET_VALUE (fixP->fx_addsy); } @@ -2765,8 +2288,6 @@ fixup_segment (fixS *fixP, segT this_segment) return seg_reloc_count; } -#endif /* defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS)) */ - void number_to_chars_bigendian (char *buf, valueT val, int n) { @@ -2824,14 +2345,8 @@ print_fixup (fixS *fixp) fprintf (stderr, "\n size=%d frag=%lx where=%ld offset=%lx addnumber=%lx", fixp->fx_size, (long) fixp->fx_frag, (long) fixp->fx_where, (long) fixp->fx_offset, (long) fixp->fx_addnumber); -#ifdef BFD_ASSEMBLER fprintf (stderr, "\n %s (%d)", bfd_get_reloc_code_name (fixp->fx_r_type), fixp->fx_r_type); -#else -#ifdef NEED_FX_R_TYPE - fprintf (stderr, " r_type=%d", fixp->fx_r_type); -#endif -#endif if (fixp->fx_addsy) { fprintf (stderr, "\n +<"); diff --git a/gas/write.h b/gas/write.h index f2e3cf2..77ce75e 100644 --- a/gas/write.h +++ b/gas/write.h @@ -1,6 +1,6 @@ /* write.h Copyright 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. + 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -28,16 +28,6 @@ #endif #endif /* TC_I960 */ -#ifndef BFD_ASSEMBLER - -#ifndef LOCAL_LABEL -#define LOCAL_LABEL(name) (name [0] == 'L' ) -#endif - -#define S_LOCAL_NAME(s) (LOCAL_LABEL (S_GET_NAME (s))) - -#endif /* ! BFD_ASSEMBLER */ - /* This is the name of a fake symbol which will never appear in the assembler output. S_IS_LOCAL detects it because of the \001. */ #ifndef FAKE_LABEL_NAME @@ -120,15 +110,7 @@ struct fix processing. */ bit_fixS *fx_bit_fixP; -#ifdef BFD_ASSEMBLER bfd_reloc_code_real_type fx_r_type; -#else -#ifdef NEED_FX_R_TYPE - /* Hack for machines where the type of reloc can't be - worked out by looking at how big it is. */ - int fx_r_type; -#endif -#endif /* This field is sort of misnamed. It appears to be a sort of random scratch field, for use by the back ends. The main gas code doesn't @@ -165,20 +147,6 @@ typedef struct fix fixS; extern int finalize_syms; extern symbolS *abs_section_sym; extern addressT dot_value; - -#ifndef BFD_ASSEMBLER -extern char *next_object_file_charP; - -#ifndef MANY_SEGMENTS -COMMON fixS *text_fix_root, *text_fix_tail; /* Chains fixSs. */ -COMMON fixS *data_fix_root, *data_fix_tail; /* Chains fixSs. */ -COMMON fixS *bss_fix_root, *bss_fix_tail; /* Chains fixSs. */ -extern struct frag *text_last_frag; /* Last frag in segment. */ -extern struct frag *data_last_frag; /* Last frag in segment. */ -#endif -COMMON fixS **seg_fix_rootP, **seg_fix_tailP; /* -> one of above. */ -#endif - extern long string_byte_count; extern int section_alignment[]; @@ -189,26 +157,14 @@ extern void subsegs_finish (void); extern void write_object_file (void); extern long relax_frag (segT, fragS *, long); extern int relax_segment (struct frag * seg_frag_root, segT seg_type); - extern void number_to_chars_littleendian (char *, valueT, int); extern void number_to_chars_bigendian (char *, valueT, int); - -#ifdef BFD_ASSEMBLER extern fixS *fix_new (fragS * frag, int where, int size, symbolS * add_symbol, offsetT offset, int pcrel, bfd_reloc_code_real_type r_type); extern fixS *fix_new_exp (fragS * frag, int where, int size, expressionS *exp, int pcrel, bfd_reloc_code_real_type r_type); -#else -extern fixS *fix_new - (fragS * frag, int where, int size, symbolS * add_symbol, - offsetT offset, int pcrel, int r_type); -extern fixS *fix_new_exp - (fragS * frag, int where, int size, expressionS *exp, int pcrel, - int r_type); -#endif - extern void write_print_statistics (FILE *); #endif /* __write_h__ */ |