Commit graph

3257 commits

Author SHA1 Message Date
H. Peter Anvin
54469e27d0 outmacho: remove unused debugging functions
Remove unused debugging functions, and the _unused macro which turned
out to cause compilation problems on Linux/PowerPC.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 12:29:25 -08:00
H. Peter Anvin
83df633f07 Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	output/outelf32.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 11:00:52 -08:00
H. Peter Anvin
140c214ad0 md5: use "compiler.h", WORDS_LITTLEENDIAN and make functions static
Look for WORDS_LITTLEENDIAN instead of the gcc-specific __BYTE_ORDER.
Use our existing "compiler.h" portability layer.
Make functions which are not exported static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 10:54:24 -08:00
H. Peter Anvin
53f1559c06 Remove unnecessary C99-isms
In order to make it more likely to compile cleanly with "C90 plus long
long" style compilers, remove existing constructs (mostly commas at
the end of enums) that aren't compliant.

Ironically enough this was most likely an unintentional omission in
C90...

From master branch checkin 7214d18b40

Resolved Conflicts:
	output/outelf32.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 10:48:53 -08:00
H. Peter Anvin
7214d18b40 Remove unnecessary C99-isms
In order to make it more likely to compile cleanly with "C90 plus long
long" style compilers, make gcc warn for incompatible constructs.
Remove existing constructs (mostly commas at the end of enums) that
aren't compliant.

Ironically enough this was most likely an unintentional omission in
C90...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 22:43:51 -08:00
H. Peter Anvin
25da6eaf43 configure: enable additional code cleanliness warnings
We are supposed to handle compiling on a "C90 plus long long"
compiler, so make gcc (our most common development platform compiler)
complain when we don't.

However, suppress the complaints about the Microsoft definitions of
the <inttypes.h> strings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 22:20:10 -08:00
H. Peter Anvin
ef63588eb4 configure.in: if byte order is unknown or ill defined, don't define any
We can always operate correctly if neither WORDS_BIGENDIAN nor
WORDS_LITTLEENDIAN are defined, so if the word order is either
indeterminable or universal (the compiler generates both bigendian and
litteendian output from the same sources) then define neither.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 21:53:09 -08:00
H. Peter Anvin
b9c1ca7e8d Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	configure.in
	output/codeview.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 21:51:40 -08:00
H. Peter Anvin
8d9f591005 configure.in: add -fwrapv to gcc and compatible compilers
Add the -fwrapv to gcc and compatible C compilers, to enforce
deterministic 2's-complement behavior with regards to signed and
unsigned integer types.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-27 00:15:13 -08:00
Knut St. Osmundsen
52ae33a2cb Remove unnecessary C99 features which break Visual C++ 2010
Fixes Visual C++ 2010 breakage in recently added Codeview 8 code;
these are C99 features which were not necessary to introduce.

Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-26 23:44:10 -08:00
Knut St. Osmundsen
136c4bc73b doc: Remove --allow-64-bit leftover from help text.
Removes help text left behind when --allow-64-bit was turned into
default behavior + warning.

Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-26 23:44:07 -08:00
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