summaryrefslogtreecommitdiff
path: root/output
Commit message (Collapse)AuthorAgeFilesLines
* coff: Handle massive relocationsCyrill Gorcunov2010-11-202-3/+44
| | | | | | | | | | | | | | The backport of 4db724fdd76e3a6cd0f5124ef86de976c495d666 359b63f8976375f071edc33092daea57efa768fb 01102ee8e6a967830bcd6f0134efe8976f473121 2672af737954fb17ec0ebf17e787219a504c4400 so coff output target to be able to handle massive relocations. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* BR3079550: NASM crash on run-time for OMF output formatCyrill Gorcunov2010-10-272-4/+4
| | | | | | | | | We could have accessed malloc'ed data on external symbols in obj and ieee output formats. Fix it by using nasm_zalloc. Reported-by: Jiri Malak Patch-by: Jiri Malak Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* elf: Move stabs symbol table format into outelf.hCyrill Gorcunov2010-07-303-16/+9
| | | | | | Get rid of code duplication Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outbin: Cleanup bin_cleanupCyrill Gorcunov2010-07-061-5/+7
| | | | | | No need for 'q' variable. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outbin: Simplify reverse address computingCyrill Gorcunov2010-07-061-2/+2
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* BR3025702: outbin -- Fix byte orderingCyrill Gorcunov2010-07-061-2/+2
| | | | | | | In commit 55ae12052cd1 we occasionally broke byte ordering. Fix it. Note that current stable version 2.08.01 is not affected by this bug. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Rename filenames to 8.3 formatH. Peter Anvin2010-06-152-1/+1
| | | | | | | Apparently some people still care about compiling native on MS-DOS, and we don't have a significant number of files which need adjustment. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* outobj: handle compilers without 64-bit switch() supportH. Peter Anvin2010-06-071-1/+5
| | | | | | | OpenWatcom, in particular, doesn't handle switch() statements with 64-bit expressions, sigh. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* outelf32: handle compilers without 64-bit switch() supportH. Peter Anvin2010-06-071-14/+22
| | | | | | | OpenWatcom, in particular, doesn't handle switch() statements with 64-bit expressions, sigh. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* nasmlib: Rename elements() macro to ARRAY_SIZECyrill Gorcunov2010-06-031-2/+2
| | | | | | | | | | ARRAY_SIZE is a well known name pointing out that we're dealing with array in macro argument. Also to be on a safe side prefix_name helper should check the index been in bounds more precisely. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outobj: update error messageH. Peter Anvin2010-05-061-2/+2
| | | | | | | The possible sizes we can encounter are 1, 2, 4, 8... make sure we get a proper error message. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* outobj: properly error on unsupported relocationsH. Peter Anvin2010-05-061-12/+38
| | | | | | Error out on any relocations not supported by the backend. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* outelf64: update copyright dateH. Peter Anvin2010-05-061-1/+1
| | | | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* ELF support for 8-bit relocationsH. Peter Anvin2010-05-062-35/+92
| | | | | | Support 8-bit relocations (OUT_ADDRESS and OUT_REL1ADR) in ELF. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Add support for one-byte relocationsH. Peter Anvin2010-05-063-30/+34
| | | | | | | | | Add OUT_REL1ADR (one-byte relative address) and support for OUT_ADDRESs with size == 1. Add support for it in outbin and outdbg. *It still needs to be added to other backends*, both the OUT_REL*ADR and OUT_ADDRESS codepaths need to be handled. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* MachO: Fix misprinted macho_sectalignCyrill Gorcunov2010-04-282-4/+4
| | | | | | | macho_sectalign was occasionally misprinted with macho_setcalign, fix it. No change on functionality. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* obj: Implement sectalign helperCyrill Gorcunov2010-04-251-1/+44
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* macho: Implement sectalign handlerCyrill Gorcunov2010-04-252-2/+36
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* ieee: Fix section index match in sectalign handlerCyrill Gorcunov2010-04-251-1/+1
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outieee: Implement sectalign handlerCyrill Gorcunov2010-04-251-1/+23
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outbin: Drop current_section variableCyrill Gorcunov2010-04-221-7/+3
| | | | | | | There is no need for it anymore. Reported-by: "H. Peter Anvin" <hpa@linux.intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* outbin: Prune ancient format_mode variableCyrill Gorcunov2010-04-221-42/+22
| | | | | | | | format_mode is always set to 1 so there is no need to keep this variable. "Old chicken bit" (c) :) Reported-by: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* bin: Implement sectalign handlerCyrill Gorcunov2010-04-221-3/+24
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Use IMAGE_SCN_ALIGN_MASK macroCyrill Gorcunov2010-04-221-2/+2
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Allow alignment greater then 64 bytes on winCyrill Gorcunov2010-04-221-1/+5
| | | | | | | On win32/64 we have no 64 bytes limit so hit it on "coff" target only. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Fix section alignment computationCyrill Gorcunov2010-04-221-8/+7
| | | | | | | | | | | | Section alignment is broken due to not being direct "align -> power of two set" mapping but rather including second addition operation. Fix it by introducing coff_sectalign_flags helper. This also allow us to use this helper for getting rid of open coded computation as well. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Use predefined macros instead of numbers and style fixCyrill Gorcunov2010-04-221-145/+160
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* pecoff.h: Complete headerCyrill Gorcunov2010-04-221-2/+269
| | | | | | | | Put in all constants pecoff v8 states. Most probably we will never need most of them but lets have them here for completeness. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Remove open-coded ilog2() implementationsH. Peter Anvin2010-04-213-67/+3
| | | | | | When we need integer log2, use the new library routine. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* coff: Use predefined macro in common section flagsCyrill Gorcunov2010-04-211-6/+49
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Use predefined macro and eliminate open coded constantsCyrill Gorcunov2010-04-211-16/+9
| | | | | | Not all are covered but process initiated. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* pecoff.h: Add more constantsCyrill Gorcunov2010-04-211-0/+90
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* pecoff: Update machine typesCyrill Gorcunov2010-04-211-19/+27
| | | | | | Update up to pecoff v8 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* output: Introduce pecoff.hCyrill Gorcunov2010-04-212-0/+111
| | | | | | Better to have common constants grouped. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* coff: Implement sectalign handlerCyrill Gorcunov2010-04-211-3/+31
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Rename SEGALIGN to SECTALIGNCyrill Gorcunov2010-04-2114-24/+24
| | | | | | | "sectalign" is preferred over "segalign" since it operates over section attributes. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf64: Implement segalign handlerCyrill Gorcunov2010-04-211-1/+19
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf-32: Implement segalign handlingCyrill Gorcunov2010-04-211-1/+19
| | | | | | Via elf_segalign helper Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* ofmt: Implement null_segalign stubsCyrill Gorcunov2010-04-2114-0/+30
| | | | | | Set stubs for all targets Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Rename SEG_ALIGN to SEC_FILEALIGNCyrill Gorcunov2010-04-213-7/+8
| | | | | | It's Elf specifics. To not mess with segment alignment. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Add "win" alias for "win32" output formatCyrill Gorcunov2010-04-211-0/+7
| | | | | | | | We already have "elf" and "macho" aliases for respective 32 bit output formats. Make the same for "win32" in a sake of consistency. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: switch section_attrib to a new nasm_opt_val interfaceCyrill Gorcunov2010-04-111-16/+17
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Use SHA_ANY constant instead of open coded numberCyrill Gorcunov2010-04-112-2/+5
| | | | | | | SHA_ANY is not part of Elf specification but rather our own symbolic definition for convenience. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* ofmt: Introduce output format aliasesCyrill Gorcunov2010-04-104-57/+54
| | | | | | | | This allow us to keep compatibility layer without needing the separated struct ofmt for this and elf_init_hack routine. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Some unification snippets for 32/64 bit versionsCyrill Gorcunov2010-04-102-11/+13
| | | | | | Nothing serious, comments and style movements. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Elf: Merge WRITE_STAB to outelf.hCyrill Gorcunov2010-04-103-18/+9
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* 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>