summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bytesex: more endianness detection hackselfH. Peter Anvin2017-04-252-11/+54
| | | | | | | A few more tricks for sussing out endinanness, and add an ultimate fallback option. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* endian.h: can be called sys/endian.h or machine/endian.hH. Peter Anvin2017-04-242-1/+6
| | | | | | | On some platforms, endian.h may exist but be called sys/endian.h or machine/endian.h. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Clean up byteorder functionsH. Peter Anvin2017-04-248-958/+1144
| | | | | | | Move byte order handling functions to their own header file, and try to be more specific about how exactly to handle things. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* hashtbl, strtbl: add hash_free_all(), split strtbl_find()H. Peter Anvin2017-04-245-26/+52
| | | | | | | | | | | | Add hash_free_all() to factor common code of iterating over all members of a hash to free them with a single nasm_free(). Split strtbl_find() into strtbl_find() and strtbl_add(). It is very unlikely that the same call site will want to have both of these functionalities, and in the end the code for the two functions are surprisingly different. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* output: generic string table implementationH. Peter Anvin2017-04-245-0/+185
| | | | | | | | | | | | Several output formats use "string tables", which is a collection of null-terminated (C) strings which are referenced by a byte offset into the string table. A single string can be referenced an arbitrary number of times. As this is quite simple to implement with a hash table, we do exactly that. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'master' into elfH. Peter Anvin2017-04-2321-138/+381
|\
| * outmacho: clean up list walks, use nasm_basename/nasm_dirnameH. Peter Anvin2017-04-231-28/+22
| | | | | | | | | | | | | | | | | | | | | | Use the new nasm_basename() and nasm_dirname() functions to split a pathname. Use nasm_wcstring() to write a C string to an SAA. Use list_for_each() to walk linked lists. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * saa, raa: saa_init() and raa_init() will never return NULLH. Peter Anvin2017-04-232-3/+3
| | | | | | | | | | | | | | Like other NASM allocation functions, these will abort rather than ever return NULL. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * SAA: add saa_wcstring()H. Peter Anvin2017-04-232-1/+15
| | | | | | | | | | | | | | Add saa_wcstring() to write a C string (a string including final NUL) to an SAA, and return the number of bytes written. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasmlib: fix MacOS classic catsep definitionH. Peter Anvin2017-04-231-2/+6
| | | | | | | | | | | | | | | | Correct the definition for MacOS classic "catsep" in nasm_catfile(). Also put in a stern comment that this function doesn't handle filenames with path components. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasmlib: add function to splice pathnamesH. Peter Anvin2017-04-232-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a function to splice a pathname consisting of a directory and a filename. It is worth noting that this function is limited to that particular use case: in particular, it does NOT currently support concatenating a filename which itself contains directory components to a non-null directory. Combining directory names is extremely system-dependent and probably needs more than just parameterized code in many cases, for example, on VMS combining "foo:[bar]" with "[baz]quux" should produce "foo:[bar.baz]quux" whereas combining "foo:[bar]" and baz:quux" is an outright error. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasmlib: add path-splitting functionsH. Peter Anvin2017-04-234-25/+172
| | | | | | | | | | | | | | | | | | Some debugging formats may need to be able to split paths into directory name and filename, at least. This is kind of iffy, at least across platforms, but that isn't really expected to be an issue in practice... we hope. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * configure.ac: fix --enable-sectionsH. Peter Anvin2017-04-231-2/+3
| | | | | | | | | | | | | | | | The --enable-sections option isn't too useful without -Wl,--gc-sections. It's unclear if gcc will provide that option by default. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * aclocal.m4: fix underquoted stringsH. Peter Anvin2017-04-231-18/+16
| | | | | | | | | | | | Some strings were underquoted, causing failures. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasm.spec: LTO breaks debug info, fall back to --enable-sectionsH. Peter Anvin2017-04-231-1/+1
| | | | | | | | | | | | | | | | --enable-lto seems to completely break RPM debug information, so fall back on --enable-sections, which at least allows the linker to do better dead code removal. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasm.spec: more cleanups, doc is noarchH. Peter Anvin2017-04-231-12/+10
| | | | | | | | | | | | The doc file is noarch, and do some other cleanups. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasm.spec: s/Build-Requires/BuildRequires/H. Peter Anvin2017-04-231-1/+1
| | | | | | | | | | | | Fix incorrectly spelled tag. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasm.spec: use a sed file to insert perl dependenciesH. Peter Anvin2017-04-233-2/+8
| | | | | | | | | | | | There are just too many ways that an inline sed script can screw up. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * nasm.spec: sync with Fedora spec file, auto-generate Perl dependsH. Peter Anvin2017-04-232-29/+30
| | | | | | | | | | | | | | | | Sync up with how the Fedora spec file has evolved. Auto-generate the Perl build dependencies. Add --enable-lto: it makes especally the rdoff files much smaller. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * labels, outelf: remove casts for allocationsH. Peter Anvin2017-04-232-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove casts from allocations. This is simply Not How To Do Things: every cast carries a potential risk of being a toxic type misuse (e.g. pointer as integer) and so any unnecessary cast is actively harmful. Note that a lot of allocations here are completely unnecessary: the core code now guarantees that all filenames are permanently allocated for the duration of the assembly, and so should be turned into const char * without any further allocation. Any remaining malloc+strcpy should be turned into nasm_strdup(), and nasm_new[n]() used whereever possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * macho: add file path to the dwarf debugging outputChang S. Bae2017-04-231-6/+25
| | | | | | | | | | | | | | | | Apple's linker requires file path along with file name to produce debug notes. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * NASM 2.13rc21nasm-2.13rc21H. Peter Anvin2017-04-201-1/+1
| |
| * doc, html: switch to a columnar layout for a very wide windowH. Peter Anvin2017-04-202-4/+20
| | | | | | | | | | | | | | | | | | | | If we open in a very wide window, split the text into columns so it can actually be conveniently read. Also, change the body margin to 8px, as that seems to be the more common browser default. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * Fix ModR/M.mod for EVEX instructionsHenrik Gramner2017-04-201-7/+5
| | | | | | | | | | | | | | | | | | It was incorrectly set to 01b in some cases when where it should be 10b. Fixes BR 3392402. Signed-off-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * doc: formatting fixes to the warnings documentationH. Peter Anvin2017-04-201-21/+28
| | | | | | | | | | | | | | Formatting and language consistency cleanups to the sections about disabling and enabling warning classes. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Merge branch 'master' of ssh://repo.or.cz/nasmH. Peter Anvin2017-04-2032-666/+943
| |\
| * | doc: update links to ABI documentsH. Peter Anvin2017-04-201-4/+5
| | | | | | | | | | | | | | | | | | We have a separate namespace for ABI documents. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | Run make alldepsH. Peter Anvin2017-04-183-22/+26
| | |
* | | Merge branch 'master' into elfH. Peter Anvin2017-04-18141-13399/+4878
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | Resolved Conflicts: aclocal.m4 output/outelf.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | tools/release: make doesn't like MAKE in the environment, so call it makejH. Peter Anvin2017-04-181-7/+7
| | | | | | | | | | | | | | | | | | | | | make really doesn't like something called MAKE in the environment, so call it makej like buildall.sh on the server. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | tools/release: don't double-quote $MAKEH. Peter Anvin2017-04-181-5/+5
| | | | | | | | | | | | | | | | | | We actually want it broken down into words... (e.g. make -jX). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | tools/release: allow invoking make as a parallel buildH. Peter Anvin2017-04-181-5/+8
| | | | | | | | | | | | | | | | | | If the variable MAKE is set in the environment, use it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | nasmdoc.pdf: always begin a chapter on an odd pageH. Peter Anvin2017-04-171-2/+4
| | | | | | | | | | | | | | | | | | | | | If we want to print the document, we really want each chapter to start on an odd (right-facing) page; otherwise it gets rather strange. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | rdoff.c: one more unsafe use of fread()H. Peter Anvin2017-04-171-1/+5
| | | | | | | | | | | | | | | | | | Use the same error pattern as the rest of the calls in this function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | rdflib.c: fix(?) one more unsafe use of fread()H. Peter Anvin2017-04-171-1/+3
| | | | | | | | | | | | | | | | | | | | | It isn't 100% clear what is the right thing to do in this particular case, so this is my best attempt... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | NASM 2.13rc20nasm-2.13rc20H. Peter Anvin2017-04-171-1/+1
| | |
| * | rdoff: add back rdfutils.h missing from previous checkinH. Peter Anvin2017-04-171-0/+165
| | | | | | | | | | | | | | | | | | | | | Checkin 8dc965347ddf9caabacc4ca0441efe3a4ec32af8 was missing this file, causing obvious failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | changes.src: document DWARF support for Mach-OH. Peter Anvin2017-04-171-2/+5
| | | | | | | | | | | | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | NASM 2.13rc19nasm-2.13rc19H. Peter Anvin2017-04-171-1/+1
| | |
| * | Fix errors uncovered by clang warningsChang S. Bae2017-04-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 1. One incorrect variable use(!) 2. One possibly uninitialized variable. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | outmacho: dwarf debug (4/4)Chang S. Bae2017-04-171-3/+116
| | | | | | | | | | | | | | | | | | | | | line information added in dwarf output Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | outmacho: dwarf debug (3/4)Chang S. Bae2017-04-171-1/+171
| | | | | | | | | | | | | | | | | | | | | debug information sections now generated. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | outmacho: dwarf debug (2/4)Chang S. Bae2017-04-171-3/+141
| | | | | | | | | | | | | | | | | | | | | | | | file and section list added for managing debug line info also, now macho parts get to call debug interfaces Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | outmacho: dwarf debug (1/4)Chang S. Bae2017-04-171-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skeletion interfaces MachO Dwarf is basically porting of ELF's DWARF implementations and it includes debug line information and some debug meta data Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | outmacho: align filesize together with vmsizeChang S. Bae2017-04-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the Mach-O spec this should not be necessary for .o files, but it seems that we get problems with extracted dsyms if this is not done, so do this for now -- we might be able to troubleshoot this later. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | Merge branch 'master' of ssh://repo.or.cz/nasmH. Peter Anvin2017-04-175-14/+35
| |\ \ | | |/
| | * doc: add the version number to the HTML outputH. Peter Anvin2017-04-172-1/+14
| | | | | | | | | | | | | | | | | | Add the subtitle (e.g. "version XXXX...") to the HTML output. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * doc/genps: make sure we pick up nasmlogo.eps when building cross-dirH. Peter Anvin2017-04-172-5/+12
| | | | | | | | | | | | | | | | | | | | | When building in a different directory, we still want to make sure we pick up nasmlogo.eps. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * doc: add a local.css specifically to be overridden locallyH. Peter Anvin2017-04-163-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a file local.css which is referenced *after* nasmdoc.css, thus overriding the latter. This file intentionally has no actual content, which means it can be overridden locally for any desired content, e.g. indexing into web fonts or overriding any of the style. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | rdoff: use nasm-provided safe memory allocation and I/OH. Peter Anvin2017-04-1725-648/+268
| |/ | | | | | | | | | | | | | | | | We already have abort-on-error memory allocation and I/O operations in nasmlib, so use them for rdoff as well. Delete long-since-obsolete rdoff Mkfiles directory. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>