Move backend-specific code to output/; break out null debug stuff
authorH. Peter Anvin <hpa@zytor.com>
Sun, 28 Jun 2009 05:07:33 +0000 (22:07 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 28 Jun 2009 05:07:33 +0000 (22:07 -0700)
Move backend-specific code into the output/ directory, and make the
null debugging backend a separate file (it certainly isn't needed for
ndisasm...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
31 files changed:
Makefile.in
Mkfiles/msvc.mak
Mkfiles/netware.mak
Mkfiles/openwcom.mak
Mkfiles/owlinux.mak
doc/nasmdoc.src
macros.pl
nasm.c
nasmlib.c
outform.c [deleted file]
outform.h [deleted file]
outlib.c [deleted file]
outlib.h [deleted file]
output/nulldbg.c [new file with mode: 0644]
output/outaout.c
output/outas86.c
output/outbin.c
output/outcoff.c
output/outdbg.c
output/outelf.c
output/outelf32.c
output/outelf64.c
output/outform.c [new file with mode: 0644]
output/outform.h [new file with mode: 0644]
output/outieee.c
output/outlib.c [new file with mode: 0644]
output/outlib.h [new file with mode: 0644]
output/outmacho.c
output/outobj.c
output/outrdf.c
output/outrdf2.c

index fbdf3f687ca80f906174813d3d521bf76ddaa8e3..296d92df6ee73fb7bd522d6f24e43438319a09c8 100644 (file)
@@ -63,8 +63,8 @@ NASM =        nasm.$(O) nasmlib.$(O) ver.$(O) \
        raa.$(O) saa.$(O) rbtree.$(O) \
        float.$(O) insnsa.$(O) insnsb.$(O) \
        assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
-       outform.$(O) outlib.$(O) output/outbin.$(O) \
-       output/outaout.$(O) output/outcoff.$(O) \
+       output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
+       output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
        output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
        output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
        output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
@@ -271,50 +271,56 @@ lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h config.h nasmlib.h
 listing.$(O): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h
 macros.$(O): macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h regs.h tables.h
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h tables.h
 nasm.$(O): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
- insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \
- preproc.h raa.h regs.h saa.h stdscan.h tokens.h
+ insnsi.h labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h \
+ pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h
 nasmlib.$(O): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h tokens.h
 ndisasm.$(O): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
-outform.$(O): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
-outlib.$(O): outlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h outlib.h \
- pptok.h preproc.h regs.h
+output/nulldbg.$(O): output/nulldbg.c
 output/outaout.$(O): output/outaout.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h stdscan.h
 output/outas86.$(O): output/outas86.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
 output/outbin.$(O): output/outbin.c compiler.h config.h eval.h insnsi.h \
- labels.h nasm.h nasmlib.h outform.h outlib.h pptok.h preproc.h regs.h saa.h \
- stdscan.h
+ labels.h nasm.h nasmlib.h output/outform.h output/outlib.h pptok.h \
preproc.h regs.h saa.h stdscan.h
 output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
 output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h regs.h
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h
 output/outelf.$(O): output/outelf.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h output/dwarf.h output/elfcommon.h output/outelf.h pptok.h \
- preproc.h regs.h
+ nasmlib.h output/dwarf.h output/elfcommon.h output/outelf.h \
output/outform.h pptok.h preproc.h regs.h
 output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h output/dwarf.h output/elf32.h \
- output/elfcommon.h output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ nasmlib.h output/dwarf.h output/elf32.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
  saa.h stdscan.h
 output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h output/dwarf.h output/elf64.h \
- output/elfcommon.h output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ nasmlib.h output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
  saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h config.h insnsi.h nasm.h \
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h
 output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h regs.h
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h config.h insnsi.h nasm.h \
+ nasmlib.h output/outlib.h pptok.h preproc.h regs.h
 output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h \
+ saa.h
 output/outobj.$(O): output/outobj.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h regs.h stdscan.h
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h stdscan.h
 output/outrdf.$(O): output/outrdf.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h regs.h
+ nasmlib.h output/outform.h pptok.h preproc.h regs.h
 output/outrdf2.$(O): output/outrdf2.c compiler.h config.h insnsi.h nasm.h \
- nasmlib.h outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+ nasmlib.h output/outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+owtest.$(O): owtest.c
 parser.$(O): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
  nasmlib.h parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
 pptok.$(O): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
index e70f1e1ec6078d2ec1ba7ff9ae819fc972427d99..cee0249bc0a0012fd2b3fbc91fc32ffcec641a57 100644 (file)
@@ -38,8 +38,8 @@ NASM =        nasm.$(O) nasmlib.$(O) ver.$(O) \
        raa.$(O) saa.$(O) rbtree.$(O) \
        float.$(O) insnsa.$(O) insnsb.$(O) \
        assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
-       outform.$(O) outlib.$(O) output/outbin.$(O) \
-       output/outaout.$(O) output/outcoff.$(O) \
+       output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
+       output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
        output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
        output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
        output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
@@ -209,47 +209,53 @@ lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
  pptok.h preproc.h regs.h
 macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h tables.h
+ output/outform.h pptok.h preproc.h regs.h tables.h
 nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
- labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
- raa.h regs.h saa.h stdscan.h tokens.h
+ labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h pptok.h \
preproc.h raa.h regs.h saa.h stdscan.h tokens.h
 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
  preproc.h regs.h tokens.h
 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
-outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
- pptok.h preproc.h regs.h
-outlib.$(O): outlib.c compiler.h insnsi.h nasm.h nasmlib.h outlib.h pptok.h \
- preproc.h regs.h
+output/nulldbg.$(O): output/nulldbg.c
 output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h \
+ stdscan.h
 output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
- nasm.h nasmlib.h outform.h outlib.h pptok.h preproc.h regs.h saa.h \
- stdscan.h
+ nasm.h nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h regs.h \
+ saa.h stdscan.h
 output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
 output/outelf.$(O): output/outelf.c compiler.h insnsi.h nasm.h nasmlib.h \
- output/dwarf.h output/elfcommon.h output/outelf.h pptok.h preproc.h regs.h
+ output/dwarf.h output/elfcommon.h output/outelf.h output/outform.h pptok.h \
+ preproc.h regs.h
 output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h output/dwarf.h output/elf32.h output/elfcommon.h \
- output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output/dwarf.h output/elf32.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ saa.h stdscan.h
 output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h output/dwarf.h output/elf64.h output/elfcommon.h \
- output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outform.h pptok.h preproc.h regs.h
 output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outlib.h pptok.h preproc.h regs.h
 output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h stdscan.h
+ output/outform.h pptok.h preproc.h regs.h stdscan.h
 output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
 output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+ output/outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+owtest.$(O): owtest.c
 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
  parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
index 30a575a43200af9b2f3862b88926c94b888eea03..0e22b49fa12aa6e16bb406a472d689d99af9b501 100644 (file)
@@ -34,8 +34,8 @@ NASM =        nasm.o nasmlib.o ver.o \
        raa.o saa.o rbtree.o \
        float.o insnsa.o insnsb.o \
        assemble.o labels.o hashtbl.o crc64.o parser.o \
-       outform.o outlib.o outbin.o \
-       outaout.o outcoff.o \
+       outform.o outlib.o nulldbg.o \
+       outbin.o outaout.o outcoff.o \
        outelf.o outelf32.o outelf64.o \
        outobj.o outas86.o outrdf2.o \
        outdbg.o outieee.o outmacho.o \
@@ -157,10 +157,7 @@ nasmlib.o: nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
  pptok.h preproc.h regs.h tokens.h
 ndisasm.o: ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
-outform.o: outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
- pptok.h preproc.h regs.h
-outlib.o: outlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h outlib.h \
- pptok.h preproc.h regs.h
+nulldbg.o: nulldbg.c
 outaout.o: outaout.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
  outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
 outas86.o: outas86.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
@@ -172,15 +169,19 @@ outcoff.o: outcoff.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
 outdbg.o: outdbg.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
  pptok.h preproc.h regs.h
 outelf.o: outelf.c compiler.h config.h insnsi.h nasm.h nasmlib.h dwarf.h \
- elfcommon.h outelf.h pptok.h preproc.h regs.h
-outelf32.o: outelf32.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h dwarf.h elf32.h elfcommon.h outelf.h pptok.h preproc.h \
- raa.h rbtree.h regs.h saa.h stdscan.h
-outelf64.o: outelf64.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h dwarf.h elf64.h elfcommon.h outelf.h pptok.h preproc.h \
- raa.h rbtree.h regs.h saa.h stdscan.h
+ elfcommon.h outelf.h outform.h pptok.h preproc.h regs.h
+outelf32.o: outelf32.c compiler.h config.h insnsi.h nasm.h nasmlib.h dwarf.h \
+ elf32.h elfcommon.h outelf.h outform.h outlib.h pptok.h preproc.h raa.h \
+ rbtree.h regs.h saa.h stdscan.h
+outelf64.o: outelf64.c compiler.h config.h insnsi.h nasm.h nasmlib.h dwarf.h \
+ elf64.h elfcommon.h outelf.h outform.h outlib.h pptok.h preproc.h raa.h \
+ rbtree.h regs.h saa.h stdscan.h
+outform.o: outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
+ pptok.h preproc.h regs.h
 outieee.o: outieee.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
  pptok.h preproc.h regs.h
+outlib.o: outlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h outlib.h \
+ pptok.h preproc.h regs.h
 outmacho.o: outmacho.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
  outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
 outobj.o: outobj.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
@@ -189,6 +190,7 @@ outrdf.o: outrdf.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
  pptok.h preproc.h regs.h
 outrdf2.o: outrdf2.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \
  pptok.h preproc.h rdoff.h regs.h saa.h
+owtest.o: owtest.c
 parser.o: parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
  nasmlib.h parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
 pptok.o: pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h preproc.h
index 80770b79e1bc7c517e5f29360dc50a0c10368bdc..a27cc68daaaf38e27972602bb19fcf04eb46b6fb 100644 (file)
@@ -50,8 +50,8 @@ NASM =        nasm.$(O) nasmlib.$(O) ver.$(O) &
        raa.$(O) saa.$(O) rbtree.$(O) &
        float.$(O) insnsa.$(O) insnsb.$(O) &
        assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) &
-       outform.$(O) outlib.$(O) output\outbin.$(O) &
-       output\outaout.$(O) output\outcoff.$(O) &
+       output\outform.$(O) output\outlib.$(O) output\nulldbg.$(O) &
+       output\outbin.$(O) output\outaout.$(O) output\outcoff.$(O) &
        output\outelf.$(O) output\outelf32.$(O) output\outelf64.$(O) &
        output\outobj.$(O) output\outas86.$(O) output\outrdf2.$(O) &
        output\outdbg.$(O) output\outieee.$(O) output\outmacho.$(O) &
@@ -238,47 +238,53 @@ lib\vsnprintf.$(O): lib\vsnprintf.c compiler.h nasmlib.h
 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h &
  pptok.h preproc.h regs.h
 macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h regs.h tables.h
+ output\outform.h pptok.h preproc.h regs.h tables.h
 nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h &
- labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h &
- raa.h regs.h saa.h stdscan.h tokens.h
+ labels.h listing.h nasm.h nasmlib.h output\outform.h parser.h pptok.h &
preproc.h raa.h regs.h saa.h stdscan.h tokens.h
 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h &
  preproc.h regs.h tokens.h
 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h &
  nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
-outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h &
- pptok.h preproc.h regs.h
-outlib.$(O): outlib.c compiler.h insnsi.h nasm.h nasmlib.h outlib.h pptok.h &
- preproc.h regs.h
+output\nulldbg.$(O): output\nulldbg.c
 output\outaout.$(O): output\outaout.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h saa.h &
+ stdscan.h
 output\outas86.$(O): output\outas86.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output\outbin.$(O): output\outbin.c compiler.h eval.h insnsi.h labels.h &
- nasm.h nasmlib.h outform.h outlib.h pptok.h preproc.h regs.h saa.h &
- stdscan.h
+ nasm.h nasmlib.h output\outform.h output\outlib.h pptok.h preproc.h regs.h &
+ saa.h stdscan.h
 output\outcoff.$(O): output\outcoff.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output\outdbg.$(O): output\outdbg.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h regs.h
+ output\outform.h pptok.h preproc.h regs.h
 output\outelf.$(O): output\outelf.c compiler.h insnsi.h nasm.h nasmlib.h &
- output\dwarf.h output\elfcommon.h output\outelf.h pptok.h preproc.h regs.h
+ output\dwarf.h output\elfcommon.h output\outelf.h output\outform.h pptok.h &
+ preproc.h regs.h
 output\outelf32.$(O): output\outelf32.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h output\dwarf.h output\elf32.h output\elfcommon.h &
- output\outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output\dwarf.h output\elf32.h output\elfcommon.h output\outelf.h &
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h rbtree.h regs.h &
+ saa.h stdscan.h
 output\outelf64.$(O): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h output\dwarf.h output\elf64.h output\elfcommon.h &
- output\outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output\dwarf.h output\elf64.h output\elfcommon.h output\outelf.h &
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h rbtree.h regs.h &
+ saa.h stdscan.h
+output\outform.$(O): output\outform.c compiler.h insnsi.h nasm.h nasmlib.h &
+ output\outform.h pptok.h preproc.h regs.h
 output\outieee.$(O): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h regs.h
+ output\outform.h pptok.h preproc.h regs.h
+output\outlib.$(O): output\outlib.c compiler.h insnsi.h nasm.h nasmlib.h &
+ output\outlib.h pptok.h preproc.h regs.h
 output\outmacho.$(O): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output\outform.h output\outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output\outobj.$(O): output\outobj.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h regs.h stdscan.h
+ output\outform.h pptok.h preproc.h regs.h stdscan.h
 output\outrdf.$(O): output\outrdf.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h regs.h
+ output\outform.h pptok.h preproc.h regs.h
 output\outrdf2.$(O): output\outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h &
- outform.h pptok.h preproc.h rdoff\rdoff.h regs.h saa.h
+ output\outform.h pptok.h preproc.h rdoff\rdoff.h regs.h saa.h
+owtest.$(O): owtest.c
 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h &
  parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
index a9ef0011f7f3dc40b2df034f7329a65a43d6f697..c2a03c80667205cdc2159fd9974b2f7a97e5a7fe 100644 (file)
@@ -61,8 +61,8 @@ NASM =        nasm.$(O) nasmlib.$(O) ver.$(O) \
        raa.$(O) saa.$(O) rbtree.$(O) \
        float.$(O) insnsa.$(O) insnsb.$(O) \
        assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
-       outform.$(O) outlib.$(O) output/outbin.$(O) \
-       output/outaout.$(O) output/outcoff.$(O) \
+       output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \
+       output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
        output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
        output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
        output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
@@ -248,47 +248,53 @@ lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
  pptok.h preproc.h regs.h
 macros.$(O): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h tables.h
+ output/outform.h pptok.h preproc.h regs.h tables.h
 nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
- labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
- raa.h regs.h saa.h stdscan.h tokens.h
+ labels.h listing.h nasm.h nasmlib.h output/outform.h parser.h pptok.h \
preproc.h raa.h regs.h saa.h stdscan.h tokens.h
 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h \
  preproc.h regs.h tokens.h
 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
  nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
-outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
- pptok.h preproc.h regs.h
-outlib.$(O): outlib.c compiler.h insnsi.h nasm.h nasmlib.h outlib.h pptok.h \
- preproc.h regs.h
+output/nulldbg.$(O): output/nulldbg.c
 output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h \
+ stdscan.h
 output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
- nasm.h nasmlib.h outform.h outlib.h pptok.h preproc.h regs.h saa.h \
- stdscan.h
+ nasm.h nasmlib.h output/outform.h output/outlib.h pptok.h preproc.h regs.h \
+ saa.h stdscan.h
 output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
 output/outelf.$(O): output/outelf.c compiler.h insnsi.h nasm.h nasmlib.h \
- output/dwarf.h output/elfcommon.h output/outelf.h pptok.h preproc.h regs.h
+ output/dwarf.h output/elfcommon.h output/outelf.h output/outform.h pptok.h \
+ preproc.h regs.h
 output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h output/dwarf.h output/elf32.h output/elfcommon.h \
- output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output/dwarf.h output/elf32.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ saa.h stdscan.h
 output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h output/dwarf.h output/elf64.h output/elfcommon.h \
- output/outelf.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
+ output/dwarf.h output/elf64.h output/elfcommon.h output/outelf.h \
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h rbtree.h regs.h \
+ saa.h stdscan.h
+output/outform.$(O): output/outform.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outform.h pptok.h preproc.h regs.h
 output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
+output/outlib.$(O): output/outlib.c compiler.h insnsi.h nasm.h nasmlib.h \
+ output/outlib.h pptok.h preproc.h regs.h
 output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
+ output/outform.h output/outlib.h pptok.h preproc.h raa.h regs.h saa.h
 output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h stdscan.h
+ output/outform.h pptok.h preproc.h regs.h stdscan.h
 output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h regs.h
+ output/outform.h pptok.h preproc.h regs.h
 output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
- outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+ output/outform.h pptok.h preproc.h rdoff/rdoff.h regs.h saa.h
+owtest.$(O): owtest.c
 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
  parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
index 888a19fa5ec983355dcb2138e9f25ff13b63dc4b..656b82c4bd569ad53aa1d8d48ae7c31ebdcdfeb4 100644 (file)
@@ -5690,7 +5690,7 @@ a hint as to where to find requested symbols.
 
 The \c{dbg} output format is not built into NASM in the default
 configuration. If you are building your own NASM executable from the
-sources, you can define \i\c{OF_DBG} in \c{outform.h} or on the
+sources, you can define \i\c{OF_DBG} in \c{output/outform.h} or on the
 compiler command line, and obtain the \c{dbg} output format.
 
 The \c{dbg} format does not output an object file as such; instead,
index 2eb5167be0b95a85ea7f9212d03b6a0362a7017f..d86da96d03019034cb47bf16275474627a613a19 100755 (executable)
--- a/macros.pl
+++ b/macros.pl
@@ -47,7 +47,7 @@ print OUT "\n";
 print OUT "#include \"tables.h\"\n";
 print OUT "#include \"nasmlib.h\"\n";
 print OUT "#include \"hashtbl.h\"\n";
-print OUT "#include \"outform.h\"\n";
+print OUT "#include \"output/outform.h\"\n";
 print OUT "\n";
 print OUT "#if 1\n";
 print OUT "const unsigned char nasm_stdmac[] = {";
diff --git a/nasm.c b/nasm.c
index 632d79499df826cc7cc42ec81aaca46090332b95..2819b66b1f6500e3738810621c1f4a57f5e22124 100644 (file)
--- a/nasm.c
+++ b/nasm.c
@@ -29,7 +29,7 @@
 #include "eval.h"
 #include "assemble.h"
 #include "labels.h"
-#include "outform.h"
+#include "output/outform.h"
 #include "listing.h"
 
 struct forwrefinfo {            /* info held on forward refs. */
index 94c9ddac55068e0317c696b4089183a4f7c7cfe6..5291832d3ff66b0b5c89072e727d5845e473e40a 100644 (file)
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -606,57 +606,3 @@ char *nasm_strcat(const char *one, const char *two)
     strcpy(rslt + l1, two);
     return rslt;
 }
-
-void null_debug_init(struct ofmt *of, void *id, FILE * fp, efunc error)
-{
-       (void)of;
-       (void)id;
-       (void)fp;
-       (void)error;
-}
-void null_debug_linenum(const char *filename, int32_t linenumber, int32_t segto)
-{
-       (void)filename;
-       (void)linenumber;
-       (void)segto;
-}
-void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
-                         int is_global, char *special)
-{
-       (void)name;
-       (void)segment;
-       (void)offset;
-       (void)is_global;
-       (void)special;
-}
-void null_debug_routine(const char *directive, const char *params)
-{
-       (void)directive;
-       (void)params;
-}
-void null_debug_typevalue(int32_t type)
-{
-       (void)type;
-}
-void null_debug_output(int type, void *param)
-{
-       (void)type;
-       (void)param;
-}
-void null_debug_cleanup(void)
-{
-}
-
-struct dfmt null_debug_form = {
-    "Null debug format",
-    "null",
-    null_debug_init,
-    null_debug_linenum,
-    null_debug_deflabel,
-    null_debug_routine,
-    null_debug_typevalue,
-    null_debug_output,
-    null_debug_cleanup
-};
-
-struct dfmt *null_debug_arr[2] = { &null_debug_form, NULL };
diff --git a/outform.c b/outform.c
deleted file mode 100644 (file)
index 2aa5513..0000000
--- a/outform.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* outform.c   manages a list of output formats, and associates
- *             them with their relevant drivers. Also has a
- *             routine to find the correct driver given a name
- *             for it
- *
- * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
- * Julian Hall. All rights reserved. The software is
- * redistributable under the license given in the file "LICENSE"
- * distributed in the NASM archive.
- */
-
-#include "compiler.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-
-#define BUILD_DRIVERS_ARRAY
-#include "outform.h"
-
-static int ndrivers = 0;
-
-struct ofmt *ofmt_find(char *name)
-{                               /* find driver */
-    int i;
-
-    for (i = 0; i < ndrivers; i++)
-        if (!strcmp(name, drivers[i]->shortname))
-            return drivers[i];
-
-    return NULL;
-}
-struct dfmt *dfmt_find(struct ofmt *ofmt, char *name)
-{                               /* find driver */
-    struct dfmt **dfmt = ofmt->debug_formats;
-    while (*dfmt) {
-        if (!strcmp(name, (*dfmt)->shortname))
-            return (*dfmt);
-        dfmt++;
-    }
-    return NULL;
-}
-
-void ofmt_list(struct ofmt *deffmt, FILE * fp)
-{
-    int i;
-    for (i = 0; i < ndrivers; i++)
-        fprintf(fp, "  %c %-10s%s\n",
-                drivers[i] == deffmt ? '*' : ' ',
-                drivers[i]->shortname, drivers[i]->fullname);
-}
-void dfmt_list(struct ofmt *ofmt, FILE * fp)
-{
-    struct dfmt **drivers = ofmt->debug_formats;
-    while (*drivers) {
-        fprintf(fp, "  %c %-10s%s\n",
-                drivers[0] == ofmt->current_dfmt ? '*' : ' ',
-                drivers[0]->shortname, drivers[0]->fullname);
-        drivers++;
-    }
-}
-struct ofmt *ofmt_register(efunc error)
-{
-    for (ndrivers = 0; drivers[ndrivers] != NULL; ndrivers++) ;
-
-    if (ndrivers == 0) {
-        error(ERR_PANIC | ERR_NOFILE,
-              "No output drivers given at compile time");
-    }
-
-    return (&OF_DEFAULT);
-}
diff --git a/outform.h b/outform.h
deleted file mode 100644 (file)
index d2449a5..0000000
--- a/outform.h
+++ /dev/null
@@ -1,295 +0,0 @@
-/* outform.h   header file for binding output format drivers to the
- *              remainder of the code in the Netwide Assembler
- *
- * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
- * Julian Hall. All rights reserved. The software is
- * redistributable under the license given in the file "LICENSE"
- * distributed in the NASM archive.
- */
-
-/*
- * This header file allows configuration of which output formats
- * get compiled into the NASM binary. You can configure by defining
- * various preprocessor symbols beginning with "OF_", either on the
- * compiler command line or at the top of this file.
- *
- * OF_ONLY                -- only include specified object formats
- * OF_name                -- ensure that output format 'name' is included
- * OF_NO_name             -- remove output format 'name'
- * OF_DOS                 -- ensure that 'obj', 'bin' & 'win32' are included.
- * OF_UNIX                -- ensure that 'aout', 'aoutb', 'coff', 'elf32' 'elf64' are in.
- * OF_OTHERS              -- ensure that 'bin', 'as86' & 'rdf' are in.
- * OF_ALL                 -- ensure that all formats are included.
- *                           note that this doesn't include 'dbg', which is
- *                           only really useful if you're doing development
- *                           work on NASM. Define OF_DBG if you want this.
- *
- * OF_DEFAULT=of_name     -- ensure that 'name' is the default format.
- *
- * eg: -DOF_UNIX -DOF_ELF32 -DOF_DEFAULT=of_elf32 would be a suitable config
- * for an average linux system.
- *
- * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
- *
- * You probably only want to set these options while compiling 'nasm.c'. */
-
-#ifndef NASM_OUTFORM_H
-#define NASM_OUTFORM_H
-
-#include "nasm.h"
-
-/* -------------- USER MODIFIABLE PART ---------------- */
-
-/*
- * Insert #defines here in accordance with the configuration
- * instructions above.
- *
- * E.g.
- *
- * #define OF_ONLY
- * #define OF_OBJ
- * #define OF_BIN
- *
- * for a 16-bit DOS assembler with no extraneous formats.
- */
-
-/* ------------ END USER MODIFIABLE PART -------------- */
-
-/* ====configurable info begins here==== */
-/* formats configurable:
- * bin,obj,elf32,elf64,aout,aoutb,coff,win32,as86,rdf2,macho */
-
-/* process options... */
-
-#ifndef OF_ONLY
-#ifndef OF_ALL
-#define OF_ALL                  /* default is to have all formats */
-#endif
-#endif
-
-#ifdef OF_ALL                   /* set all formats on... */
-#ifndef OF_BIN
-#define OF_BIN
-#endif
-#ifndef OF_OBJ
-#define OF_OBJ
-#endif
-#ifndef OF_ELF32
-#define OF_ELF32
-#endif
-#ifndef OF_ELF64
-#define OF_ELF64
-#endif
-#ifndef OF_COFF
-#define OF_COFF
-#endif
-#ifndef OF_AOUT
-#define OF_AOUT
-#endif
-#ifndef OF_AOUTB
-#define OF_AOUTB
-#endif
-#ifndef OF_WIN32
-#define OF_WIN32
-#endif
-#ifndef OF_WIN64
-#define OF_WIN64
-#endif
-#ifndef OF_AS86
-#define OF_AS86
-#endif
-#ifndef OF_RDF2
-#define OF_RDF2
-#endif
-#ifndef OF_IEEE
-#define OF_IEEE
-#endif
-#ifndef OF_MACHO
-#define OF_MACHO
-#endif
-#ifndef OF_DBG
-#define OF_DBG
-#endif
-#endif                          /* OF_ALL */
-
-/* turn on groups of formats specified.... */
-#ifdef OF_DOS
-#ifndef OF_OBJ
-#define OF_OBJ
-#endif
-#ifndef OF_BIN
-#define OF_BIN
-#endif
-#ifndef OF_COFF
-#define OF_COFF                        /* COFF is used by DJGPP */
-#endif
-#ifndef OF_WIN32
-#define OF_WIN32
-#endif
-#ifndef OF_WIN64
-#define OF_WIN64
-#endif
-#endif
-
-#ifdef OF_UNIX
-#ifndef OF_AOUT
-#define OF_AOUT
-#endif
-#ifndef OF_AOUTB
-#define OF_AOUTB
-#endif
-#ifndef OF_COFF
-#define OF_COFF
-#endif
-#ifndef OF_ELF32
-#define OF_ELF32
-#endif
-#ifndef OF_ELF64
-#define OF_ELF64
-#endif
-#endif
-
-#ifdef OF_OTHERS
-#ifndef OF_BIN
-#define OF_BIN
-#endif
-#ifndef OF_AS86
-#define OF_AS86
-#endif
-#ifndef OF_RDF2
-#define OF_RDF2
-#endif
-#ifndef OF_IEEE
-#define OF_IEEE
-#endif
-#ifndef OF_MACHO
-#define OF_MACHO
-#endif
-#endif
-
-/* finally... override any format specifically specified to be off */
-#ifdef OF_NO_BIN
-#undef OF_BIN
-#endif
-#ifdef OF_NO_OBJ
-#undef OF_OBJ
-#endif
-#ifdef OF_NO_ELF32
-#undef OF_ELF32
-#endif
-#ifdef OF_NO_ELF64
-#undef OF_ELF64
-#endif
-#ifdef OF_NO_AOUT
-#undef OF_AOUT
-#endif
-#ifdef OF_NO_AOUTB
-#undef OF_AOUTB
-#endif
-#ifdef OF_NO_COFF
-#undef OF_COFF
-#endif
-#ifdef OF_NO_WIN32
-#undef OF_WIN32
-#endif
-#ifdef OF_NO_WIN64
-#undef OF_WIN64
-#endif
-#ifdef OF_NO_AS86
-#undef OF_AS86
-#endif
-#ifdef OF_NO_RDF2
-#undef OF_RDF
-#endif
-#ifdef OF_NO_IEEE
-#undef OF_IEEE
-#endif
-#ifdef OF_NO_MACHO
-#undef OF_MACHO
-#endif
-#ifdef OF_NO_DBG
-#undef OF_DBG
-#endif
-
-#ifndef OF_DEFAULT
-#define OF_DEFAULT of_bin
-#endif
-
-#ifdef BUILD_DRIVERS_ARRAY      /* only if included from outform.c */
-
-/* pull in the externs for the different formats, then make the *drivers
- * array based on the above defines */
-
-extern struct ofmt of_bin;
-extern struct ofmt of_aout;
-extern struct ofmt of_aoutb;
-extern struct ofmt of_coff;
-extern struct ofmt of_elf32;
-extern struct ofmt of_elf;
-extern struct ofmt of_elf64;
-extern struct ofmt of_as86;
-extern struct ofmt of_obj;
-extern struct ofmt of_win32;
-extern struct ofmt of_win64;
-extern struct ofmt of_rdf2;
-extern struct ofmt of_ieee;
-extern struct ofmt of_macho;
-extern struct ofmt of_dbg;
-
-struct ofmt *drivers[] = {
-#ifdef OF_BIN
-    &of_bin,
-#endif
-#ifdef OF_AOUT
-    &of_aout,
-#endif
-#ifdef OF_AOUTB
-    &of_aoutb,
-#endif
-#ifdef OF_COFF
-    &of_coff,
-#endif
-#ifdef OF_ELF32
-    &of_elf32,
-    &of_elf,
-#endif
-#ifdef OF_ELF64
-    &of_elf64,
-#endif
-#ifdef OF_AS86
-    &of_as86,
-#endif
-#ifdef OF_OBJ
-    &of_obj,
-#endif
-#ifdef OF_WIN32
-    &of_win32,
-#endif
-#ifdef OF_WIN64
-    &of_win64,
-#endif
-#ifdef OF_RDF2
-    &of_rdf2,
-#endif
-#ifdef OF_IEEE
-    &of_ieee,
-#endif
-#ifdef OF_MACHO
-    &of_macho,
-#endif
-#ifdef OF_DBG
-    &of_dbg,
-#endif
-
-    NULL
-};
-
-#endif                          /* BUILD_DRIVERS_ARRAY */
-
-struct ofmt *ofmt_find(char *);
-struct dfmt *dfmt_find(struct ofmt *, char *);
-void ofmt_list(struct ofmt *, FILE *);
-void dfmt_list(struct ofmt *ofmt, FILE * fp);
-struct ofmt *ofmt_register(efunc error);
-
-#endif                          /* NASM_OUTFORM_H */
diff --git a/outlib.c b/outlib.c
deleted file mode 100644 (file)
index cf68721..0000000
--- a/outlib.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * libout.c
- *
- * Common routines for the output backends.
- */
-
-#include "compiler.h"
-#include "nasm.h"
-#include "outlib.h"
-
-uint64_t realsize(enum out_type type, uint64_t size)
-{
-    switch (type) {
-    case OUT_REL2ADR:
-       return 2;
-    case OUT_REL4ADR:
-       return 4;
-    case OUT_REL8ADR:
-       return 8;
-    default:
-       return size;
-    }
-}
diff --git a/outlib.h b/outlib.h
deleted file mode 100644 (file)
index 5057e80..0000000
--- a/outlib.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef NASM_OUTLIB_H
-#define NASM_OUTLIB_H
-
-#include "nasm.h"
-
-uint64_t realsize(enum out_type type, uint64_t size);
-
-#endif /* NASM_OUTLIB_H */
-
diff --git a/output/nulldbg.c b/output/nulldbg.c
new file mode 100644 (file)
index 0000000..e1b13e8
--- /dev/null
@@ -0,0 +1,56 @@
+#include "nasm.h"
+#include "nasmlib.h"
+
+void null_debug_init(struct ofmt *of, void *id, FILE * fp, efunc error)
+{
+       (void)of;
+       (void)id;
+       (void)fp;
+       (void)error;
+}
+void null_debug_linenum(const char *filename, int32_t linenumber, int32_t segto)
+{
+       (void)filename;
+       (void)linenumber;
+       (void)segto;
+}
+void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special)
+{
+       (void)name;
+       (void)segment;
+       (void)offset;
+       (void)is_global;
+       (void)special;
+}
+void null_debug_routine(const char *directive, const char *params)
+{
+       (void)directive;
+       (void)params;
+}
+void null_debug_typevalue(int32_t type)
+{
+       (void)type;
+}
+void null_debug_output(int type, void *param)
+{
+       (void)type;
+       (void)param;
+}
+void null_debug_cleanup(void)
+{
+}
+
+struct dfmt null_debug_form = {
+    "Null debug format",
+    "null",
+    null_debug_init,
+    null_debug_linenum,
+    null_debug_deflabel,
+    null_debug_routine,
+    null_debug_typevalue,
+    null_debug_output,
+    null_debug_cleanup
+};
+
+struct dfmt *null_debug_arr[2] = { &null_debug_form, NULL };
index 467b20e3a8920af22569e712c2811fc6d28bef83..3c48eed14d034d73790adfbadcc117abb08cb578 100644 (file)
@@ -20,8 +20,8 @@
 #include "saa.h"
 #include "raa.h"
 #include "stdscan.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 
 #if defined OF_AOUT || defined OF_AOUTB
 
