summaryrefslogtreecommitdiff
path: root/output
Commit message (Collapse)AuthorAgeFilesLines
...
* Elf: Drop never used SOC helperCyrill Gorcunov2010-04-102-4/+0
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Introduce section_attrib helperCyrill Gorcunov2010-04-104-96/+65
| | | | | | In a sake of removing code duplication. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outbin.c: Fix misprinted alignment boundCyrill Gorcunov2010-02-111-1/+1
| | | | | | | Due to a misprint in commit 9b66d8e4c3030474a75e598f699eccc118a3d651 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Drop useless SEG_ALIGN_1Cyrill Gorcunov2010-02-111-1/+0
| | | | | | | No need for SEG_ALIGN_1 since we have switched to ALIGN helper. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Use ALIGN helperCyrill Gorcunov2010-02-116-25/+17
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* ELF: Explicitly point out SYM_GLOBAL, SYM_LOCAL bindingCyrill Gorcunov2010-01-033-5/+7
| | | | | | | | Instead of implicit declaration of global symbols obtained by STB_GLOBAL << 4, and local symbols by STB_LOCAL << 4 use ELF32_ST_MKBIND helpers. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* elf.h: Add ELFXX_ST_MKBIND and move ELFXX_ST_ helpersCyrill Gorcunov2010-01-031-8/+11
| | | | | | | | The profit of ELFXX_ST_MKBIND helper is that we will use it for SYM_GLOBAL explicitly pointing out from where this magic 0x10 came from. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelfX.c: Use definitions from stabs.hCyrill Gorcunov2010-01-033-12/+2
| | | | | | | | Also made Makefile.in to handle dependency. There are some makefiles in Mkfiles\ should be fixed as well. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Add common STABs definition into output/stabs.hCyrill Gorcunov2010-01-031-0/+145
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outelfX.c: Trivial cleanupCyrill Gorcunov2010-01-032-231/+231
| | | | | | | | | Some tab\space convertions together with trivial style nitfix. No change on binary level. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Allow symbols binding to undefined sectionCyrill Gorcunov2010-01-022-8/+4
| | | | | | | | | Commit 2ddcd03900d134772e98acf8cab17a12cc0c3f2a did bind symbols (in case of omitted SECTION directive) to .text section but break COMMON binding. Fix it. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: bind labels to text section by defaultCyrill Gorcunov2009-12-102-22/+24
| | | | | | | | | | | | In case if SECTION directive is omitted but the real code exist we form .text section by default and put compiled code here. In turn labels are not handled in a same manner. So lets bind them to text section by default as well. [ BR: 2835192 ] Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outrdf.c: remove obsolete fileH. Peter Anvin2009-11-301-569/+0
| | | | | | | The old RDF format has been unsupported for long time now. Remove it from the tree. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* outform.h: fix OF_NO_RDF2H. Peter Anvin2009-11-301-1/+1
| | | | | | OF_NO_RDF2 should turn off OF_RDF2, not OF_RDF Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* outmacho32: replace error() -> nasm_error()H. Peter Anvin2009-11-301-25/+23
| | | | | | | Somehow outmacho32.c escaped the global change of error variables to hard-coded nasm_error(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* outcoff: BuildExportTable -- tab/space fixCyrill Gorcunov2009-11-171-1/+1
| | | | | | | | | | | Due to previous commit an indent by tab (occasionally) brought in. Fix it as well. No change on binary level. We're not that far from NASM release so it's a bit unpleasant manner to push in such trivial change. But since it's the previous commit dependent -- I dare to push it. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outcoff: Do not fail on long export identifiersCyrill Gorcunov2009-11-171-22/+19
| | | | | | | If an export identifier is greater then 241 symbols we do fail due to buffer overflow. Fix it. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outelf32/64 - various cleanups in a sake of unificationCyrill Gorcunov2009-11-062-164/+156
| | | | | | | Make a small step forward elf32/64 unification procedure. Mostly style fixes. Nothing serious. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* dwarfX_output: dont check for "ln" twiceCyrill Gorcunov2009-11-062-49/+37
| | | | | | | And make dwarf64 version to be more familiar to 32bit version (preparation work for merge). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf64.c: simplify stabs64_cleanup, dwarf64_cleanupCyrill Gorcunov2009-11-061-26/+13
| | | | | | nasm_free is failsafe against NULL passed Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Merge elf header filesCyrill Gorcunov2009-11-066-364/+289
| | | | | | | | | Merge elfcommon.h, elf32.h, elf64.h into single elf.h -- we do support both elf32 and elf64 anyway. Let put them into common place. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf32-64: use string helpersCyrill Gorcunov2009-10-312-32/+12
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Remove outdated commentsCyrill Gorcunov2009-10-313-6/+6
| | | | | | | | | | | | | | | | 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>
* stdscan: switch to stdscan_get/set routinesCyrill Gorcunov2009-10-315-18/+16
| | | | | | | | | | 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>
* BR 2840300: fix macho symbol alignment bugKeith Kanios2009-10-162-6/+12
|
* elf,stabs: stabs32/64_generate -- append ending tokenCyrill Gorcunov2009-09-142-16/+19
| | | | | | | | | | | | | | This represent "end of compilation unit" token. Since gcc does (almost) the same lets be on the same side. Though to be precise gcc puts offset which points to the first byte right after the last instruction issued but in fact string index is analyzed only so we may safely write zero here (without relocation as well). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elfcommon.h: tab/space cleanupCyrill Gorcunov2009-09-061-111/+111
| | | | | | No change on binary level Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf32.c: code style simplificationCyrill Gorcunov2009-09-031-115/+108
| | | | | | | | | | | | | | | 1) nasm_free is safe against NULL passed so call it without test 2) dwarf32_output: check for debug_immcall early and get out of procedure if success. This allow us to move code blocks left removing indents. 3) dwarf32_findfile and dwarf32_findsect: no need for 'else' when 'if' target is plain return. Move code blocks left removing indents. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf32.c: tab-space cleanupCyrill Gorcunov2009-09-031-390/+367
| | | | | | Together with a small style nitpicking. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elf64.h: tab-space cleanupCyrill Gorcunov2009-09-031-51/+51
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/elf32.h: tab-space cleanupCyrill Gorcunov2009-09-031-13/+13
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output/outelf.h - tab-space cleanupCyrill Gorcunov2009-09-031-23/+23
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Use fputs instead of fprintf for plain stringsVictor van den Elzen2009-08-131-1/+1
| | | | LLVM's Clang warns about this. outieee.c had a real problem.
* Fix some format strings for nasm_errorVictor van den Elzen2009-08-114-16/+18
| | | | | Added a format attribute to nasm_error (only for GCC) and used the resulting warnings to fix some format strings.
* output/dwarf.h: update dwarf constantsCyrill Gorcunov2009-08-101-23/+530
| | | | | | | | | There is a hope we'll be supporting dwarf in full form in future. So I've encoded the standard constants (though binutils uses some additional codes). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* output: change null_debug_routine to null_debug_directiveH. Peter Anvin2009-08-094-5/+5
| | | | | | | This is the null implementation of the function debug_directive. For some reason it ended up getting mangled as "null_debug_routine". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* output/outbin.c -- use list helpersCyrill Gorcunov2009-08-011-15/+15
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outaout.c -- use list helpersCyrill Gorcunov2009-07-281-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>
* Merge branch 'nasm-2.07.xx'H. Peter Anvin2009-07-261-6/+6
|\
| * BR 2827397: fix invalid C in outcoff AddExports()H. Peter Anvin2009-07-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The construct: if (i == nsects) directive_sec = sects[coff_make_section (EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS)]; ... where coff_make_section() can change the global variable "sects" is undefined C, since there is no sequence point involved in the [] operator, and it is therefore fully permitted for the C compiler to read the sects variable first. Change this construct into two statements to enforce defined behavior; this also ends up with the code slightly simpler. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Drop the ofmt and errfunc arguments to label definition functionsH. Peter Anvin2009-07-188-57/+35
| | | | | | | | | | | | | | | | 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>
* | Remove function pointers in output, simplify error handlingH. Peter Anvin2009-07-1816-931/+799
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit 'nasm-2.07rc7' into new-preprocH. Peter Anvin2009-07-172-5/+5
|\ \ | |/
| * outcoff: fix invalid reference to ofmtH. Peter Anvin2009-07-161-1/+1
| | | | | | | | | | | | ofmt is a static in nasm.c (why?), not a global... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * outcoff: this is COFF, not binaryH. Peter Anvin2009-07-161-2/+2
| | | | | | | | | | | | Fix error message in outcoff to say COFF, not binary format... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * outform.h: update comments regarding macho32/macho64Keith Kanios2009-07-161-4/+4
| |
* | outobj: don't fclose() the outputH. Peter Anvin2009-07-141-1/+0
| | | | | | | | | | | | Missed fclose() in outobj when converting system to global fclose(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge branch 'master' into new-preprocH. Peter Anvin2009-07-132-1/+9
|\ \ | |/ | | | | | | Conflicts: .gitignore
| * ELF: add debug support for TY_YWORDH. Peter Anvin2009-07-132-0/+8
| | | | | | | | | | | | Add debug support for TY_YWORD (256 bits/32 bytes). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * elf32: debug32_typevalue - fix TY_OWORD sizeCyrill Gorcunov2009-07-131-1/+1
| | | | | | | | | | | | | | TY_OWORD is 8 * TY_WORD = 16 bytes length Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>