summaryrefslogtreecommitdiff
path: root/output/outaout.c
AgeCommit message (Collapse)AuthorFilesLines
2010-04-21Rename SEGALIGN to SECTALIGNCyrill Gorcunov1-2/+2
"sectalign" is preferred over "segalign" since it operates over section attributes. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21ofmt: Implement null_segalign stubsCyrill Gorcunov1-0/+2
Set stubs for all targets Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-02-11Use ALIGN helperCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-31Remove outdated commentsCyrill Gorcunov1-2/+2
From Frank Kotler: | ... | > - stdscan_bufptr = saveme; /* bugfix? fbk 8/10/00 */ | > + stdscan_set(saveme); /* bugfix? fbk 8/10/00 */ | | While you're at it, you could remove my comment(s - it seems to have | reproduced). It *is* a bugfix (apparently). "saveme" might have a better | name, too... So get rid of the comments. Reported-by: Frank Kotler <fbkotler@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-31stdscan: switch to stdscan_get/set routinesCyrill Gorcunov1-4/+4
Instead of manipulating stdscan buffer pointer directly we switch to a routine interface. This allow us to unify stdscan access: ie caller should "talk" to stdscan via stdscan_get/set routines. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-28outaout.c -- use list helpersCyrill Gorcunov1-6/+4
Note that we use list_for_each(var,var) sometime which actually brings in at least one redundant assignment in case of NULL being passed but save us a few lines of code. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-18Drop the ofmt and errfunc arguments to label definition functionsH. Peter Anvin1-10/+5
We never set ofmt and errfunc to anything but the global values. Dropping them from the label definition function command line simplifies the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-18Remove function pointers in output, simplify error handlingH. Peter Anvin1-77/+68
Remove a bunch of function pointers in the output stage; they are never changed and don't add any value. Also make "ofile" a global variable and let the backend use it directly. All we ever did with these variables were stashing it in locals and using them as-is anyway for no benefit. Also change the global error function, nasm_error() into a true function which invokes a function pointer internally. That lets us use direct calls to it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-12Hash even backend-specific directives, unify null functionsH. Peter Anvin1-18/+4
Hash all directives, even the ones that are backend-specific, and instead pass the backend an already-parsed directive number. Furthermore, unify null functions across various backends. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-12Don't fclose() the output in the backendH. Peter Anvin1-1/+0
We fopen() the output file in common code but fclose() it in the backend. This is bad for a variety of reasons: 1. it is generally an awkward interface to change ownership. 2. we should use ferror() to test for write errors, and that is better done in common code. 3. it requires more code. 4. we still need to fclose() in common code during error handing. Thus, move the fclose() of the output out of the backends, and add fflush() so we can test ferror() on output. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05Make it possible for outputs to be either text or binaryH. Peter Anvin1-2/+2
Allow the backend to specify that an output format is either text or binary. For future uses, define this as a flag word so we can define other flags in the future if it would make sense. Currently, the ieee and dbg formats are text; all the others are binary. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28Add new copyright headers to the output modulesH. Peter Anvin1-6/+35
Add new copyright headers to the new output modules. As far as I know, the only module which we still don't have a green light to release under 2-BSD is outmacho. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27Move backend-specific code to output/; break out null debug stuffH. Peter Anvin1-2/+2
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>
2008-10-27output: add common file outlib.c for common functions; realsize()H. Peter Anvin1-5/+2
Add a common file, outlib.c, for output formats. Add the function realsize() instead of open-coded variants in almost every backend. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-21ctype.h: wrapper ctype functions with a cast to (unsigned char)H. Peter Anvin1-3/+3
ctype functions take an *int*, which the user is expected to have taken the input character from getc() and friends, or taken a character and cast it to (unsigned char). We don't care about EOF (-1), so use macros that cast to (unsigned char) for us.
2008-06-20Move the output format macros into the macros.pl mechanismH. Peter Anvin1-6/+1
Move the handling of "extra" macros (i.e. output format macros) into the macros.pl mechanism. This allows us to change the format of the internal macro store in the future - e.g. to a single byte store without redundant pointers. Also, stop using indicies into a long array when there is no good reason to not just use different arrays.
2008-06-09Move all the RAA code out of nasmlibH. Peter Anvin1-0/+1
The RAA code doesn't have to be in nasmlib; it is only used by nasm itself, and is better handled in a separate module.
2008-06-09Move all the SAA code out of nasmlibH. Peter Anvin1-0/+1
Move all the SAA code out of nasmlib; it's not used by anything than nasm itself. Cleaning out the kitchen sink known as nasmlib is a good thing, too.
2007-12-29regularized spelling of license to match name of LICENSE fileBeroset1-1/+1
2007-11-13Address data is int64_t; simplify writing an address objectH. Peter Anvin1-3/+3
Address data is always int64_t even if the size itself is smaller; this was broken on bigendian hosts (still need testing!) Create simple "write sized object" macros.
2007-11-09Don't combine type and size into a single argumentH. Peter Anvin1-19/+17
Don't combine type and size into a single argument; *every* backend immediately breaks them apart, so it's really just a huge waste of effort. Additionally, it avoids using short immediates in the resulting code, which is a bad thing.
2007-11-06Pass 64-bit instruction lengths to back-ends.Charles Crayne1-1/+1
2007-11-05Upgrade label functions to 64-bitCharles Crayne1-1/+1
2007-10-19Formatting: kill off "stealth whitespace"H. Peter Anvin1-1/+1
"Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
2007-10-10Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin1-12/+12
Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
2007-10-02Portability fixesH. Peter Anvin1-0/+2
Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
2007-08-30Finishing touches on perfect hash tokenizer; actually turn the thing onH. Peter Anvin1-0/+1
Finish the perfect hash tokenizer, and actually enable it. Move stdscan() et al to a separate file, since it's not needed in any of the clients of nasmlib other than nasm itself. Run make alldeps.
2007-04-14Placated unreferenced types.Keith Kanios1-0/+8
2007-04-13Fixed distinction between char and int8_t data types.Keith Kanios1-10/+10
2007-04-12General push for x86-64 support, dubbed 0.99.00.Keith Kanios1-74/+75
2005-01-15Apply Nindent to all .c and .h filesH. Peter Anvin1-449/+469
2003-09-25Revert erroneous macro added and modify __OUTPUT_FORMAT__ to a string constStanislav Karchebny1-1/+0
2003-09-25Consistency fixStanislav Karchebny1-1/+1
2003-09-24Added _NASM_FORMAT_ macroStanislav Karchebny1-0/+1
2002-09-12"const"-ipation fixes from Trevor WoernerH. Peter Anvin1-3/+3
2002-05-14Change "const static" -> "static const" to keep gcc happyH. Peter Anvin1-1/+1
2002-05-14Code cleanup fixes from Ed BerosetH. Peter Anvin1-1/+1
2002-04-30NASM 0.98.30H. Peter Anvin1-0/+933