index 914dcea496c3fd1253bc8015876b6dc3f658e391..9a09b841cf4a749596b1029c888eb83903528acc 100644 (file)
@@ -19,8 +19,8 @@
 #include "nasmlib.h"
 #include "saa.h"
 #include "raa.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 
 #ifdef OF_AS86
 
index fa4c9a3199d57e0ac12230226f2426d7c1d86a3c..fdd1788f92bf83f44940399ce3aee7bf66d18c11 100644 (file)
@@ -58,8 +58,8 @@
 #include "stdscan.h"
 #include "labels.h"
 #include "eval.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 
 #ifdef OF_BIN
 
index 1540c605d5f3bac0d438c20481537812ba079542..b8a9c7d4cd43810a5164abb6d91f7d3e198093de 100644 (file)
@@ -20,8 +20,8 @@
 #include "nasmlib.h"
 #include "saa.h"
 #include "raa.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 
 #if defined(OF_COFF) || defined(OF_WIN32) || defined(OF_WIN64)
 
index 102e422a31c567770674f9b7fb425283e9010ec4..e00b084077cf8a58ddb31f2fe82af10c1b00f8b3 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "nasm.h"
 #include "nasmlib.h"
-#include "outform.h"
+#include "output/outform.h"
 
 #ifdef OF_DBG
 
