Commit Graph

3246 Commits

Author SHA1 Message Date
H. Peter Anvin
8aba13b51f Merge branch 'master' into elfmerge
Resolved Conflicts:
	output/outmacho.c

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-26 20:51:46 -08:00
H. Peter Anvin
b170a0aad5 NASM 2.12 2016-02-26 20:48:52 -08:00
H. Peter Anvin
a85060520a changes.src: document Win64 build
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-26 20:47:45 -08:00
H. Peter Anvin
96edc04a39 nasm.spec.in: document buildrequires properly
We need asciidoc, xmlto, ghostscript, texinfo in order to be able to
build the documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-23 02:01:17 -08:00
H. Peter Anvin
d015a9f39e NASM 2.12rc7 2016-02-23 00:26:26 -08:00
H. Peter Anvin
ed8eb56546 outmacho: correctly handle references between sections
Correctly generate references between sections.  The previous
version would work correctly as long as all relative references
came from the first section, which is usually __TEXT,__text and
so it usually worked.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-23 00:13:49 -08:00
H. Peter Anvin
b7511971dc nasm.spec: change release to 0 to avoid distro conflicts
Change the RPM release number to 0 so that distribution-produced RPMs
will take precedence in all cases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-22 01:18:33 -08:00
H. Peter Anvin
95b43676c3 Merge branch 'master' into elfmerge 2016-02-21 21:24:38 -08:00
H. Peter Anvin
ec82d7a92b configure: smarter way to handle fseeko() searching
Better handling of the replacement for fseeko() in its absence; also
look for the Windows _fseeki64() function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:20:45 -08:00
H. Peter Anvin
d4e001db67 NASM 2.12rc6 2016-02-21 21:07:35 -08:00
H. Peter Anvin
1ac2c2f55f misc/tag-release: default to --no-push
--no-push is by far the safer default.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:07:11 -08:00
H. Peter Anvin
021b10ca14 misc/tag-release: die on unknown options
If someone specifies an unknown option, they proabably typoed
something.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:05:16 -08:00
H. Peter Anvin
408b200684 NASM --rel=2.12rc6 2016-02-21 21:03:47 -08:00
H. Peter Anvin
a222d21138 outmacho: make a best effort at separating SIGNED from BRANCH relocs
For 64 bits, a BRANCH reloc is sometimes needed to fix up PIC
problems.  Make a best effort at generating BRANCH relocs just as
we make a best effort at distinguishing GOTLOAD from GOT.

This needs to be replaced with information from the assembler to
the backend.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-21 20:56:19 -08:00
H. Peter Anvin
73b22f5c1c Windows portability fixes
Windows needs strsep() and defines a P_WAIT constant that we
need to undefine.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 14:40:37 -08:00
H. Peter Anvin
e65e81b172 nasmlib: allow writing of sparse files
On systems that support it, allow the writing of sparse files.
This can be useful for some file formats (like binary, or ELF if the
alignments are very large) that can contain large amounts of zeroes.

This is not inherently portable code, so condition it on certain known
systems.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 14:24:40 -08:00
H. Peter Anvin
28ec7d1ddf Merge branch 'master' into elfmerge
Resolved Conflicts:
	configure.in

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 13:57:03 -08:00
H. Peter Anvin
114ba75f7b test/Makefile: add a rule for nasm itself
If NASM needs to be rebuilt, build it in the proper directory.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 13:06:04 -08:00
H. Peter Anvin
44a609b203 configure.in: add --enable-werror option
Add an option to compile with -Werror, useful for development.

Change --with-ccache to --enable-ccache to match guidelines.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 12:09:31 -08:00
H. Peter Anvin
b423c02ad2 Platform compatibility improvements
Windows: indicate that we support multibyte character sets in file
names.

Unix: support gigantic input and output files.  Might be useful
especially in the presence of the INCBIN directive.

Signed-off-by: H. Peter Anvin <hpa@linux.kernel.org>
2016-02-18 11:57:53 -08:00
H. Peter Anvin
dea76e7779 NASM 2.12rc5 2016-02-18 11:50:42 -08:00
H. Peter Anvin
277308f1f3 doc: update documentation for a version 2.12 release
Add documentation updates for version 2.12.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 11:49:33 -08:00
H. Peter Anvin
5f0e601f98 doc/rdsrc.pl: escape braces in regular expression to support newer Perl
Newer versions of Perl require literal braces in regular expressions
to be escaped.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 11:48:12 -08:00
H. Peter Anvin
4afa730c03 outmacho: default section flags should depend on section name only
The __TEXT segment in particular contains both code and data.  The
most consistent thing is to look only at the section name, and have
the same behavior across sections.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 10:55:00 -08:00
H. Peter Anvin
2530a10b56 Make a few more data items static and const
A few more data items that should be static and const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:28:15 -08:00
H. Peter Anvin
a4973cf997 A few more debugging format arrays to mark const
Making more debugging format array const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:25:26 -08:00
H. Peter Anvin
2be1050f93 codeview: make struct dfmt df_cv8 const
This one was not declared const; fix that.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:22:50 -08:00
H. Peter Anvin
e746971582 Make struct preproc_ops const
Make the preproc function pointer arrays const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:20:59 -08:00
H. Peter Anvin
7e3b12d6da More constification, mostly of struct dfmt
Make struct dfmt and the struct dfmt arrays const across the board,
and make them static whereever possible.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:16:36 -08:00
H. Peter Anvin
f0ea3d7c2b Merge branch 'master' into elfmerge 2016-02-18 02:00:16 -08:00
H. Peter Anvin
9e122a6603 realpath: if we can't get the full path, return the known portion
Right now, we don't check the return value from nasm_realpath();
furthermore doing so and failing is probably not the ideal behavior.

