laag-nasm 2.13.03.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +57 -0
- data/LICENSE.txt +29 -0
- data/README.org +34 -0
- data/ext/laag/nasm/extconf.rb +16 -0
- data/laag-nasm.gemspec +20 -0
- data/lib/laag/nasm.rb +29 -0
- data/patches/Makefile.in.patch +13 -0
- data/vendor/repo.or.cz/nasm/.gitignore +102 -0
- data/vendor/repo.or.cz/nasm/AUTHORS +137 -0
- data/vendor/repo.or.cz/nasm/CHANGES +2 -0
- data/vendor/repo.or.cz/nasm/ChangeLog +2905 -0
- data/vendor/repo.or.cz/nasm/INSTALL +102 -0
- data/vendor/repo.or.cz/nasm/LICENSE +29 -0
- data/vendor/repo.or.cz/nasm/Makefile.in +855 -0
- data/vendor/repo.or.cz/nasm/Mkfiles/README +46 -0
- data/vendor/repo.or.cz/nasm/Mkfiles/msvc.mak +732 -0
- data/vendor/repo.or.cz/nasm/Mkfiles/openwcom.mak +706 -0
- data/vendor/repo.or.cz/nasm/README +23 -0
- data/vendor/repo.or.cz/nasm/SubmittingPatches +116 -0
- data/vendor/repo.or.cz/nasm/TODO +376 -0
- data/vendor/repo.or.cz/nasm/aclocal.m4 +139 -0
- data/vendor/repo.or.cz/nasm/asm/assemble.c +2957 -0
- data/vendor/repo.or.cz/nasm/asm/assemble.h +54 -0
- data/vendor/repo.or.cz/nasm/asm/directiv.c +566 -0
- data/vendor/repo.or.cz/nasm/asm/directiv.dat +92 -0
- data/vendor/repo.or.cz/nasm/asm/error.c +202 -0
- data/vendor/repo.or.cz/nasm/asm/eval.c +1014 -0
- data/vendor/repo.or.cz/nasm/asm/eval.h +49 -0
- data/vendor/repo.or.cz/nasm/asm/exprdump.c +79 -0
- data/vendor/repo.or.cz/nasm/asm/exprlib.c +200 -0
- data/vendor/repo.or.cz/nasm/asm/float.c +952 -0
- data/vendor/repo.or.cz/nasm/asm/float.h +54 -0
- data/vendor/repo.or.cz/nasm/asm/labels.c +540 -0
- data/vendor/repo.or.cz/nasm/asm/listing.c +346 -0
- data/vendor/repo.or.cz/nasm/asm/listing.h +113 -0
- data/vendor/repo.or.cz/nasm/asm/nasm.c +1855 -0
- data/vendor/repo.or.cz/nasm/asm/parser.c +1167 -0
- data/vendor/repo.or.cz/nasm/asm/parser.h +45 -0
- data/vendor/repo.or.cz/nasm/asm/phash.pl +109 -0
- data/vendor/repo.or.cz/nasm/asm/pptok.dat +96 -0
- data/vendor/repo.or.cz/nasm/asm/pptok.pl +271 -0
- data/vendor/repo.or.cz/nasm/asm/pragma.c +218 -0
- data/vendor/repo.or.cz/nasm/asm/preproc-nop.c +188 -0
- data/vendor/repo.or.cz/nasm/asm/preproc.c +5459 -0
- data/vendor/repo.or.cz/nasm/asm/preproc.h +55 -0
- data/vendor/repo.or.cz/nasm/asm/quote.c +479 -0
- data/vendor/repo.or.cz/nasm/asm/quote.h +44 -0
- data/vendor/repo.or.cz/nasm/asm/rdstrnum.c +68 -0
- data/vendor/repo.or.cz/nasm/asm/segalloc.c +51 -0
- data/vendor/repo.or.cz/nasm/asm/stdscan.c +345 -0
- data/vendor/repo.or.cz/nasm/asm/stdscan.h +49 -0
- data/vendor/repo.or.cz/nasm/asm/strfunc.c +359 -0
- data/vendor/repo.or.cz/nasm/asm/tokens.dat +135 -0
- data/vendor/repo.or.cz/nasm/asm/tokhash.pl +284 -0
- data/vendor/repo.or.cz/nasm/autogen.sh +9 -0
- data/vendor/repo.or.cz/nasm/common/common.c +122 -0
- data/vendor/repo.or.cz/nasm/config/msvc.h +192 -0
- data/vendor/repo.or.cz/nasm/config/unknown.h +51 -0
- data/vendor/repo.or.cz/nasm/config/watcom.h +74 -0
- data/vendor/repo.or.cz/nasm/configure.ac +253 -0
- data/vendor/repo.or.cz/nasm/contrib/MSVC6.txt +25 -0
- data/vendor/repo.or.cz/nasm/contrib/VSrules/nasm.README +16 -0
- data/vendor/repo.or.cz/nasm/contrib/VSrules/nasm.rules +79 -0
- data/vendor/repo.or.cz/nasm/disasm/disasm.c +1735 -0
- data/vendor/repo.or.cz/nasm/disasm/disasm.h +49 -0
- data/vendor/repo.or.cz/nasm/disasm/ndisasm.c +397 -0
- data/vendor/repo.or.cz/nasm/disasm/sync.c +132 -0
- data/vendor/repo.or.cz/nasm/disasm/sync.h +45 -0
- data/vendor/repo.or.cz/nasm/doc/Makefile.in +86 -0
- data/vendor/repo.or.cz/nasm/doc/README +20 -0
- data/vendor/repo.or.cz/nasm/doc/afmmetrics.ph +102 -0
- data/vendor/repo.or.cz/nasm/doc/changes.src +2588 -0
- data/vendor/repo.or.cz/nasm/doc/findfont.ph +180 -0
- data/vendor/repo.or.cz/nasm/doc/genps.pl +1294 -0
- data/vendor/repo.or.cz/nasm/doc/inslist.pl +108 -0
- data/vendor/repo.or.cz/nasm/doc/internal.doc +290 -0
- data/vendor/repo.or.cz/nasm/doc/local.css +1 -0
- data/vendor/repo.or.cz/nasm/doc/nasmdoc.css +150 -0
- data/vendor/repo.or.cz/nasm/doc/nasmdoc.src +8309 -0
- data/vendor/repo.or.cz/nasm/doc/nasmlogo.eps +212 -0
- data/vendor/repo.or.cz/nasm/doc/nasmlogw.png +0 -0
- data/vendor/repo.or.cz/nasm/doc/psfonts.ph +53 -0
- data/vendor/repo.or.cz/nasm/doc/pspdf.pl +98 -0
- data/vendor/repo.or.cz/nasm/doc/pswidth.ph +25 -0
- data/vendor/repo.or.cz/nasm/doc/rdsrc.pl +1111 -0
- data/vendor/repo.or.cz/nasm/doc/ttfmetrics.ph +63 -0
- data/vendor/repo.or.cz/nasm/headers/c +33 -0
- data/vendor/repo.or.cz/nasm/headers/doc +33 -0
- data/vendor/repo.or.cz/nasm/headers/mac +33 -0
- data/vendor/repo.or.cz/nasm/headers/perl +33 -0
- data/vendor/repo.or.cz/nasm/include/compiler.h +277 -0
- data/vendor/repo.or.cz/nasm/include/disp8.h +45 -0
- data/vendor/repo.or.cz/nasm/include/error.h +135 -0
- data/vendor/repo.or.cz/nasm/include/hashtbl.h +85 -0
- data/vendor/repo.or.cz/nasm/include/iflag.h +173 -0
- data/vendor/repo.or.cz/nasm/include/insns.h +76 -0
- data/vendor/repo.or.cz/nasm/include/labels.h +60 -0
- data/vendor/repo.or.cz/nasm/include/md5.h +21 -0
- data/vendor/repo.or.cz/nasm/include/nasm.h +1246 -0
- data/vendor/repo.or.cz/nasm/include/nasmint.h +219 -0
- data/vendor/repo.or.cz/nasm/include/nasmlib.h +524 -0
- data/vendor/repo.or.cz/nasm/include/opflags.h +271 -0
- data/vendor/repo.or.cz/nasm/include/perfhash.h +52 -0
- data/vendor/repo.or.cz/nasm/include/raa.h +46 -0
- data/vendor/repo.or.cz/nasm/include/rbtree.h +51 -0
- data/vendor/repo.or.cz/nasm/include/rdoff.h +169 -0
- data/vendor/repo.or.cz/nasm/include/saa.h +94 -0
- data/vendor/repo.or.cz/nasm/include/strlist.h +55 -0
- data/vendor/repo.or.cz/nasm/include/tables.h +70 -0
- data/vendor/repo.or.cz/nasm/include/ver.h +47 -0
- data/vendor/repo.or.cz/nasm/install-sh +250 -0
- data/vendor/repo.or.cz/nasm/macros/altreg.mac +107 -0
- data/vendor/repo.or.cz/nasm/macros/fp.mac +54 -0
- data/vendor/repo.or.cz/nasm/macros/ifunc.mac +48 -0
- data/vendor/repo.or.cz/nasm/macros/macros.pl +294 -0
- data/vendor/repo.or.cz/nasm/macros/smartalign.mac +189 -0
- data/vendor/repo.or.cz/nasm/macros/standard.mac +226 -0
- data/vendor/repo.or.cz/nasm/misc/Doxyfile +752 -0
- data/vendor/repo.or.cz/nasm/misc/Nindent +18 -0
- data/vendor/repo.or.cz/nasm/misc/README +2 -0
- data/vendor/repo.or.cz/nasm/misc/c16.mac +82 -0
- data/vendor/repo.or.cz/nasm/misc/c32.mac +52 -0
- data/vendor/repo.or.cz/nasm/misc/crcgen.c +44 -0
- data/vendor/repo.or.cz/nasm/misc/exebin.mac +57 -0
- data/vendor/repo.or.cz/nasm/misc/exebin2.mac +114 -0
- data/vendor/repo.or.cz/nasm/misc/fmtinsns.pl +40 -0
- data/vendor/repo.or.cz/nasm/misc/genfma.pl +63 -0
- data/vendor/repo.or.cz/nasm/misc/hints.txt +26 -0
- data/vendor/repo.or.cz/nasm/misc/magic +6 -0
- data/vendor/repo.or.cz/nasm/misc/myC32.mac +121 -0
- data/vendor/repo.or.cz/nasm/misc/nasm.sl +320 -0
- data/vendor/repo.or.cz/nasm/misc/nasmstab +296 -0
- data/vendor/repo.or.cz/nasm/misc/omfdump.c +517 -0
- data/vendor/repo.or.cz/nasm/misc/pmw.bat +9 -0
- data/vendor/repo.or.cz/nasm/misc/proc32.ash +441 -0
- data/vendor/repo.or.cz/nasm/misc/scitech.mac +1223 -0
- data/vendor/repo.or.cz/nasm/misc/xcrcgen.c +80 -0
- data/vendor/repo.or.cz/nasm/nasm.spec.in +83 -0
- data/vendor/repo.or.cz/nasm/nasm.spec.sed +3 -0
- data/vendor/repo.or.cz/nasm/nasm.txt +306 -0
- data/vendor/repo.or.cz/nasm/nasmlib/badenum.c +43 -0
- data/vendor/repo.or.cz/nasm/nasmlib/bsi.c +77 -0
- data/vendor/repo.or.cz/nasm/nasmlib/crc64.c +189 -0
- data/vendor/repo.or.cz/nasm/nasmlib/file.c +259 -0
- data/vendor/repo.or.cz/nasm/nasmlib/file.h +128 -0
- data/vendor/repo.or.cz/nasm/nasmlib/filename.c +69 -0
- data/vendor/repo.or.cz/nasm/nasmlib/hashtbl.c +232 -0
- data/vendor/repo.or.cz/nasm/nasmlib/ilog2.c +168 -0
- data/vendor/repo.or.cz/nasm/nasmlib/malloc.c +108 -0
- data/vendor/repo.or.cz/nasm/nasmlib/md5c.c +247 -0
- data/vendor/repo.or.cz/nasm/nasmlib/mmap.c +139 -0
- data/vendor/repo.or.cz/nasm/nasmlib/path.c +186 -0
- data/vendor/repo.or.cz/nasm/nasmlib/perfhash.c +55 -0
- data/vendor/repo.or.cz/nasm/nasmlib/perfhash.pl +362 -0
- data/vendor/repo.or.cz/nasm/nasmlib/raa.c +173 -0
- data/vendor/repo.or.cz/nasm/nasmlib/rbtree.c +119 -0
- data/vendor/repo.or.cz/nasm/nasmlib/readnum.c +172 -0
- data/vendor/repo.or.cz/nasm/nasmlib/realpath.c +135 -0
- data/vendor/repo.or.cz/nasm/nasmlib/saa.c +431 -0
- data/vendor/repo.or.cz/nasm/nasmlib/srcfile.c +128 -0
- data/vendor/repo.or.cz/nasm/nasmlib/string.c +242 -0
- data/vendor/repo.or.cz/nasm/nasmlib/strlist.c +100 -0
- data/vendor/repo.or.cz/nasm/nasmlib/ver.c +51 -0
- data/vendor/repo.or.cz/nasm/nasmlib/zerobuf.c +42 -0
- data/vendor/repo.or.cz/nasm/ndisasm.txt +94 -0
- data/vendor/repo.or.cz/nasm/nsis/NASMMultiUser.nsh +478 -0
- data/vendor/repo.or.cz/nasm/nsis/getpearch.pl +76 -0
- data/vendor/repo.or.cz/nasm/nsis/nasm-un.ico +0 -0
- data/vendor/repo.or.cz/nasm/nsis/nasm.ico +0 -0
- data/vendor/repo.or.cz/nasm/nsis/nasm.nsi +241 -0
- data/vendor/repo.or.cz/nasm/output/codeview.c +814 -0
- data/vendor/repo.or.cz/nasm/output/dwarf.h +566 -0
- data/vendor/repo.or.cz/nasm/output/elf.h +537 -0
- data/vendor/repo.or.cz/nasm/output/legacy.c +112 -0
- data/vendor/repo.or.cz/nasm/output/nulldbg.c +93 -0
- data/vendor/repo.or.cz/nasm/output/nullout.c +51 -0
- data/vendor/repo.or.cz/nasm/output/outaout.c +954 -0
- data/vendor/repo.or.cz/nasm/output/outaout.mac +37 -0
- data/vendor/repo.or.cz/nasm/output/outas86.c +650 -0
- data/vendor/repo.or.cz/nasm/output/outas86.mac +37 -0
- data/vendor/repo.or.cz/nasm/output/outbin.c +1713 -0
- data/vendor/repo.or.cz/nasm/output/outbin.mac +40 -0
- data/vendor/repo.or.cz/nasm/output/outcoff.c +1242 -0
- data/vendor/repo.or.cz/nasm/output/outcoff.mac +43 -0
- data/vendor/repo.or.cz/nasm/output/outdbg.c +425 -0
- data/vendor/repo.or.cz/nasm/output/outelf.c +3370 -0
- data/vendor/repo.or.cz/nasm/output/outelf.h +156 -0
- data/vendor/repo.or.cz/nasm/output/outelf.mac +41 -0
- data/vendor/repo.or.cz/nasm/output/outform.c +120 -0
- data/vendor/repo.or.cz/nasm/output/outform.h +379 -0
- data/vendor/repo.or.cz/nasm/output/outieee.c +1528 -0
- data/vendor/repo.or.cz/nasm/output/outlib.c +58 -0
- data/vendor/repo.or.cz/nasm/output/outlib.h +63 -0
- data/vendor/repo.or.cz/nasm/output/outmacho.c +2387 -0
- data/vendor/repo.or.cz/nasm/output/outmacho.mac +49 -0
- data/vendor/repo.or.cz/nasm/output/outobj.c +2725 -0
- data/vendor/repo.or.cz/nasm/output/outobj.mac +49 -0
- data/vendor/repo.or.cz/nasm/output/outrdf.mac +40 -0
- data/vendor/repo.or.cz/nasm/output/outrdf2.c +791 -0
- data/vendor/repo.or.cz/nasm/output/outrdf2.mac +43 -0
- data/vendor/repo.or.cz/nasm/output/pecoff.h +532 -0
- data/vendor/repo.or.cz/nasm/output/stabs.h +144 -0
- data/vendor/repo.or.cz/nasm/perllib/crc64.ph +158 -0
- data/vendor/repo.or.cz/nasm/perllib/gensv.pl +34 -0
- data/vendor/repo.or.cz/nasm/perllib/phash.ph +200 -0
- data/vendor/repo.or.cz/nasm/perllib/random_sv_vectors.ph +67 -0
- data/vendor/repo.or.cz/nasm/rdoff/README +185 -0
- data/vendor/repo.or.cz/nasm/rdoff/collectn.c +44 -0
- data/vendor/repo.or.cz/nasm/rdoff/collectn.h +22 -0
- data/vendor/repo.or.cz/nasm/rdoff/doc/Makefile +37 -0
- data/vendor/repo.or.cz/nasm/rdoff/doc/rdoff.texi +137 -0
- data/vendor/repo.or.cz/nasm/rdoff/doc/v1-v2.txt +62 -0
- data/vendor/repo.or.cz/nasm/rdoff/hash.c +122 -0
- data/vendor/repo.or.cz/nasm/rdoff/hash.h +17 -0
- data/vendor/repo.or.cz/nasm/rdoff/ldrdf.1 +41 -0
- data/vendor/repo.or.cz/nasm/rdoff/ldrdf.c +1395 -0
- data/vendor/repo.or.cz/nasm/rdoff/ldsegs.h +59 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2bin.1 +65 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2bin.c +431 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2com.1 +1 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2ihx.1 +1 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2ith.1 +1 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdf2srec.1 +1 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdfdump.1 +24 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdfdump.c +347 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdflib.1 +39 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdflib.c +434 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdfload.c +213 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdfload.h +29 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdfutils.h +165 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdlar.c +492 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdlar.h +34 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdlib.c +290 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdlib.h +62 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdoff.c +621 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdx.1 +21 -0
- data/vendor/repo.or.cz/nasm/rdoff/rdx.c +90 -0
- data/vendor/repo.or.cz/nasm/rdoff/segtab.c +172 -0
- data/vendor/repo.or.cz/nasm/rdoff/segtab.h +45 -0
- data/vendor/repo.or.cz/nasm/rdoff/symtab.c +159 -0
- data/vendor/repo.or.cz/nasm/rdoff/symtab.h +55 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/Makefile +10 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/makelib.sh +14 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdfseg.asm +20 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdfseg2.asm +12 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdftest1.asm +54 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdftest2.asm +33 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdtlib.asm +48 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/rdtmain.asm +47 -0
- data/vendor/repo.or.cz/nasm/rdoff/test/testlib.asm +18 -0
- data/vendor/repo.or.cz/nasm/stdlib/snprintf.c +29 -0
- data/vendor/repo.or.cz/nasm/stdlib/strlcpy.c +51 -0
- data/vendor/repo.or.cz/nasm/stdlib/strnlen.c +46 -0
- data/vendor/repo.or.cz/nasm/stdlib/vsnprintf.c +51 -0
- data/vendor/repo.or.cz/nasm/test/Makefile +106 -0
- data/vendor/repo.or.cz/nasm/test/_file_.asm +5 -0
- data/vendor/repo.or.cz/nasm/test/_version.asm +2 -0
- data/vendor/repo.or.cz/nasm/test/a32offs.asm +9 -0
- data/vendor/repo.or.cz/nasm/test/absolute.asm +40 -0
- data/vendor/repo.or.cz/nasm/test/addr64x.asm +18 -0
- data/vendor/repo.or.cz/nasm/test/align13.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/align13s.asm +20 -0
- data/vendor/repo.or.cz/nasm/test/alonesym-obj.asm +166 -0
- data/vendor/repo.or.cz/nasm/test/andbyte.asm +15 -0
- data/vendor/repo.or.cz/nasm/test/aoutso.asm +99 -0
- data/vendor/repo.or.cz/nasm/test/aouttest.asm +86 -0
- data/vendor/repo.or.cz/nasm/test/aouttest.c +36 -0
- data/vendor/repo.or.cz/nasm/test/avx.asm +46 -0
- data/vendor/repo.or.cz/nasm/test/avx005.asm +529 -0
- data/vendor/repo.or.cz/nasm/test/avx2.asm +1608 -0
- data/vendor/repo.or.cz/nasm/test/avx512cd.asm +106 -0
- data/vendor/repo.or.cz/nasm/test/avx512er.asm +144 -0
- data/vendor/repo.or.cz/nasm/test/avx512f.asm +7000 -0
- data/vendor/repo.or.cz/nasm/test/avx512pf.asm +88 -0
- data/vendor/repo.or.cz/nasm/test/bcd.asm +23 -0
- data/vendor/repo.or.cz/nasm/test/binexe.asm +35 -0
- data/vendor/repo.or.cz/nasm/test/bintest.asm +59 -0
- data/vendor/repo.or.cz/nasm/test/bisect.sh +22 -0
- data/vendor/repo.or.cz/nasm/test/br1879590.asm +25 -0
- data/vendor/repo.or.cz/nasm/test/br2003451.asm +17 -0
- data/vendor/repo.or.cz/nasm/test/br2030823.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/br2148476.asm +221 -0
- data/vendor/repo.or.cz/nasm/test/br2222615.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/br2496848.asm +42 -0
- data/vendor/repo.or.cz/nasm/test/br3005117.asm +26 -0
- data/vendor/repo.or.cz/nasm/test/br3026808.asm +20 -0
- data/vendor/repo.or.cz/nasm/test/br3028880.asm +8 -0
- data/vendor/repo.or.cz/nasm/test/br3041451.asm +59 -0
- data/vendor/repo.or.cz/nasm/test/br3058845.asm +14 -0
- data/vendor/repo.or.cz/nasm/test/br3066383.asm +70 -0
- data/vendor/repo.or.cz/nasm/test/br3074517.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/br3092924.asm +25 -0
- data/vendor/repo.or.cz/nasm/test/br3104312.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/br3109604.asm +9 -0
- data/vendor/repo.or.cz/nasm/test/br3174983.asm +9 -0
- data/vendor/repo.or.cz/nasm/test/br3187743.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/br3189064.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/br3200749.asm +9 -0
- data/vendor/repo.or.cz/nasm/test/br3385573.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/br3392252.asm +43 -0
- data/vendor/repo.or.cz/nasm/test/br3392259.asm +8 -0
- data/vendor/repo.or.cz/nasm/test/br3392363.asm +4 -0
- data/vendor/repo.or.cz/nasm/test/br3392392.asm +16 -0
- data/vendor/repo.or.cz/nasm/test/br3392396.asm +5 -0
- data/vendor/repo.or.cz/nasm/test/br3392411.asm +22 -0
- data/vendor/repo.or.cz/nasm/test/br3392418.asm +3 -0
- data/vendor/repo.or.cz/nasm/test/br3392439.asm +25 -0
- data/vendor/repo.or.cz/nasm/test/br3392442.asm +6 -0
- data/vendor/repo.or.cz/nasm/test/br560575.asm +17 -0
- data/vendor/repo.or.cz/nasm/test/br560873.asm +27 -0
- data/vendor/repo.or.cz/nasm/test/br890790.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/br890790_i.asm +1 -0
- data/vendor/repo.or.cz/nasm/test/br978756.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/changed.asm +383 -0
- data/vendor/repo.or.cz/nasm/test/cofftest.asm +85 -0
- data/vendor/repo.or.cz/nasm/test/cofftest.c +35 -0
- data/vendor/repo.or.cz/nasm/test/crc32.asm +37 -0
- data/vendor/repo.or.cz/nasm/test/cv8struc.asm +14 -0
- data/vendor/repo.or.cz/nasm/test/dtbcd.asm +72 -0
- data/vendor/repo.or.cz/nasm/test/elf64so.asm +118 -0
- data/vendor/repo.or.cz/nasm/test/elfso.asm +100 -0
- data/vendor/repo.or.cz/nasm/test/elftest.asm +87 -0
- data/vendor/repo.or.cz/nasm/test/elftest.c +38 -0
- data/vendor/repo.or.cz/nasm/test/elftest64.c +43 -0
- data/vendor/repo.or.cz/nasm/test/elif.asm +39 -0
- data/vendor/repo.or.cz/nasm/test/expimp.asm +90 -0
- data/vendor/repo.or.cz/nasm/test/far64.asm +10 -0
- data/vendor/repo.or.cz/nasm/test/float.asm +186 -0
- data/vendor/repo.or.cz/nasm/test/float8.asm +135 -0
- data/vendor/repo.or.cz/nasm/test/floatb.asm +35 -0
- data/vendor/repo.or.cz/nasm/test/floatexp.asm +382 -0
- data/vendor/repo.or.cz/nasm/test/floatize.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/floattest.asm +28 -0
- data/vendor/repo.or.cz/nasm/test/floatx.asm +525 -0
- data/vendor/repo.or.cz/nasm/test/fpu.asm +127 -0
- data/vendor/repo.or.cz/nasm/test/fwdopt.asm +133 -0
- data/vendor/repo.or.cz/nasm/test/fwdoptpp.asm +150 -0
- data/vendor/repo.or.cz/nasm/test/gas2nasm.py +104 -0
- data/vendor/repo.or.cz/nasm/test/gather.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/gotoff64.asm +25 -0
- data/vendor/repo.or.cz/nasm/test/hexfp.asm +25 -0
- data/vendor/repo.or.cz/nasm/test/hle.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/ifelse.asm +46 -0
- data/vendor/repo.or.cz/nasm/test/ifenv.asm +31 -0
- data/vendor/repo.or.cz/nasm/test/ifmacro.asm +413 -0
- data/vendor/repo.or.cz/nasm/test/iftoken.asm +317 -0
- data/vendor/repo.or.cz/nasm/test/iftoken.pl +32 -0
- data/vendor/repo.or.cz/nasm/test/ilog2.asm +271 -0
- data/vendor/repo.or.cz/nasm/test/imacro.asm +8 -0
- data/vendor/repo.or.cz/nasm/test/imm.asm +23 -0
- data/vendor/repo.or.cz/nasm/test/imm64.asm +61 -0
- data/vendor/repo.or.cz/nasm/test/immwarn.asm +91 -0
- data/vendor/repo.or.cz/nasm/test/imul.asm +117 -0
- data/vendor/repo.or.cz/nasm/test/inc1.asm +6 -0
- data/vendor/repo.or.cz/nasm/test/inc2.asm +8 -0
- data/vendor/repo.or.cz/nasm/test/incbin.asm +7 -0
- data/vendor/repo.or.cz/nasm/test/incbin.data +2 -0
- data/vendor/repo.or.cz/nasm/test/inctest.asm +15 -0
- data/vendor/repo.or.cz/nasm/test/insnlbl.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/invlpga.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/jmp64.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/lar_lsl.asm +124 -0
- data/vendor/repo.or.cz/nasm/test/larlsl.asm +23 -0
- data/vendor/repo.or.cz/nasm/test/lnxhello.asm +54 -0
- data/vendor/repo.or.cz/nasm/test/local.asm +19 -0
- data/vendor/repo.or.cz/nasm/test/loopoffs.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/lwp.asm +213 -0
- data/vendor/repo.or.cz/nasm/test/macro-defaults.asm +64 -0
- data/vendor/repo.or.cz/nasm/test/macroerr.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/macroerr.inc +3 -0
- data/vendor/repo.or.cz/nasm/test/mmxsize.asm +38 -0
- data/vendor/repo.or.cz/nasm/test/movd.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/movd64.asm +15 -0
- data/vendor/repo.or.cz/nasm/test/movimm.asm +28 -0
- data/vendor/repo.or.cz/nasm/test/movnti.asm +10 -0
- data/vendor/repo.or.cz/nasm/test/mpx-64.asm +120 -0
- data/vendor/repo.or.cz/nasm/test/mpx.asm +89 -0
- data/vendor/repo.or.cz/nasm/test/multisection.asm +96 -0
- data/vendor/repo.or.cz/nasm/test/nasmformat.asm +17 -0
- data/vendor/repo.or.cz/nasm/test/new +9 -0
- data/vendor/repo.or.cz/nasm/test/newrdwr.asm +24 -0
- data/vendor/repo.or.cz/nasm/test/nop.asm +17 -0
- data/vendor/repo.or.cz/nasm/test/nullfile.asm +4 -0
- data/vendor/repo.or.cz/nasm/test/objexe.asm +30 -0
- data/vendor/repo.or.cz/nasm/test/objlink.c +33 -0
- data/vendor/repo.or.cz/nasm/test/objtest.asm +85 -0
- data/vendor/repo.or.cz/nasm/test/optimization.asm +104 -0
- data/vendor/repo.or.cz/nasm/test/org.asm +18 -0
- data/vendor/repo.or.cz/nasm/test/paste.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/pcrel.asm +52 -0
- data/vendor/repo.or.cz/nasm/test/perf/label.pl +18 -0
- data/vendor/repo.or.cz/nasm/test/perf/macro.pl +18 -0
- data/vendor/repo.or.cz/nasm/test/perf/token.pl +23 -0
- data/vendor/repo.or.cz/nasm/test/performtest.pl +192 -0
- data/vendor/repo.or.cz/nasm/test/pextrw.asm +3 -0
- data/vendor/repo.or.cz/nasm/test/pinsr16.asm +53 -0
- data/vendor/repo.or.cz/nasm/test/pinsr32.asm +53 -0
- data/vendor/repo.or.cz/nasm/test/pinsr64.asm +68 -0
- data/vendor/repo.or.cz/nasm/test/popcnt.asm +32 -0
- data/vendor/repo.or.cz/nasm/test/ppindirect.asm +42 -0
- data/vendor/repo.or.cz/nasm/test/pragma.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/prefix66.asm +28 -0
- data/vendor/repo.or.cz/nasm/test/ptr.asm +4 -0
- data/vendor/repo.or.cz/nasm/test/pushseg.asm +17 -0
- data/vendor/repo.or.cz/nasm/test/r13.asm +15 -0
- data/vendor/repo.or.cz/nasm/test/radix.asm +54 -0
- data/vendor/repo.or.cz/nasm/test/rdpid.asm +21 -0
- data/vendor/repo.or.cz/nasm/test/reldef.asm +57 -0
- data/vendor/repo.or.cz/nasm/test/relocs.asm +20 -0
- data/vendor/repo.or.cz/nasm/test/riprel.asm +5357 -0
- data/vendor/repo.or.cz/nasm/test/riprel.pl +29 -0
- data/vendor/repo.or.cz/nasm/test/riprel2.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/sha-64.asm +30 -0
- data/vendor/repo.or.cz/nasm/test/sha.asm +31 -0
- data/vendor/repo.or.cz/nasm/test/smartalign16.asm +36 -0
- data/vendor/repo.or.cz/nasm/test/smartalign32.asm +36 -0
- data/vendor/repo.or.cz/nasm/test/smartalign64.asm +36 -0
- data/vendor/repo.or.cz/nasm/test/splitea.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/sreg.asm +65 -0
- data/vendor/repo.or.cz/nasm/test/strlen.asm +5 -0
- data/vendor/repo.or.cz/nasm/test/struc.asm +33 -0
- data/vendor/repo.or.cz/nasm/test/test67.asm +38 -0
- data/vendor/repo.or.cz/nasm/test/testdos.asm +13 -0
- data/vendor/repo.or.cz/nasm/test/testnos3.asm +973 -0
- data/vendor/repo.or.cz/nasm/test/time.asm +11 -0
- data/vendor/repo.or.cz/nasm/test/times.asm +21 -0
- data/vendor/repo.or.cz/nasm/test/timesneg.asm +3 -0
- data/vendor/repo.or.cz/nasm/test/tmap.nas +1447 -0
- data/vendor/repo.or.cz/nasm/test/uscore.asm +15 -0
- data/vendor/repo.or.cz/nasm/test/utf.asm +82 -0
- data/vendor/repo.or.cz/nasm/test/vaesenc.asm +22 -0
- data/vendor/repo.or.cz/nasm/test/vex.asm +9 -0
- data/vendor/repo.or.cz/nasm/test/vgather.asm +76 -0
- data/vendor/repo.or.cz/nasm/test/vmread.asm +26 -0
- data/vendor/repo.or.cz/nasm/test/weirdpaste.asm +29 -0
- data/vendor/repo.or.cz/nasm/test/xchg.asm +96 -0
- data/vendor/repo.or.cz/nasm/test/xcrypt.asm +24 -0
- data/vendor/repo.or.cz/nasm/test/xmm0.asm +12 -0
- data/vendor/repo.or.cz/nasm/test/zerobyte.asm +22 -0
- data/vendor/repo.or.cz/nasm/tools/cleanfile +176 -0
- data/vendor/repo.or.cz/nasm/tools/cleanpatch +258 -0
- data/vendor/repo.or.cz/nasm/tools/mkdep.pl +261 -0
- data/vendor/repo.or.cz/nasm/tools/release +105 -0
- data/vendor/repo.or.cz/nasm/tools/syncfiles.pl +137 -0
- data/vendor/repo.or.cz/nasm/tools/tag-release +58 -0
- data/vendor/repo.or.cz/nasm/version +1 -0
- data/vendor/repo.or.cz/nasm/version.pl +189 -0
- data/vendor/repo.or.cz/nasm/x86/disp8.c +131 -0
- data/vendor/repo.or.cz/nasm/x86/insns-iflags.ph +280 -0
- data/vendor/repo.or.cz/nasm/x86/insns.dat +5371 -0
- data/vendor/repo.or.cz/nasm/x86/insns.pl +1043 -0
- data/vendor/repo.or.cz/nasm/x86/regs.dat +138 -0
- data/vendor/repo.or.cz/nasm/x86/regs.pl +204 -0
- metadata +520 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
;; --------------------------------------------------------------------------
|
2
|
+
;;
|
3
|
+
;; Copyright 1996-2009 The NASM Authors - All Rights Reserved
|
4
|
+
;; See the file AUTHORS included with the NASM distribution for
|
5
|
+
;; the specific copyright holders.
|
6
|
+
;;
|
7
|
+
;; Redistribution and use in source and binary forms, with or without
|
8
|
+
;; modification, are permitted provided that the following
|
9
|
+
;; conditions are met:
|
10
|
+
;;
|
11
|
+
;; * Redistributions of source code must retain the above copyright
|
12
|
+
;; notice, this list of conditions and the following disclaimer.
|
13
|
+
;; * Redistributions in binary form must reproduce the above
|
14
|
+
;; copyright notice, this list of conditions and the following
|
15
|
+
;; disclaimer in the documentation and/or other materials provided
|
16
|
+
;; with the distribution.
|
17
|
+
;;
|
18
|
+
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
19
|
+
;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
20
|
+
;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
21
|
+
;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
22
|
+
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
23
|
+
;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
25
|
+
;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
26
|
+
;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
27
|
+
;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
28
|
+
;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
29
|
+
;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
30
|
+
;; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
;;
|
32
|
+
;; --------------------------------------------------------------------------
|
33
|
+
|
34
|
+
OUT: bin
|
35
|
+
%define __SECT__ [section .text]
|
36
|
+
%imacro org 1+.nolist
|
37
|
+
[org %1]
|
38
|
+
%endmacro
|
39
|
+
%macro __NASM_CDecl__ 1
|
40
|
+
%endmacro
|
@@ -0,0 +1,1242 @@
|
|
1
|
+
/* ----------------------------------------------------------------------- *
|
2
|
+
*
|
3
|
+
* Copyright 1996-2014 The NASM Authors - All Rights Reserved
|
4
|
+
* See the file AUTHORS included with the NASM distribution for
|
5
|
+
* the specific copyright holders.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following
|
9
|
+
* conditions are met:
|
10
|
+
*
|
11
|
+
* * Redistributions of source code must retain the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
13
|
+
* * Redistributions in binary form must reproduce the above
|
14
|
+
* copyright notice, this list of conditions and the following
|
15
|
+
* disclaimer in the documentation and/or other materials provided
|
16
|
+
* with the distribution.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
19
|
+
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
20
|
+
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
21
|
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
22
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
23
|
+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
25
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
26
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
27
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
28
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
29
|
+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
30
|
+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
*
|
32
|
+
* ----------------------------------------------------------------------- */
|
33
|
+
|
34
|
+
/*
|
35
|
+
* outcoff.c output routines for the Netwide Assembler to produce
|
36
|
+
* COFF object files (for DJGPP and Win32)
|
37
|
+
*/
|
38
|
+
|
39
|
+
#include "compiler.h"
|
40
|
+
|
41
|
+
#include <stdio.h>
|
42
|
+
#include <stdlib.h>
|
43
|
+
#include <string.h>
|
44
|
+
#include <ctype.h>
|
45
|
+
#include <time.h>
|
46
|
+
|
47
|
+
#include "nasm.h"
|
48
|
+
#include "nasmlib.h"
|
49
|
+
#include "error.h"
|
50
|
+
#include "saa.h"
|
51
|
+
#include "raa.h"
|
52
|
+
#include "eval.h"
|
53
|
+
#include "outform.h"
|
54
|
+
#include "outlib.h"
|
55
|
+
#include "pecoff.h"
|
56
|
+
|
57
|
+
#if defined(OF_COFF) || defined(OF_WIN32) || defined(OF_WIN64)
|
58
|
+
|
59
|
+
/*
|
60
|
+
* Notes on COFF:
|
61
|
+
*
|
62
|
+
* (0) When I say `standard COFF' below, I mean `COFF as output and
|
63
|
+
* used by DJGPP'. I assume DJGPP gets it right.
|
64
|
+
*
|
65
|
+
* (1) Win32 appears to interpret the term `relative relocation'
|
66
|
+
* differently from standard COFF. Standard COFF understands a
|
67
|
+
* relative relocation to mean that during relocation you add the
|
68
|
+
* address of the symbol you're referencing, and subtract the base
|
69
|
+
* address of the section you're in. Win32 COFF, by contrast, seems
|
70
|
+
* to add the address of the symbol and then subtract the address
|
71
|
+
* of THE BYTE AFTER THE RELOCATED DWORD. Hence the two formats are
|
72
|
+
* subtly incompatible.
|
73
|
+
*
|
74
|
+
* (2) Win32 doesn't bother putting any flags in the header flags
|
75
|
+
* field (at offset 0x12 into the file).
|
76
|
+
*
|
77
|
+
* (3) Win32 uses some extra flags into the section header table:
|
78
|
+
* it defines flags 0x80000000 (writable), 0x40000000 (readable)
|
79
|
+
* and 0x20000000 (executable), and uses them in the expected
|
80
|
+
* combinations. It also defines 0x00100000 through 0x00700000 for
|
81
|
+
* section alignments of 1 through 64 bytes.
|
82
|
+
*
|
83
|
+
* (4) Both standard COFF and Win32 COFF seem to use the DWORD
|
84
|
+
* field directly after the section name in the section header
|
85
|
+
* table for something strange: they store what the address of the
|
86
|
+
* section start point _would_ be, if you laid all the sections end
|
87
|
+
* to end starting at zero. Dunno why. Microsoft's documentation
|
88
|
+
* lists this field as "Virtual Size of Section", which doesn't
|
89
|
+
* seem to fit at all. In fact, Win32 even includes non-linked
|
90
|
+
* sections such as .drectve in this calculation.
|
91
|
+
*
|
92
|
+
* Newer versions of MASM seem to have changed this to be zero, and
|
93
|
+
* that apparently matches the COFF spec, so go with that.
|
94
|
+
*
|
95
|
+
* (5) Standard COFF does something very strange to common
|
96
|
+
* variables: the relocation point for a common variable is as far
|
97
|
+
* _before_ the variable as its size stretches out _after_ it. So
|
98
|
+
* we must fix up common variable references. Win32 seems to be
|
99
|
+
* sensible on this one.
|
100
|
+
*/
|
101
|
+
|
102
|
+
/* Flag which version of COFF we are currently outputting. */
|
103
|
+
bool win32, win64;
|
104
|
+
|
105
|
+
static int32_t imagebase_sect;
|
106
|
+
#define WRT_IMAGEBASE "..imagebase"
|
107
|
+
|
108
|
+
char coff_infile[FILENAME_MAX];
|
109
|
+
char coff_outfile[FILENAME_MAX];
|
110
|
+
|
111
|
+
/*
|
112
|
+
* Some common section flags by default
|
113
|
+
*/
|
114
|
+
#define TEXT_FLAGS_WIN \
|
115
|
+
(IMAGE_SCN_CNT_CODE | \
|
116
|
+
IMAGE_SCN_ALIGN_16BYTES | \
|
117
|
+
IMAGE_SCN_MEM_EXECUTE | \
|
118
|
+
IMAGE_SCN_MEM_READ)
|
119
|
+
#define TEXT_FLAGS_DOS \
|
120
|
+
(IMAGE_SCN_CNT_CODE)
|
121
|
+
|
122
|
+
#define DATA_FLAGS_WIN \
|
123
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA | \
|
124
|
+
IMAGE_SCN_ALIGN_4BYTES | \
|
125
|
+
IMAGE_SCN_MEM_READ | \
|
126
|
+
IMAGE_SCN_MEM_WRITE)
|
127
|
+
#define DATA_FLAGS_DOS \
|
128
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA)
|
129
|
+
|
130
|
+
#define BSS_FLAGS_WIN \
|
131
|
+
(IMAGE_SCN_CNT_UNINITIALIZED_DATA | \
|
132
|
+
IMAGE_SCN_ALIGN_4BYTES | \
|
133
|
+
IMAGE_SCN_MEM_READ | \
|
134
|
+
IMAGE_SCN_MEM_WRITE)
|
135
|
+
#define BSS_FLAGS_DOS \
|
136
|
+
(IMAGE_SCN_CNT_UNINITIALIZED_DATA)
|
137
|
+
|
138
|
+
#define RDATA_FLAGS_WIN \
|
139
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA | \
|
140
|
+
IMAGE_SCN_ALIGN_8BYTES | \
|
141
|
+
IMAGE_SCN_MEM_READ)
|
142
|
+
|
143
|
+
#define RDATA_FLAGS_DOS \
|
144
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA)
|
145
|
+
|
146
|
+
#define PDATA_FLAGS \
|
147
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA | \
|
148
|
+
IMAGE_SCN_ALIGN_4BYTES | \
|
149
|
+
IMAGE_SCN_MEM_READ)
|
150
|
+
|
151
|
+
#define XDATA_FLAGS \
|
152
|
+
(IMAGE_SCN_CNT_INITIALIZED_DATA | \
|
153
|
+
IMAGE_SCN_ALIGN_8BYTES | \
|
154
|
+
IMAGE_SCN_MEM_READ)
|
155
|
+
|
156
|
+
#define INFO_FLAGS \
|
157
|
+
(IMAGE_SCN_ALIGN_1BYTES | \
|
158
|
+
IMAGE_SCN_LNK_INFO | \
|
159
|
+
IMAGE_SCN_LNK_REMOVE)
|
160
|
+
|
161
|
+
#define TEXT_FLAGS ((win32 | win64) ? TEXT_FLAGS_WIN : TEXT_FLAGS_DOS)
|
162
|
+
#define DATA_FLAGS ((win32 | win64) ? DATA_FLAGS_WIN : DATA_FLAGS_DOS)
|
163
|
+
#define BSS_FLAGS ((win32 | win64) ? BSS_FLAGS_WIN : BSS_FLAGS_DOS)
|
164
|
+
#define RDATA_FLAGS ((win32 | win64) ? RDATA_FLAGS_WIN : RDATA_FLAGS_DOS)
|
165
|
+
|
166
|
+
#define SECT_DELTA 32
|
167
|
+
struct coff_Section **coff_sects;
|
168
|
+
static int sectlen;
|
169
|
+
int coff_nsects;
|
170
|
+
|
171
|
+
struct SAA *coff_syms;
|
172
|
+
uint32_t coff_nsyms;
|
173
|
+
|
174
|
+
static int32_t def_seg;
|
175
|
+
|
176
|
+
static int initsym;
|
177
|
+
|
178
|
+
static struct RAA *bsym, *symval;
|
179
|
+
|
180
|
+
struct SAA *coff_strs;
|
181
|
+
static uint32_t strslen;
|
182
|
+
|
183
|
+
static void coff_gen_init(void);
|
184
|
+
static void coff_sect_write(struct coff_Section *, const uint8_t *, uint32_t);
|
185
|
+
static void coff_write(void);
|
186
|
+
static void coff_section_header(char *, int32_t, int32_t, int32_t, int32_t, int32_t, int, int32_t);
|
187
|
+
static void coff_write_relocs(struct coff_Section *);
|
188
|
+
static void coff_write_symbols(void);
|
189
|
+
|
190
|
+
static void coff_win32_init(void)
|
191
|
+
{
|
192
|
+
win32 = true;
|
193
|
+
win64 = false;
|
194
|
+
coff_gen_init();
|
195
|
+
}
|
196
|
+
|
197
|
+
static void coff_win64_init(void)
|
198
|
+
{
|
199
|
+
win32 = false;
|
200
|
+
win64 = true;
|
201
|
+
coff_gen_init();
|
202
|
+
imagebase_sect = seg_alloc()+1;
|
203
|
+
define_label(WRT_IMAGEBASE, imagebase_sect, 0, NULL, false, false);
|
204
|
+
}
|
205
|
+
|
206
|
+
static void coff_std_init(void)
|
207
|
+
{
|
208
|
+
win32 = win64 = false;
|
209
|
+
coff_gen_init();
|
210
|
+
}
|
211
|
+
|
212
|
+
static void coff_gen_init(void)
|
213
|
+
{
|
214
|
+
|
215
|
+
coff_sects = NULL;
|
216
|
+
coff_nsects = sectlen = 0;
|
217
|
+
coff_syms = saa_init(sizeof(struct coff_Symbol));
|
218
|
+
coff_nsyms = 0;
|
219
|
+
bsym = raa_init();
|
220
|
+
symval = raa_init();
|
221
|
+
coff_strs = saa_init(1);
|
222
|
+
strslen = 0;
|
223
|
+
def_seg = seg_alloc();
|
224
|
+
}
|
225
|
+
|
226
|
+
static void coff_cleanup(void)
|
227
|
+
{
|
228
|
+
struct coff_Reloc *r;
|
229
|
+
int i;
|
230
|
+
|
231
|
+
dfmt->cleanup();
|
232
|
+
|
233
|
+
coff_write();
|
234
|
+
for (i = 0; i < coff_nsects; i++) {
|
235
|
+
if (coff_sects[i]->data)
|
236
|
+
saa_free(coff_sects[i]->data);
|
237
|
+
while (coff_sects[i]->head) {
|
238
|
+
r = coff_sects[i]->head;
|
239
|
+
coff_sects[i]->head = coff_sects[i]->head->next;
|
240
|
+
nasm_free(r);
|
241
|
+
}
|
242
|
+
nasm_free(coff_sects[i]->name);
|
243
|
+
nasm_free(coff_sects[i]);
|
244
|
+
}
|
245
|
+
nasm_free(coff_sects);
|
246
|
+
saa_free(coff_syms);
|
247
|
+
raa_free(bsym);
|
248
|
+
raa_free(symval);
|
249
|
+
saa_free(coff_strs);
|
250
|
+
}
|
251
|
+
|
252
|
+
int coff_make_section(char *name, uint32_t flags)
|
253
|
+
{
|
254
|
+
struct coff_Section *s;
|
255
|
+
size_t namelen;
|
256
|
+
|
257
|
+
s = nasm_zalloc(sizeof(*s));
|
258
|
+
|
259
|
+
if (flags != BSS_FLAGS)
|
260
|
+
s->data = saa_init(1);
|
261
|
+
s->tail = &s->head;
|
262
|
+
if (!strcmp(name, ".text"))
|
263
|
+
s->index = def_seg;
|
264
|
+
else
|
265
|
+
s->index = seg_alloc();
|
266
|
+
s->namepos = -1;
|
267
|
+
namelen = strlen(name);
|
268
|
+
if (namelen > 8) {
|
269
|
+
if (win32 || win64) {
|
270
|
+
s->namepos = strslen + 4;
|
271
|
+
saa_wbytes(coff_strs, name, namelen + 1);
|
272
|
+
strslen += namelen + 1;
|
273
|
+
} else {
|
274
|
+
namelen = 8;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
s->name = nasm_malloc(namelen + 1);
|
278
|
+
strncpy(s->name, name, namelen);
|
279
|
+
s->name[namelen] = '\0';
|
280
|
+
s->flags = flags;
|
281
|
+
|
282
|
+
if (coff_nsects >= sectlen) {
|
283
|
+
sectlen += SECT_DELTA;
|
284
|
+
coff_sects = nasm_realloc(coff_sects, sectlen * sizeof(*coff_sects));
|
285
|
+
}
|
286
|
+
coff_sects[coff_nsects++] = s;
|
287
|
+
|
288
|
+
return coff_nsects - 1;
|
289
|
+
}
|
290
|
+
|
291
|
+
static inline int32_t coff_sectalign_flags(unsigned int align)
|
292
|
+
{
|
293
|
+
return (ilog2_32(align) + 1) << 20;
|
294
|
+
}
|
295
|
+
|
296
|
+
static int32_t coff_section_names(char *name, int pass, int *bits)
|
297
|
+
{
|
298
|
+
char *p;
|
299
|
+
uint32_t flags, align_and = ~0L, align_or = 0L;
|
300
|
+
int i;
|
301
|
+
|
302
|
+
/*
|
303
|
+
* Set default bits.
|
304
|
+
*/
|
305
|
+
if (!name) {
|
306
|
+
if(win64)
|
307
|
+
*bits = 64;
|
308
|
+
else
|
309
|
+
*bits = 32;
|
310
|
+
|
311
|
+
return def_seg;
|
312
|
+
}
|
313
|
+
|
314
|
+
p = name;
|
315
|
+
while (*p && !nasm_isspace(*p))
|
316
|
+
p++;
|
317
|
+
if (*p)
|
318
|
+
*p++ = '\0';
|
319
|
+
if (strlen(name) > 8) {
|
320
|
+
if (!win32 && !win64) {
|
321
|
+
nasm_error(ERR_WARNING,
|
322
|
+
"COFF section names limited to 8 characters: truncating");
|
323
|
+
name[8] = '\0';
|
324
|
+
}
|
325
|
+
}
|
326
|
+
flags = 0;
|
327
|
+
|
328
|
+
while (*p && nasm_isspace(*p))
|
329
|
+
p++;
|
330
|
+
while (*p) {
|
331
|
+
char *q = p;
|
332
|
+
while (*p && !nasm_isspace(*p))
|
333
|
+
p++;
|
334
|
+
if (*p)
|
335
|
+
*p++ = '\0';
|
336
|
+
while (*p && nasm_isspace(*p))
|
337
|
+
p++;
|
338
|
+
|
339
|
+
if (!nasm_stricmp(q, "code") || !nasm_stricmp(q, "text")) {
|
340
|
+
flags = TEXT_FLAGS;
|
341
|
+
} else if (!nasm_stricmp(q, "data")) {
|
342
|
+
flags = DATA_FLAGS;
|
343
|
+
} else if (!nasm_stricmp(q, "rdata")) {
|
344
|
+
if (win32 | win64)
|
345
|
+
flags = RDATA_FLAGS;
|
346
|
+
else {
|
347
|
+
flags = DATA_FLAGS; /* gotta do something */
|
348
|
+
nasm_error(ERR_NONFATAL, "standard COFF does not support"
|
349
|
+
" read-only data sections");
|
350
|
+
}
|
351
|
+
} else if (!nasm_stricmp(q, "bss")) {
|
352
|
+
flags = BSS_FLAGS;
|
353
|
+
} else if (!nasm_stricmp(q, "info")) {
|
354
|
+
if (win32 | win64)
|
355
|
+
flags = INFO_FLAGS;
|
356
|
+
else {
|
357
|
+
flags = DATA_FLAGS; /* gotta do something */
|
358
|
+
nasm_error(ERR_NONFATAL, "standard COFF does not support"
|
359
|
+
" informational sections");
|
360
|
+
}
|
361
|
+
} else if (!nasm_strnicmp(q, "align=", 6)) {
|
362
|
+
if (!(win32 | win64))
|
363
|
+
nasm_error(ERR_NONFATAL, "standard COFF does not support"
|
364
|
+
" section alignment specification");
|
365
|
+
else {
|
366
|
+
if (q[6 + strspn(q + 6, "0123456789")])
|
367
|
+
nasm_error(ERR_NONFATAL,
|
368
|
+
"argument to `align' is not numeric");
|
369
|
+
else {
|
370
|
+
unsigned int align = atoi(q + 6);
|
371
|
+
if (!align || ((align - 1) & align))
|
372
|
+
nasm_error(ERR_NONFATAL, "argument to `align' is not a"
|
373
|
+
" power of two");
|
374
|
+
else if (align > 64)
|
375
|
+
nasm_error(ERR_NONFATAL, "Win32 cannot align sections"
|
376
|
+
" to better than 64-byte boundaries");
|
377
|
+
else {
|
378
|
+
align_and = ~0x00F00000L;
|
379
|
+
align_or = coff_sectalign_flags(align);
|
380
|
+
}
|
381
|
+
}
|
382
|
+
}
|
383
|
+
}
|
384
|
+
}
|
385
|
+
|
386
|
+
for (i = 0; i < coff_nsects; i++)
|
387
|
+
if (!strcmp(name, coff_sects[i]->name))
|
388
|
+
break;
|
389
|
+
if (i == coff_nsects) {
|
390
|
+
if (!flags) {
|
391
|
+
if (!strcmp(name, ".data"))
|
392
|
+
flags = DATA_FLAGS;
|
393
|
+
else if (!strcmp(name, ".rdata"))
|
394
|
+
flags = RDATA_FLAGS;
|
395
|
+
else if (!strcmp(name, ".bss"))
|
396
|
+
flags = BSS_FLAGS;
|
397
|
+
else if (win64 && !strcmp(name, ".pdata"))
|
398
|
+
flags = PDATA_FLAGS;
|
399
|
+
else if (win64 && !strcmp(name, ".xdata"))
|
400
|
+
flags = XDATA_FLAGS;
|
401
|
+
else
|
402
|
+
flags = TEXT_FLAGS;
|
403
|
+
}
|
404
|
+
i = coff_make_section(name, flags);
|
405
|
+
if (flags)
|
406
|
+
coff_sects[i]->flags = flags;
|
407
|
+
coff_sects[i]->flags &= align_and;
|
408
|
+
coff_sects[i]->flags |= align_or;
|
409
|
+
} else if (pass == 1) {
|
410
|
+
/* Check if any flags are specified */
|
411
|
+
if (flags) {
|
412
|
+
unsigned int align_flags = flags & IMAGE_SCN_ALIGN_MASK;
|
413
|
+
|
414
|
+
/* Warn if non-alignment flags differ */
|
415
|
+
if ((flags ^ coff_sects[i]->flags) & ~IMAGE_SCN_ALIGN_MASK) {
|
416
|
+
nasm_error(ERR_WARNING, "section attributes ignored on"
|
417
|
+
" redeclaration of section `%s'", name);
|
418
|
+
}
|
419
|
+
/* Check if alignment might be needed */
|
420
|
+
if (align_flags > IMAGE_SCN_ALIGN_1BYTES) {
|
421
|
+
unsigned int sect_align_flags = coff_sects[i]->flags & IMAGE_SCN_ALIGN_MASK;
|
422
|
+
|
423
|
+
/* Compute the actual alignment */
|
424
|
+
unsigned int align = 1u << ((align_flags - IMAGE_SCN_ALIGN_1BYTES) >> 20);
|
425
|
+
|
426
|
+
/* Update section header as needed */
|
427
|
+
if (align_flags > sect_align_flags) {
|
428
|
+
coff_sects[i]->flags = (coff_sects[i]->flags & ~IMAGE_SCN_ALIGN_MASK) | align_flags;
|
429
|
+
}
|
430
|
+
/* Check if not already aligned */
|
431
|
+
if (coff_sects[i]->len % align) {
|
432
|
+
unsigned int padding = (align - coff_sects[i]->len) % align;
|
433
|
+
/* We need to write at most 8095 bytes */
|
434
|
+
char buffer[8095];
|
435
|
+
if (coff_sects[i]->flags & IMAGE_SCN_CNT_CODE) {
|
436
|
+
/* Fill with INT 3 instructions */
|
437
|
+
memset(buffer, 0xCC, padding);
|
438
|
+
} else {
|
439
|
+
memset(buffer, 0x00, padding);
|
440
|
+
}
|
441
|
+
saa_wbytes(coff_sects[i]->data, buffer, padding);
|
442
|
+
coff_sects[i]->len += padding;
|
443
|
+
}
|
444
|
+
}
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
return coff_sects[i]->index;
|
449
|
+
}
|
450
|
+
|
451
|
+
static void coff_deflabel(char *name, int32_t segment, int64_t offset,
|
452
|
+
int is_global, char *special)
|
453
|
+
{
|
454
|
+
int pos = strslen + 4;
|
455
|
+
struct coff_Symbol *sym;
|
456
|
+
|
457
|
+
if (special)
|
458
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support any"
|
459
|
+
" special symbol types");
|
460
|
+
|
461
|
+
if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
|
462
|
+
if (strcmp(name,WRT_IMAGEBASE))
|
463
|
+
nasm_error(ERR_NONFATAL, "unrecognized special symbol `%s'", name);
|
464
|
+
return;
|
465
|
+
}
|
466
|
+
|
467
|
+
if (strlen(name) > 8) {
|
468
|
+
size_t nlen = strlen(name)+1;
|
469
|
+
saa_wbytes(coff_strs, name, nlen);
|
470
|
+
strslen += nlen;
|
471
|
+
} else
|
472
|
+
pos = -1;
|
473
|
+
|
474
|
+
sym = saa_wstruct(coff_syms);
|
475
|
+
|
476
|
+
sym->strpos = pos;
|
477
|
+
sym->namlen = strlen(name);
|
478
|
+
if (pos == -1)
|
479
|
+
strcpy(sym->name, name);
|
480
|
+
sym->is_global = !!is_global;
|
481
|
+
sym->type = 0; /* Default to T_NULL (no type) */
|
482
|
+
if (segment == NO_SEG)
|
483
|
+
sym->section = -1; /* absolute symbol */
|
484
|
+
else {
|
485
|
+
int i;
|
486
|
+
sym->section = 0;
|
487
|
+
for (i = 0; i < coff_nsects; i++)
|
488
|
+
if (segment == coff_sects[i]->index) {
|
489
|
+
sym->section = i + 1;
|
490
|
+
break;
|
491
|
+
}
|
492
|
+
if (!sym->section)
|
493
|
+
sym->is_global = true;
|
494
|
+
}
|
495
|
+
if (is_global == 2)
|
496
|
+
sym->value = offset;
|
497
|
+
else
|
498
|
+
sym->value = (sym->section == 0 ? 0 : offset);
|
499
|
+
|
500
|
+
/*
|
501
|
+
* define the references from external-symbol segment numbers
|
502
|
+
* to these symbol records.
|
503
|
+
*/
|
504
|
+
if (sym->section == 0)
|
505
|
+
bsym = raa_write(bsym, segment, coff_nsyms);
|
506
|
+
|
507
|
+
if (segment != NO_SEG)
|
508
|
+
symval = raa_write(symval, segment, sym->section ? 0 : sym->value);
|
509
|
+
|
510
|
+
coff_nsyms++;
|
511
|
+
}
|
512
|
+
|
513
|
+
static int32_t coff_add_reloc(struct coff_Section *sect, int32_t segment,
|
514
|
+
int16_t type)
|
515
|
+
{
|
516
|
+
struct coff_Reloc *r;
|
517
|
+
|
518
|
+
r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc));
|
519
|
+
sect->tail = &r->next;
|
520
|
+
r->next = NULL;
|
521
|
+
|
522
|
+
r->address = sect->len;
|
523
|
+
if (segment == NO_SEG) {
|
524
|
+
r->symbol = 0, r->symbase = ABS_SYMBOL;
|
525
|
+
} else {
|
526
|
+
int i;
|
527
|
+
r->symbase = REAL_SYMBOLS;
|
528
|
+
for (i = 0; i < coff_nsects; i++) {
|
529
|
+
if (segment == coff_sects[i]->index) {
|
530
|
+
r->symbol = i * 2;
|
531
|
+
r->symbase = SECT_SYMBOLS;
|
532
|
+
break;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
if (r->symbase == REAL_SYMBOLS)
|
536
|
+
r->symbol = raa_read(bsym, segment);
|
537
|
+
}
|
538
|
+
r->type = type;
|
539
|
+
|
540
|
+
sect->nrelocs++;
|
541
|
+
|
542
|
+
/*
|
543
|
+
* Return the fixup for standard COFF common variables.
|
544
|
+
*/
|
545
|
+
if (r->symbase == REAL_SYMBOLS && !(win32 | win64))
|
546
|
+
return raa_read(symval, segment);
|
547
|
+
|
548
|
+
return 0;
|
549
|
+
}
|
550
|
+
|
551
|
+
static void coff_out(int32_t segto, const void *data,
|
552
|
+
enum out_type type, uint64_t size,
|
553
|
+
int32_t segment, int32_t wrt)
|
554
|
+
{
|
555
|
+
struct coff_Section *s;
|
556
|
+
uint8_t mydata[8], *p;
|
557
|
+
int i;
|
558
|
+
|
559
|
+
if (wrt != NO_SEG && !win64) {
|
560
|
+
wrt = NO_SEG; /* continue to do _something_ */
|
561
|
+
nasm_error(ERR_NONFATAL, "WRT not supported by COFF output formats");
|
562
|
+
}
|
563
|
+
|
564
|
+
/*
|
565
|
+
* handle absolute-assembly (structure definitions)
|
566
|
+
*/
|
567
|
+
if (segto == NO_SEG) {
|
568
|
+
if (type != OUT_RESERVE)
|
569
|
+
nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
|
570
|
+
" space");
|
571
|
+
return;
|
572
|
+
}
|
573
|
+
|
574
|
+
s = NULL;
|
575
|
+
for (i = 0; i < coff_nsects; i++) {
|
576
|
+
if (segto == coff_sects[i]->index) {
|
577
|
+
s = coff_sects[i];
|
578
|
+
break;
|
579
|
+
}
|
580
|
+
}
|
581
|
+
if (!s) {
|
582
|
+
int tempint; /* ignored */
|
583
|
+
if (segto != coff_section_names(".text", 2, &tempint))
|
584
|
+
nasm_panic(0, "strange segment conditions in COFF driver");
|
585
|
+
else
|
586
|
+
s = coff_sects[coff_nsects - 1];
|
587
|
+
}
|
588
|
+
|
589
|
+
/* magically default to 'wrt ..imagebase' in .pdata and .xdata */
|
590
|
+
if (win64 && wrt == NO_SEG) {
|
591
|
+
if (!strcmp(s->name,".pdata") || !strcmp(s->name,".xdata"))
|
592
|
+
wrt = imagebase_sect;
|
593
|
+
}
|
594
|
+
|
595
|
+
if (!s->data && type != OUT_RESERVE) {
|
596
|
+
nasm_error(ERR_WARNING, "attempt to initialize memory in"
|
597
|
+
" BSS section `%s': ignored", s->name);
|
598
|
+
s->len += realsize(type, size);
|
599
|
+
return;
|
600
|
+
}
|
601
|
+
|
602
|
+
memset(mydata, 0, sizeof(mydata));
|
603
|
+
|
604
|
+
if (dfmt && dfmt->debug_output) {
|
605
|
+
struct coff_DebugInfo dinfo;
|
606
|
+
dinfo.segto = segto;
|
607
|
+
dinfo.seg = segment;
|
608
|
+
dinfo.section = s;
|
609
|
+
|
610
|
+
if (type == OUT_ADDRESS)
|
611
|
+
dinfo.size = abs((int)size);
|
612
|
+
else
|
613
|
+
dinfo.size = realsize(type, size);
|
614
|
+
|
615
|
+
dfmt->debug_output(type, &dinfo);
|
616
|
+
}
|
617
|
+
|
618
|
+
if (type == OUT_RESERVE) {
|
619
|
+
if (s->data) {
|
620
|
+
nasm_error(ERR_WARNING, "uninitialised space declared in"
|
621
|
+
" non-BSS section `%s': zeroing", s->name);
|
622
|
+
coff_sect_write(s, NULL, size);
|
623
|
+
} else
|
624
|
+
s->len += size;
|
625
|
+
} else if (type == OUT_RAWDATA) {
|
626
|
+
if (segment != NO_SEG)
|
627
|
+
nasm_panic(0, "OUT_RAWDATA with other than NO_SEG");
|
628
|
+
coff_sect_write(s, data, size);
|
629
|
+
} else if (type == OUT_ADDRESS) {
|
630
|
+
int asize = abs((int)size);
|
631
|
+
if (!win64) {
|
632
|
+
if (asize != 4 && (segment != NO_SEG || wrt != NO_SEG)) {
|
633
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support non-32-bit"
|
634
|
+
" relocations");
|
635
|
+
} else {
|
636
|
+
int32_t fix = 0;
|
637
|
+
if (segment != NO_SEG || wrt != NO_SEG) {
|
638
|
+
if (wrt != NO_SEG) {
|
639
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support"
|
640
|
+
" WRT types");
|
641
|
+
} else if (segment % 2) {
|
642
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support"
|
643
|
+
" segment base references");
|
644
|
+
} else
|
645
|
+
fix = coff_add_reloc(s, segment, IMAGE_REL_I386_DIR32);
|
646
|
+
}
|
647
|
+
p = mydata;
|
648
|
+
WRITELONG(p, *(int64_t *)data + fix);
|
649
|
+
coff_sect_write(s, mydata, asize);
|
650
|
+
}
|
651
|
+
} else {
|
652
|
+
int32_t fix = 0;
|
653
|
+
p = mydata;
|
654
|
+
if (asize == 8) {
|
655
|
+
if (wrt == imagebase_sect) {
|
656
|
+
nasm_error(ERR_NONFATAL, "operand size mismatch: 'wrt "
|
657
|
+
WRT_IMAGEBASE "' is a 32-bit operand");
|
658
|
+
}
|
659
|
+
fix = coff_add_reloc(s, segment, IMAGE_REL_AMD64_ADDR64);
|
660
|
+
WRITEDLONG(p, *(int64_t *)data + fix);
|
661
|
+
coff_sect_write(s, mydata, asize);
|
662
|
+
} else {
|
663
|
+
fix = coff_add_reloc(s, segment,
|
664
|
+
wrt == imagebase_sect ? IMAGE_REL_AMD64_ADDR32NB:
|
665
|
+
IMAGE_REL_AMD64_ADDR32);
|
666
|
+
WRITELONG(p, *(int64_t *)data + fix);
|
667
|
+
coff_sect_write(s, mydata, asize);
|
668
|
+
}
|
669
|
+
}
|
670
|
+
} else if (type == OUT_REL2ADR) {
|
671
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support 16-bit"
|
672
|
+
" relocations");
|
673
|
+
} else if (type == OUT_REL4ADR) {
|
674
|
+
if (segment == segto && !(win64)) /* Acceptable for RIP-relative */
|
675
|
+
nasm_panic(0, "intra-segment OUT_REL4ADR");
|
676
|
+
else if (segment == NO_SEG && win32)
|
677
|
+
nasm_error(ERR_NONFATAL, "Win32 COFF does not correctly support"
|
678
|
+
" relative references to absolute addresses");
|
679
|
+
else {
|
680
|
+
int32_t fix = 0;
|
681
|
+
if (segment != NO_SEG && segment % 2) {
|
682
|
+
nasm_error(ERR_NONFATAL, "COFF format does not support"
|
683
|
+
" segment base references");
|
684
|
+
} else
|
685
|
+
fix = coff_add_reloc(s, segment,
|
686
|
+
win64 ? IMAGE_REL_AMD64_REL32 : IMAGE_REL_I386_REL32);
|
687
|
+
p = mydata;
|
688
|
+
if (win32 | win64) {
|
689
|
+
WRITELONG(p, *(int64_t *)data + 4 - size + fix);
|
690
|
+
} else {
|
691
|
+
WRITELONG(p, *(int64_t *)data - (size + s->len) + fix);
|
692
|
+
}
|
693
|
+
coff_sect_write(s, mydata, 4L);
|
694
|
+
}
|
695
|
+
|
696
|
+
}
|
697
|
+
}
|
698
|
+
|
699
|
+
static void coff_sect_write(struct coff_Section *sect,
|
700
|
+
const uint8_t *data, uint32_t len)
|
701
|
+
{
|
702
|
+
saa_wbytes(sect->data, data, len);
|
703
|
+
sect->len += len;
|
704
|
+
}
|
705
|
+
|
706
|
+
typedef struct tagString {
|
707
|
+
struct tagString *next;
|
708
|
+
int len;
|
709
|
+
char *String;
|
710
|
+
} STRING;
|
711
|
+
|
712
|
+
#define EXPORT_SECTION_NAME ".drectve"
|
713
|
+
#define EXPORT_SECTION_FLAGS INFO_FLAGS
|
714
|
+
/*
|
715
|
+
* #define EXPORT_SECTION_NAME ".text"
|
716
|
+
* #define EXPORT_SECTION_FLAGS TEXT_FLAGS
|
717
|
+
*/
|
718
|
+
|
719
|
+
static STRING *Exports = NULL;
|
720
|
+
static struct coff_Section *directive_sec;
|
721
|
+
static void AddExport(char *name)
|
722
|
+
{
|
723
|
+
STRING *rvp = Exports, *newS;
|
724
|
+
|
725
|
+
newS = (STRING *) nasm_malloc(sizeof(STRING));
|
726
|
+
newS->len = strlen(name);
|
727
|
+
newS->next = NULL;
|
728
|
+
newS->String = (char *)nasm_malloc(newS->len + 1);
|
729
|
+
strcpy(newS->String, name);
|
730
|
+
if (rvp == NULL) {
|
731
|
+
int i;
|
732
|
+
|
733
|
+
for (i = 0; i < coff_nsects; i++) {
|
734
|
+
if (!strcmp(EXPORT_SECTION_NAME, coff_sects[i]->name))
|
735
|
+
break;
|
736
|
+
}
|
737
|
+
|
738
|
+
if (i == coff_nsects)
|
739
|
+
i = coff_make_section(EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS);
|
740
|
+
|
741
|
+
directive_sec = coff_sects[i];
|
742
|
+
Exports = newS;
|
743
|
+
} else {
|
744
|
+
while (rvp->next) {
|
745
|
+
if (!strcmp(rvp->String, name))
|
746
|
+
return;
|
747
|
+
rvp = rvp->next;
|
748
|
+
}
|
749
|
+
rvp->next = newS;
|
750
|
+
}
|
751
|
+
}
|
752
|
+
|
753
|
+
static void BuildExportTable(STRING **rvp)
|
754
|
+
{
|
755
|
+
STRING *p, *t;
|
756
|
+
|
757
|
+
if (!rvp || !*rvp)
|
758
|
+
return;
|
759
|
+
|
760
|
+
list_for_each_safe(p, t, *rvp) {
|
761
|
+
coff_sect_write(directive_sec, (uint8_t *)"-export:", 8);
|
762
|
+
coff_sect_write(directive_sec, (uint8_t *)p->String, p->len);
|
763
|
+
coff_sect_write(directive_sec, (uint8_t *)" ", 1);
|
764
|
+
nasm_free(p->String);
|
765
|
+
nasm_free(p);
|
766
|
+
}
|
767
|
+
|
768
|
+
*rvp = NULL;
|
769
|
+
}
|
770
|
+
|
771
|
+
static enum directive_result
|
772
|
+
coff_directives(enum directive directive, char *value, int pass)
|
773
|
+
{
|
774
|
+
switch (directive) {
|
775
|
+
case D_EXPORT:
|
776
|
+
{
|
777
|
+
char *q, *name;
|
778
|
+
|
779
|
+
if (pass == 2)
|
780
|
+
return DIRR_OK; /* ignore in pass two */
|
781
|
+
name = q = value;
|
782
|
+
while (*q && !nasm_isspace(*q))
|
783
|
+
q++;
|
784
|
+
if (nasm_isspace(*q)) {
|
785
|
+
*q++ = '\0';
|
786
|
+
while (*q && nasm_isspace(*q))
|
787
|
+
q++;
|
788
|
+
}
|
789
|
+
|
790
|
+
if (!*name) {
|
791
|
+
nasm_error(ERR_NONFATAL, "`export' directive requires export name");
|
792
|
+
return DIRR_ERROR;
|
793
|
+
}
|
794
|
+
if (*q) {
|
795
|
+
nasm_error(ERR_NONFATAL, "unrecognized export qualifier `%s'", q);
|
796
|
+
return DIRR_ERROR;
|
797
|
+
}
|
798
|
+
AddExport(name);
|
799
|
+
return DIRR_OK;
|
800
|
+
}
|
801
|
+
case D_SAFESEH:
|
802
|
+
{
|
803
|
+
static int sxseg=-1;
|
804
|
+
int i;
|
805
|
+
|
806
|
+
if (!win32) /* Only applicable for -f win32 */
|
807
|
+
return 0;
|
808
|
+
|
809
|
+
if (sxseg == -1) {
|
810
|
+
for (i = 0; i < coff_nsects; i++)
|
811
|
+
if (!strcmp(".sxdata",coff_sects[i]->name))
|
812
|
+
break;
|
813
|
+
if (i == coff_nsects)
|
814
|
+
sxseg = coff_make_section(".sxdata", IMAGE_SCN_LNK_INFO);
|
815
|
+
else
|
816
|
+
sxseg = i;
|
817
|
+
}
|
818
|
+
/*
|
819
|
+
* pass0 == 2 is the only time when the full set of symbols are
|
820
|
+
* guaranteed to be present; it is the final output pass.
|
821
|
+
*/
|
822
|
+
if (pass0 == 2) {
|
823
|
+
uint32_t n;
|
824
|
+
saa_rewind(coff_syms);
|
825
|
+
for (n = 0; n < coff_nsyms; n++) {
|
826
|
+
struct coff_Symbol *sym = saa_rstruct(coff_syms);
|
827
|
+
bool equals;
|
828
|
+
|
829
|
+
/*
|
830
|
+
* sym->strpos is biased by 4, because symbol
|
831
|
+
* table is prefixed with table length
|
832
|
+
*/
|
833
|
+
if (sym->strpos >=4) {
|
834
|
+
char *name = nasm_malloc(sym->namlen+1);
|
835
|
+
saa_fread(coff_strs, sym->strpos-4, name, sym->namlen);
|
836
|
+
name[sym->namlen] = '\0';
|
837
|
+
equals = !strcmp(value,name);
|
838
|
+
nasm_free(name);
|
839
|
+
} else {
|
840
|
+
equals = !strcmp(value,sym->name);
|
841
|
+
}
|
842
|
+
|
843
|
+
if (equals) {
|
844
|
+
/*
|
845
|
+
* this value arithmetics effectively reflects
|
846
|
+
* initsym in coff_write(): 2 for file, 1 for
|
847
|
+
* .absolute and two per each section
|
848
|
+
*/
|
849
|
+
unsigned char value[4],*p=value;
|
850
|
+
WRITELONG(p,n + 2 + 1 + coff_nsects*2);
|
851
|
+
coff_sect_write(coff_sects[sxseg],value,4);
|
852
|
+
sym->type = 0x20;
|
853
|
+
break;
|
854
|
+
}
|
855
|
+
}
|
856
|
+
if (n == coff_nsyms) {
|
857
|
+
nasm_error(ERR_NONFATAL,
|
858
|
+
"`safeseh' directive requires valid symbol");
|
859
|
+
return DIRR_ERROR;
|
860
|
+
}
|
861
|
+
}
|
862
|
+
return DIRR_OK;
|
863
|
+
}
|
864
|
+
default:
|
865
|
+
return DIRR_UNKNOWN;
|
866
|
+
}
|
867
|
+
}
|
868
|
+
|
869
|
+
/* handle relocations storm, valid for win32/64 only */
|
870
|
+
static inline void coff_adjust_relocs(struct coff_Section *s)
|
871
|
+
{
|
872
|
+
if (s->nrelocs < IMAGE_SCN_MAX_RELOC)
|
873
|
+
return;
|
874
|
+
#ifdef OF_COFF
|
875
|
+
else
|
876
|
+
{
|
877
|
+
if (ofmt == &of_coff)
|
878
|
+
nasm_fatal(0,
|
879
|
+
"Too many relocations (%d) for section `%s'",
|
880
|
+
s->nrelocs, s->name);
|
881
|
+
}
|
882
|
+
#endif
|
883
|
+
|
884
|
+
s->flags |= IMAGE_SCN_LNK_NRELOC_OVFL;
|
885
|
+
s->nrelocs++;
|
886
|
+
}
|
887
|
+
|
888
|
+
static void coff_write(void)
|
889
|
+
{
|
890
|
+
int32_t pos, sympos, vsize;
|
891
|
+
int i;
|
892
|
+
|
893
|
+
/* fill in the .drectve section with -export's */
|
894
|
+
BuildExportTable(&Exports);
|
895
|
+
|
896
|
+
if (win32) {
|
897
|
+
/* add default value for @feat.00, this allows to 'link /safeseh' */
|
898
|
+
uint32_t n;
|
899
|
+
|
900
|
+
saa_rewind(coff_syms);
|
901
|
+
for (n = 0; n < coff_nsyms; n++) {
|
902
|
+
struct coff_Symbol *sym = saa_rstruct(coff_syms);
|
903
|
+
if (sym->strpos == -1 && !strcmp("@feat.00",sym->name))
|
904
|
+
break;
|
905
|
+
}
|
906
|
+
if (n == coff_nsyms)
|
907
|
+
coff_deflabel("@feat.00", NO_SEG, 1, 0, NULL);
|
908
|
+
}
|
909
|
+
|
910
|
+
/*
|
911
|
+
* Work out how big the file will get.
|
912
|
+
* Calculate the start of the `real' symbols at the same time.
|
913
|
+
* Check for massive relocations.
|
914
|
+
*/
|
915
|
+
pos = 0x14 + 0x28 * coff_nsects;
|
916
|
+
initsym = 3; /* two for the file, one absolute */
|
917
|
+
for (i = 0; i < coff_nsects; i++) {
|
918
|
+
if (coff_sects[i]->data) {
|
919
|
+
coff_adjust_relocs(coff_sects[i]);
|
920
|
+
coff_sects[i]->pos = pos;
|
921
|
+
pos += coff_sects[i]->len;
|
922
|
+
coff_sects[i]->relpos = pos;
|
923
|
+
pos += 10 * coff_sects[i]->nrelocs;
|
924
|
+
} else
|
925
|
+
coff_sects[i]->pos = coff_sects[i]->relpos = 0L;
|
926
|
+
initsym += 2; /* two for each section */
|
927
|
+
}
|
928
|
+
sympos = pos;
|
929
|
+
|
930
|
+
/*
|
931
|
+
* Output the COFF header.
|
932
|
+
*/
|
933
|
+
if (win64)
|
934
|
+
i = IMAGE_FILE_MACHINE_AMD64;
|
935
|
+
else
|
936
|
+
i = IMAGE_FILE_MACHINE_I386;
|
937
|
+
fwriteint16_t(i, ofile); /* machine type */
|
938
|
+
fwriteint16_t(coff_nsects, ofile); /* number of sections */
|
939
|
+
fwriteint32_t(time(NULL), ofile); /* time stamp */
|
940
|
+
fwriteint32_t(sympos, ofile);
|
941
|
+
fwriteint32_t(coff_nsyms + initsym, ofile);
|
942
|
+
fwriteint16_t(0, ofile); /* no optional header */
|
943
|
+
/* Flags: 32-bit, no line numbers. Win32 doesn't even bother with them. */
|
944
|
+
fwriteint16_t((win32 | win64) ? 0 : 0x104, ofile);
|
945
|
+
|
946
|
+
/*
|
947
|
+
* Output the section headers.
|
948
|
+
*/
|
949
|
+
vsize = 0L;
|
950
|
+
for (i = 0; i < coff_nsects; i++) {
|
951
|
+
coff_section_header(coff_sects[i]->name, coff_sects[i]->namepos, vsize, coff_sects[i]->len,
|
952
|
+
coff_sects[i]->pos, coff_sects[i]->relpos,
|
953
|
+
coff_sects[i]->nrelocs, coff_sects[i]->flags);
|
954
|
+
vsize += coff_sects[i]->len;
|
955
|
+
}
|
956
|
+
|
957
|
+
/*
|
958
|
+
* Output the sections and their relocations.
|
959
|
+
*/
|
960
|
+
for (i = 0; i < coff_nsects; i++)
|
961
|
+
if (coff_sects[i]->data) {
|
962
|
+
saa_fpwrite(coff_sects[i]->data, ofile);
|
963
|
+
coff_write_relocs(coff_sects[i]);
|
964
|
+
}
|
965
|
+
|
966
|
+
/*
|
967
|
+
* Output the symbol and string tables.
|
968
|
+
*/
|
969
|
+
coff_write_symbols();
|
970
|
+
fwriteint32_t(strslen + 4, ofile); /* length includes length count */
|
971
|
+
saa_fpwrite(coff_strs, ofile);
|
972
|
+
}
|
973
|
+
|
974
|
+
static void coff_section_header(char *name, int32_t namepos, int32_t vsize,
|
975
|
+
int32_t datalen, int32_t datapos,
|
976
|
+
int32_t relpos, int nrelocs, int32_t flags)
|
977
|
+
{
|
978
|
+
char padname[8];
|
979
|
+
|
980
|
+
(void)vsize;
|
981
|
+
|
982
|
+
if (namepos == -1) {
|
983
|
+
strncpy(padname, name, 8);
|
984
|
+
nasm_write(padname, 8, ofile);
|
985
|
+
} else {
|
986
|
+
/*
|
987
|
+
* If name is longer than 8 bytes, write '/' followed
|
988
|
+
* by offset into the strings table represented as
|
989
|
+
* decimal number.
|
990
|
+
*/
|
991
|
+
namepos = namepos % 100000000;
|
992
|
+
padname[0] = '/';
|
993
|
+
padname[1] = '0' + (namepos / 1000000);
|
994
|
+
namepos = namepos % 1000000;
|
995
|
+
padname[2] = '0' + (namepos / 100000);
|
996
|
+
namepos = namepos % 100000;
|
997
|
+
padname[3] = '0' + (namepos / 10000);
|
998
|
+
namepos = namepos % 10000;
|
999
|
+
padname[4] = '0' + (namepos / 1000);
|
1000
|
+
namepos = namepos % 1000;
|
1001
|
+
padname[5] = '0' + (namepos / 100);
|
1002
|
+
namepos = namepos % 100;
|
1003
|
+
padname[6] = '0' + (namepos / 10);
|
1004
|
+
namepos = namepos % 10;
|
1005
|
+
padname[7] = '0' + (namepos);
|
1006
|
+
nasm_write(padname, 8, ofile);
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
fwriteint32_t(0, ofile); /* Virtual size field - set to 0 or vsize */
|
1010
|
+
fwriteint32_t(0L, ofile); /* RVA/offset - we ignore */
|
1011
|
+
fwriteint32_t(datalen, ofile);
|
1012
|
+
fwriteint32_t(datapos, ofile);
|
1013
|
+
fwriteint32_t(relpos, ofile);
|
1014
|
+
fwriteint32_t(0L, ofile); /* no line numbers - we don't do 'em */
|
1015
|
+
|
1016
|
+
/*
|
1017
|
+
* a special case -- if there are too many relocs
|
1018
|
+
* we have to put IMAGE_SCN_MAX_RELOC here and write
|
1019
|
+
* the real relocs number into VirtualAddress of first
|
1020
|
+
* relocation
|
1021
|
+
*/
|
1022
|
+
if (flags & IMAGE_SCN_LNK_NRELOC_OVFL)
|
1023
|
+
fwriteint16_t(IMAGE_SCN_MAX_RELOC, ofile);
|
1024
|
+
else
|
1025
|
+
fwriteint16_t(nrelocs, ofile);
|
1026
|
+
|
1027
|
+
fwriteint16_t(0, ofile); /* again, no line numbers */
|
1028
|
+
fwriteint32_t(flags, ofile);
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
static void coff_write_relocs(struct coff_Section *s)
|
1032
|
+
{
|
1033
|
+
struct coff_Reloc *r;
|
1034
|
+
|
1035
|
+
/* a real number of relocations if needed */
|
1036
|
+
if (s->flags & IMAGE_SCN_LNK_NRELOC_OVFL) {
|
1037
|
+
fwriteint32_t(s->nrelocs, ofile);
|
1038
|
+
fwriteint32_t(0, ofile);
|
1039
|
+
fwriteint16_t(0, ofile);
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
for (r = s->head; r; r = r->next) {
|
1043
|
+
fwriteint32_t(r->address, ofile);
|
1044
|
+
fwriteint32_t(r->symbol + (r->symbase == REAL_SYMBOLS ? initsym :
|
1045
|
+
r->symbase == ABS_SYMBOL ? initsym - 1 :
|
1046
|
+
r->symbase == SECT_SYMBOLS ? 2 : 0),
|
1047
|
+
ofile);
|
1048
|
+
fwriteint16_t(r->type, ofile);
|
1049
|
+
}
|
1050
|
+
}
|
1051
|
+
|
1052
|
+
static void coff_symbol(char *name, int32_t strpos, int32_t value,
|
1053
|
+
int section, int type, int storageclass, int aux)
|
1054
|
+
{
|
1055
|
+
char padname[8];
|
1056
|
+
|
1057
|
+
if (name) {
|
1058
|
+
strncpy(padname, name, 8);
|
1059
|
+
nasm_write(padname, 8, ofile);
|
1060
|
+
} else {
|
1061
|
+
fwriteint32_t(0, ofile);
|
1062
|
+
fwriteint32_t(strpos, ofile);
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
fwriteint32_t(value, ofile);
|
1066
|
+
fwriteint16_t(section, ofile);
|
1067
|
+
fwriteint16_t(type, ofile);
|
1068
|
+
|
1069
|
+
fputc(storageclass, ofile);
|
1070
|
+
fputc(aux, ofile);
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
static void coff_write_symbols(void)
|
1074
|
+
{
|
1075
|
+
char filename[18];
|
1076
|
+
uint32_t i;
|
1077
|
+
|
1078
|
+
/*
|
1079
|
+
* The `.file' record, and the file name auxiliary record.
|
1080
|
+
*/
|
1081
|
+
coff_symbol(".file", 0L, 0L, -2, 0, 0x67, 1);
|
1082
|
+
strncpy(filename, coff_infile, 18);
|
1083
|
+
nasm_write(filename, 18, ofile);
|
1084
|
+
|
1085
|
+
/*
|
1086
|
+
* The section records, with their auxiliaries.
|
1087
|
+
*/
|
1088
|
+
memset(filename, 0, 18); /* useful zeroed buffer */
|
1089
|
+
|
1090
|
+
for (i = 0; i < (uint32_t) coff_nsects; i++) {
|
1091
|
+
coff_symbol(coff_sects[i]->name, 0L, 0L, i + 1, 0, 3, 1);
|
1092
|
+
fwriteint32_t(coff_sects[i]->len, ofile);
|
1093
|
+
fwriteint16_t(coff_sects[i]->nrelocs,ofile);
|
1094
|
+
nasm_write(filename, 12, ofile);
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
/*
|
1098
|
+
* The absolute symbol, for relative-to-absolute relocations.
|
1099
|
+
*/
|
1100
|
+
coff_symbol(".absolut", 0L, 0L, -1, 0, 3, 0);
|
1101
|
+
|
1102
|
+
/*
|
1103
|
+
* The real symbols.
|
1104
|
+
*/
|
1105
|
+
saa_rewind(coff_syms);
|
1106
|
+
for (i = 0; i < coff_nsyms; i++) {
|
1107
|
+
struct coff_Symbol *sym = saa_rstruct(coff_syms);
|
1108
|
+
coff_symbol(sym->strpos == -1 ? sym->name : NULL,
|
1109
|
+
sym->strpos, sym->value, sym->section,
|
1110
|
+
sym->type, sym->is_global ? 2 : 3, 0);
|
1111
|
+
}
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
static void coff_sectalign(int32_t seg, unsigned int value)
|
1115
|
+
{
|
1116
|
+
struct coff_Section *s = NULL;
|
1117
|
+
uint32_t align;
|
1118
|
+
int i;
|
1119
|
+
|
1120
|
+
for (i = 0; i < coff_nsects; i++) {
|
1121
|
+
if (coff_sects[i]->index == seg) {
|
1122
|
+
s = coff_sects[i];
|
1123
|
+
break;
|
1124
|
+
}
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
if (!s || !is_power2(value))
|
1128
|
+
return;
|
1129
|
+
|
1130
|
+
/* DOS has limitation on 64 bytes */
|
1131
|
+
if (!(win32 | win64) && value > 64)
|
1132
|
+
return;
|
1133
|
+
|
1134
|
+
align = (s->flags & IMAGE_SCN_ALIGN_MASK);
|
1135
|
+
value = coff_sectalign_flags(value);
|
1136
|
+
if (value > align)
|
1137
|
+
s->flags = (s->flags & ~IMAGE_SCN_ALIGN_MASK) | value;
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
static int32_t coff_segbase(int32_t segment)
|
1141
|
+
{
|
1142
|
+
return segment;
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
static void coff_std_filename(char *inname, char *outname)
|
1146
|
+
{
|
1147
|
+
strcpy(coff_infile, inname);
|
1148
|
+
standard_extension(inname, outname, ".o");
|
1149
|
+
strcpy(coff_outfile, outname);
|
1150
|
+
}
|
1151
|
+
|
1152
|
+
static void coff_win32_filename(char *inname, char *outname)
|
1153
|
+
{
|
1154
|
+
strcpy(coff_infile, inname);
|
1155
|
+
standard_extension(inname, outname, ".obj");
|
1156
|
+
strcpy(coff_outfile, outname);
|
1157
|
+
}
|
1158
|
+
|
1159
|
+
extern macros_t coff_stdmac[];
|
1160
|
+
|
1161
|
+
#endif /* defined(OF_COFF) || defined(OF_WIN32) */
|
1162
|
+
|
1163
|
+
#ifdef OF_COFF
|
1164
|
+
|
1165
|
+
const struct ofmt of_coff = {
|
1166
|
+
"COFF (i386) object files (e.g. DJGPP for DOS)",
|
1167
|
+
"coff",
|
1168
|
+
0,
|
1169
|
+
32,
|
1170
|
+
null_debug_arr,
|
1171
|
+
&null_debug_form,
|
1172
|
+
coff_stdmac,
|
1173
|
+
coff_std_init,
|
1174
|
+
nasm_do_legacy_output,
|
1175
|
+
coff_out,
|
1176
|
+
coff_deflabel,
|
1177
|
+
coff_section_names,
|
1178
|
+
coff_sectalign,
|
1179
|
+
coff_segbase,
|
1180
|
+
coff_directives,
|
1181
|
+
coff_std_filename,
|
1182
|
+
coff_cleanup,
|
1183
|
+
NULL /* pragma list */
|
1184
|
+
};
|
1185
|
+
|
1186
|
+
#endif
|
1187
|
+
|
1188
|
+
extern const struct dfmt df_cv8;
|
1189
|
+
|
1190
|
+
#ifdef OF_WIN32
|
1191
|
+
|
1192
|
+
static const struct dfmt * const win32_debug_arr[2] = { &df_cv8, NULL };
|
1193
|
+
|
1194
|
+
const struct ofmt of_win32 = {
|
1195
|
+
"Microsoft Win32 (i386) object files",
|
1196
|
+
"win32",
|
1197
|
+
0,
|
1198
|
+
32,
|
1199
|
+
win32_debug_arr,
|
1200
|
+
&df_cv8,
|
1201
|
+
coff_stdmac,
|
1202
|
+
coff_win32_init,
|
1203
|
+
nasm_do_legacy_output,
|
1204
|
+
coff_out,
|
1205
|
+
coff_deflabel,
|
1206
|
+
coff_section_names,
|
1207
|
+
coff_sectalign,
|
1208
|
+
coff_segbase,
|
1209
|
+
coff_directives,
|
1210
|
+
coff_win32_filename,
|
1211
|
+
coff_cleanup,
|
1212
|
+
NULL /* pragma list */
|
1213
|
+
};
|
1214
|
+
|
1215
|
+
#endif
|
1216
|
+
|
1217
|
+
#ifdef OF_WIN64
|
1218
|
+
|
1219
|
+
static const struct dfmt * const win64_debug_arr[2] = { &df_cv8, NULL };
|
1220
|
+
|
1221
|
+
const struct ofmt of_win64 = {
|
1222
|
+
"Microsoft Win64 (x86-64) object files",
|
1223
|
+
"win64",
|
1224
|
+
0,
|
1225
|
+
64,
|
1226
|
+
win64_debug_arr,
|
1227
|
+
&df_cv8,
|
1228
|
+
coff_stdmac,
|
1229
|
+
coff_win64_init,
|
1230
|
+
nasm_do_legacy_output,
|
1231
|
+
coff_out,
|
1232
|
+
coff_deflabel,
|
1233
|
+
coff_section_names,
|
1234
|
+
coff_sectalign,
|
1235
|
+
coff_segbase,
|
1236
|
+
coff_directives,
|
1237
|
+
coff_win32_filename,
|
1238
|
+
coff_cleanup,
|
1239
|
+
NULL /* pragma list */
|
1240
|
+
};
|
1241
|
+
|
1242
|
+
#endif
|