index 69915156db885b50ba3de49ab26696681c5ced99..afd67872dec5762175267dcfbc9af922249f4b87 100644 (file)
@@ -9,7 +9,7 @@
 #include <inttypes.h>
 
 #include "nasm.h"
-#include "outform.h"
+#include "output/outform.h"
 
 #include "output/elfcommon.h"
 #include "output/dwarf.h"
index 1e2d76f1d84a555aa9052d95f219b70bf43ff77c..1a327cf837a8bd6dce9e381a50b08f2b0c1a43c9 100644 (file)
@@ -20,8 +20,8 @@
 #include "saa.h"
 #include "raa.h"
 #include "stdscan.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 #include "rbtree.h"
 
 #include "output/elf32.h"
index 7068764fdd2b493c9ca8a5c9ba24ab43f841e34a..59df79241b3e34d54227c97a2e5ae88efdd3049f 100644 (file)
@@ -19,8 +19,8 @@
 #include "saa.h"
 #include "raa.h"
 #include "stdscan.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 #include "rbtree.h"
 
 #include "output/elf64.h"
diff --git a/output/outform.c b/output/outform.c
new file mode 100644 (file)
index 0000000..2546c1b
--- /dev/null
@@ -0,0 +1,72 @@
+/* outform.c   manages a list of output formats, and associates
+ *             them with their relevant drivers. Also has a
+ *             routine to find the correct driver given a name
+ *             for it
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the license given in the file "LICENSE"
+ * distributed in the NASM archive.
+ */
+
+#include "compiler.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+
+#define BUILD_DRIVERS_ARRAY
+#include "output/outform.h"
+
+static int ndrivers = 0;
+
+struct ofmt *ofmt_find(char *name)
+{                               /* find driver */
+    int i;
+
+    for (i = 0; i < ndrivers; i++)
+        if (!strcmp(name, drivers[i]->shortname))
+            return drivers[i];
+
+    return NULL;
+}
+struct dfmt *dfmt_find(struct ofmt *ofmt, char *name)
+{                               /* find driver */
+    struct dfmt **dfmt = ofmt->debug_formats;
+    while (*dfmt) {
+        if (!strcmp(name, (*dfmt)->shortname))
+            return (*dfmt);
+        dfmt++;
+    }
+    return NULL;
+}
+
+void ofmt_list(struct ofmt *deffmt, FILE * fp)
+{
+    int i;
+    for (i = 0; i < ndrivers; i++)
+        fprintf(fp, "  %c %-10s%s\n",
+                drivers[i] == deffmt ? '*' : ' ',
+                drivers[i]->shortname, drivers[i]->fullname);
+}
+void dfmt_list(struct ofmt *ofmt, FILE * fp)
+{
+    struct dfmt **drivers = ofmt->debug_formats;
+    while (*drivers) {
+        fprintf(fp, "  %c %-10s%s\n",
+                drivers[0] == ofmt->current_dfmt ? '*' : ' ',
+                drivers[0]->shortname, drivers[0]->fullname);
+        drivers++;
+    }
+}
+struct ofmt *ofmt_register(efunc error)
+{
+    for (ndrivers = 0; drivers[ndrivers] != NULL; ndrivers++) ;
+
+    if (ndrivers == 0) {
+        error(ERR_PANIC | ERR_NOFILE,
+              "No output drivers given at compile time");
+    }
+
+    return (&OF_DEFAULT);
+}
diff --git a/output/outform.h b/output/outform.h
new file mode 100644 (file)
index 0000000..5c12092
--- /dev/null
@@ -0,0 +1,295 @@
+/* output/outform.h    header file for binding output format drivers to the
+ *              remainder of the code in the Netwide Assembler
+ *
+ * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+ * Julian Hall. All rights reserved. The software is
+ * redistributable under the license given in the file "LICENSE"
+ * distributed in the NASM archive.
+ */
+
+/*
+ * This header file allows configuration of which output formats
+ * get compiled into the NASM binary. You can configure by defining
+ * various preprocessor symbols beginning with "OF_", either on the
+ * compiler command line or at the top of this file.
+ *
+ * OF_ONLY                -- only include specified object formats
+ * OF_name                -- ensure that output format 'name' is included
+ * OF_NO_name             -- remove output format 'name'
+ * OF_DOS                 -- ensure that 'obj', 'bin' & 'win32' are included.
+ * OF_UNIX                -- ensure that 'aout', 'aoutb', 'coff', 'elf32' 'elf64' are in.
+ * OF_OTHERS              -- ensure that 'bin', 'as86' & 'rdf' are in.
+ * OF_ALL                 -- ensure that all formats are included.
+ *                           note that this doesn't include 'dbg', which is
+ *                           only really useful if you're doing development
+ *                           work on NASM. Define OF_DBG if you want this.
+ *
+ * OF_DEFAULT=of_name     -- ensure that 'name' is the default format.
+ *
+ * eg: -DOF_UNIX -DOF_ELF32 -DOF_DEFAULT=of_elf32 would be a suitable config
+ * for an average linux system.
+ *
+ * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
+ *
+ * You probably only want to set these options while compiling 'nasm.c'. */
+
+#ifndef NASM_OUTFORM_H
+#define NASM_OUTFORM_H
+
+#include "nasm.h"
+
+/* -------------- USER MODIFIABLE PART ---------------- */
+
+/*
+ * Insert #defines here in accordance with the configuration
+ * instructions above.
+ *
+ * E.g.
+ *
+ * #define OF_ONLY
+ * #define OF_OBJ
+ * #define OF_BIN
+ *
+ * for a 16-bit DOS assembler with no extraneous formats.
+ */
+
+/* ------------ END USER MODIFIABLE PART -------------- */
+
+/* ====configurable info begins here==== */
+/* formats configurable:
+ * bin,obj,elf32,elf64,aout,aoutb,coff,win32,as86,rdf2,macho */
+
+/* process options... */
+
+#ifndef OF_ONLY
+#ifndef OF_ALL
+#define OF_ALL                  /* default is to have all formats */
+#endif
+#endif
+
+#ifdef OF_ALL                   /* set all formats on... */
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_OBJ
+#define OF_OBJ
+#endif
+#ifndef OF_ELF32
+#define OF_ELF32
+#endif
+#ifndef OF_ELF64
+#define OF_ELF64
+#endif
+#ifndef OF_COFF
+#define OF_COFF
+#endif
+#ifndef OF_AOUT
+#define OF_AOUT
+#endif
+#ifndef OF_AOUTB
+#define OF_AOUTB
+#endif
+#ifndef OF_WIN32
+#define OF_WIN32
+#endif
+#ifndef OF_WIN64
+#define OF_WIN64
+#endif
+#ifndef OF_AS86
+#define OF_AS86
+#endif
+#ifndef OF_RDF2
+#define OF_RDF2
+#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
+#ifndef OF_MACHO
+#define OF_MACHO
+#endif
+#ifndef OF_DBG
+#define OF_DBG
+#endif
+#endif                          /* OF_ALL */
+
+/* turn on groups of formats specified.... */
+#ifdef OF_DOS
+#ifndef OF_OBJ
+#define OF_OBJ
+#endif
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_COFF
+#define OF_COFF                        /* COFF is used by DJGPP */
+#endif
+#ifndef OF_WIN32
+#define OF_WIN32
+#endif
+#ifndef OF_WIN64
+#define OF_WIN64
+#endif
+#endif
+
+#ifdef OF_UNIX
+#ifndef OF_AOUT
+#define OF_AOUT
+#endif
+#ifndef OF_AOUTB
+#define OF_AOUTB
+#endif
+#ifndef OF_COFF
+#define OF_COFF
+#endif
+#ifndef OF_ELF32
+#define OF_ELF32
+#endif
+#ifndef OF_ELF64
+#define OF_ELF64
+#endif
+#endif
+
+#ifdef OF_OTHERS
+#ifndef OF_BIN
+#define OF_BIN
+#endif
+#ifndef OF_AS86
+#define OF_AS86
+#endif
+#ifndef OF_RDF2
+#define OF_RDF2
+#endif
+#ifndef OF_IEEE
+#define OF_IEEE
+#endif
+#ifndef OF_MACHO
+#define OF_MACHO
+#endif
+#endif
+
+/* finally... override any format specifically specified to be off */
+#ifdef OF_NO_BIN
+#undef OF_BIN
+#endif
+#ifdef OF_NO_OBJ
+#undef OF_OBJ
+#endif
+#ifdef OF_NO_ELF32
+#undef OF_ELF32
+#endif
+#ifdef OF_NO_ELF64
+#undef OF_ELF64
+#endif
+#ifdef OF_NO_AOUT
+#undef OF_AOUT
+#endif
+#ifdef OF_NO_AOUTB
+#undef OF_AOUTB
+#endif
+#ifdef OF_NO_COFF
+#undef OF_COFF
+#endif
+#ifdef OF_NO_WIN32
+#undef OF_WIN32
+#endif
+#ifdef OF_NO_WIN64
+#undef OF_WIN64
+#endif
+#ifdef OF_NO_AS86
+#undef OF_AS86
+#endif
+#ifdef OF_NO_RDF2
+#undef OF_RDF
+#endif
+#ifdef OF_NO_IEEE
+#undef OF_IEEE
+#endif
+#ifdef OF_NO_MACHO
+#undef OF_MACHO
+#endif
+#ifdef OF_NO_DBG
+#undef OF_DBG
+#endif
+
+#ifndef OF_DEFAULT
+#define OF_DEFAULT of_bin
+#endif
+
+#ifdef BUILD_DRIVERS_ARRAY      /* only if included from outform.c */
+
+/* pull in the externs for the different formats, then make the *drivers
+ * array based on the above defines */
+
+extern struct ofmt of_bin;
+extern struct ofmt of_aout;
+extern struct ofmt of_aoutb;
+extern struct ofmt of_coff;
+extern struct ofmt of_elf32;
+extern struct ofmt of_elf;
+extern struct ofmt of_elf64;
+extern struct ofmt of_as86;
+extern struct ofmt of_obj;
+extern struct ofmt of_win32;
+extern struct ofmt of_win64;
+extern struct ofmt of_rdf2;
+extern struct ofmt of_ieee;
+extern struct ofmt of_macho;
+extern struct ofmt of_dbg;
+
+struct ofmt *drivers[] = {
+#ifdef OF_BIN
+    &of_bin,
+#endif
+#ifdef OF_AOUT
+    &of_aout,
+#endif
+#ifdef OF_AOUTB
+    &of_aoutb,
+#endif
+#ifdef OF_COFF
+    &of_coff,
+#endif
+#ifdef OF_ELF32
+    &of_elf32,
+    &of_elf,
+#endif
+#ifdef OF_ELF64
+    &of_elf64,
+#endif
+#ifdef OF_AS86
+    &of_as86,
+#endif
+#ifdef OF_OBJ
+    &of_obj,
+#endif
+#ifdef OF_WIN32
+    &of_win32,
+#endif
+#ifdef OF_WIN64
+    &of_win64,
+#endif
+#ifdef OF_RDF2
+    &of_rdf2,
+#endif
+#ifdef OF_IEEE
+    &of_ieee,
+#endif
+#ifdef OF_MACHO
+    &of_macho,
+#endif
+#ifdef OF_DBG
+    &of_dbg,
+#endif
+
+    NULL
+};
+
+#endif                          /* BUILD_DRIVERS_ARRAY */
+
+struct ofmt *ofmt_find(char *);
+struct dfmt *dfmt_find(struct ofmt *, char *);
+void ofmt_list(struct ofmt *, FILE *);
+void dfmt_list(struct ofmt *ofmt, FILE * fp);
+struct ofmt *ofmt_register(efunc error);
+
+#endif                          /* NASM_OUTFORM_H */
index abf493c6b5f320e3623312b2293c484c9363b89a..cadcb2a109e71d4cf5a49709ecb4c3ab076a08b6 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "nasm.h"
 #include "nasmlib.h"