If we can't get the full canonical path, then punt and just return
nasm_strdup() of the known path name; better than nothing.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:53:47 -08:00
H. Peter Anvin
501b35f234 ofmt pointer in struct ofmt_alias should be const
One more place where an ofmt pointer exists, and it should be
const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:30:33 -08:00
H. Peter Anvin
cd7893d02d Remove additional function pointers that never change
Remove additional cached function pointers which point to static
variables which are never actually changed.  Just refer to the global
variable instead.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:25:46 -08:00
H. Peter Anvin
36034ec652 eval: complete globalization of output format
Complete the globalization of the output format definitions;
one more place where a local copy was cached for no good reason.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:18:50 -08:00
H. Peter Anvin
8ac25aa020 Change nasmlist/ListGen to lfmt/struct lfmt
For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:16:18 -08:00
H. Peter Anvin
15a6aa7ade Makefile: remove explicit mention of lib/strlcpy.c
Don't inclure lib/strlcpy.c unconditionally, that is what
LIBOBJS is for.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:07:34 -08:00
H. Peter Anvin
d338b376df Portability improvements and autoconf modernization
Improve the portability of the code and modernize our use of
autoconf.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 01:03:51 -08:00
H. Peter Anvin
9e1d691e82 gitignore: properly ignore generated man pages
Fix the .gitignore files so man pages are correctly ignored.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 22:06:20 -08:00
H. Peter Anvin
f9be8c3179 outelf64: fix comment
Fix comment that refer to R_386_* to avoid hiding similarities
versus outelfx32.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 22:01:33 -08:00
H. Peter Anvin
e3e2f1bbc2 outelf64: symtabsection is defined but never set, change to sec_symtab
The variable symtabsection is defined but it is never actually set and
so was always zero.  For both the 32-bit output format this is
sec_symtab defined in elf.h.

If this is not correct for the 64-bit format, then we should define
sec_symtab as a variable instead of having a gratuitious format
difference.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 21:03:13 -08:00
H. Peter Anvin
338656c1de output: make all instances of struct ofmt readonly
With current_dfmt gone, we can make all instances of struct ofmt
const (read-only).

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 20:59:22 -08:00
H. Peter Anvin
a7bc15dd0a Remove ofmt->current_dfmt indirection
Move ofmt->current_dfmt into a separate global variable.  This
should allow us to make ofmt readonly and removes some additional
gratuitious differences between backends.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 20:55:08 -08:00
H. Peter Anvin
4a8d10c1a0 Output preprocessor warnings to the listing file
Most preprocessor warnings are ERR_PASS1, but we want to see them in
the listing file too.  If we make it to the code-generation pass,
ignore ERR_PASS* for the purpose of emitting warnings to the list
file.

While we are at it, allow ERR_DEBUG to specify ERR_PASS* too.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 20:47:01 -08:00
H. Peter Anvin
b2bfb580df Merge branch 'master' into elfmerge 2016-02-17 20:33:40 -08:00
H. Peter Anvin
11b8817e8a listing: remove unused variable
The previous commit contained an unused variable, remove it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 20:33:02 -08:00
H. Peter Anvin
130736c0cf Get rid of a bunch of unnecessary indirections
We pass around a whole bunch of function pointers in arguments,
which then just get stashed in static variables.  Clean this mess
up and in particular handle the error management in the preprocessor
using nasm_set_verror() which already exists.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 20:27:41 -08:00
H. Peter Anvin
bbbf508394 nasmlib: add nasm_fatal() like nasm_panic()
Just like nasm_panic(), nasm_fatal() tells the compiler that
we can never return from this call.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 16:10:41 -08:00
H. Peter Anvin
0e8fcf1b6c outelf*: remove type prefix from debugging functions
The debugging functions currently have unique prefix, which is good
for debuggability but hides real code differences.  Convert them to
have the same name across files.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 15:51:08 -08:00
H. Peter Anvin
d2ea49b326 listing: change the line numbers to match the source code
Instead of completely useless sequential line numbers, emit line
numbers corresponding to the line numbers in the source code.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 15:38:51 -08:00
H. Peter Anvin
86e31129f7 outelf32: remove unused header file
Remove unused instance of <limits.h>.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-17 14:44:19 -08:00