-#include "outform.h"
+#include "output/outform.h"
 
 #ifdef OF_IEEE
 
diff --git a/output/outlib.c b/output/outlib.c
new file mode 100644 (file)
index 0000000..e1b61b1
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * libout.c
+ *
+ * Common routines for the output backends.
+ */
+
+#include "compiler.h"
+#include "nasm.h"
+#include "output/outlib.h"
+
+uint64_t realsize(enum out_type type, uint64_t size)
+{
+    switch (type) {
+    case OUT_REL2ADR:
+       return 2;
+    case OUT_REL4ADR:
+       return 4;
+    case OUT_REL8ADR:
+       return 8;
+    default:
+       return size;
+    }
+}
diff --git a/output/outlib.h b/output/outlib.h
new file mode 100644 (file)
index 0000000..5057e80
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef NASM_OUTLIB_H
+#define NASM_OUTLIB_H
+
+#include "nasm.h"
+
+uint64_t realsize(enum out_type type, uint64_t size);
+
+#endif /* NASM_OUTLIB_H */
+
index 5387e990c76d4907f603ebe7ada92c87973f3f5e..d88ca809a4c975785cfd4386481a7c5e03ed21df 100644 (file)
@@ -22,8 +22,8 @@
 #include "nasmlib.h"
 #include "saa.h"
 #include "raa.h"
-#include "outform.h"
-#include "outlib.h"
+#include "output/outform.h"
+#include "output/outlib.h"
 
 #if defined(OF_MACHO)
 
index fe2de3e18a527f27d44f220ad4512df604e26e31..83870cf75be35437b059490e9f516dd8f1cc9349 100644 (file)
@@ -18,7 +18,7 @@
 #include "nasm.h"
 #include "nasmlib.h"
 #include "stdscan.h"
-#include "outform.h"
+#include "output/outform.h"
 
 #ifdef OF_OBJ
 
index 8c5b2396c21026bcd64e132f5c24c49541b9b94e..af78f9df39f9da7f12565e1fc2903c8c984ce1ec 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "nasm.h"
 #include "nasmlib.h"
-#include "outform.h"
+#include "output/outform.h"
 
 /* VERBOSE_WARNINGS: define this to add some extra warnings... */
 #define VERBOSE_WARNINGS
index b502715b7994bda02343207b59f9bb00aa6df48b..c5e2e06f4b4358976ce4b995c9dd29ae5988b828 100644 (file)
@@ -21,7 +21,7 @@
 #include "nasm.h"
 #include "nasmlib.h"
 #include "saa.h"
-#include "outform.h"
+#include "output/outform.h"
 
 /* VERBOSE_WARNINGS: define this to add some extra warnings... */
 #define VERBOSE_WARNINGS