Commit graph

3120 commits

Author SHA1 Message Date
Cyrill Gorcunov
8ba28bc20b out: Elf32 -- Unify dwarf_ nums
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
d3ec4be590 out: Elf32, Elfx32, Elf64 -- more unifications
Some elf_ section numbers may be unused.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
784d10cb9a out: Elf32, Elfx32 -- Unify elf_sect_write, elf_section_header and add elf_sect_writeaddr
elf_sect_writeaddr is unused by now.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
6285d72efb out: Elf64, Elfx32 -- Style fix
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
a541094beb out: Elf32, Elfx32 -- Unify struct ELF_SECTDATA and @elf_foffs
Use int64_t.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
caa18da230 out: Elf32 -- Reuse TY_DEBUGSYMLIN
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
fbbe8fe9e2 out: Elf32 -- Unify struct symlininfo
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
583f505155 out: Elf64, Elf32, Elfx32 -- Style merge
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
2bb791956e out: Elf32, Elfx32, Elf64 -- Use ofmt->maxbits
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
e03bac6dbf out: Elf32 -- Add missing comment
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
Cyrill Gorcunov
a65e0481c2 out: Elfx32, Elf32 -- Unify elf_add_reloc
Make offset being int64_t and use 0 for Elf32.
Thus it gonna be the same for all Elfs.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-24 20:02:40 +03:00
H. Peter Anvin
6a83cb93b3 msvc.mak: change $(L) to $(A)
Change $(L) to $(A) for consistency with Makefile.in.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-04-21 18:10:10 -07:00
Knut St. Osmundsen
6fd298418b msvc.mak: Build fixes, updates and improvements.
* Added missing rules for creating a library out of LIBOBJ
   and using it when linking.
 * Updated the clean rule and PRELREQ list.
 * Always build with debug info as it ends up in external PDB files
   anyway and doesn't really impact binary size.
 * Added /RELEASE to the LDFLAGS so the linker checksums the headers and
   the binary can be signed.

Signed-off-by: Knut St. Osmundsen<bird-nasm@anduin.net>
Reviewed-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-04-21 09:13:32 +03:00
H. Peter Anvin
b156bc8c61 autoconf: rename configure.in to configure.ac
In accordance with current practice, rename configure.in to configure.ac.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-16 02:13:43 -07:00
H. Peter Anvin
89c1770e14 autoconf improvements: @SET_MAKE@, library extension
Minor autoconf corner cases.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-09 14:11:40 -08:00
H. Peter Anvin
65808c983a version: call this branch 2.13rc0
Call this branch 2.13rc0 for now, so the daily build release numbers
make more sense.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:31:04 -08:00
H. Peter Anvin
3ef4f00d5a lib: split library into stdlib and nasmlib; header handling fixes
Split lib/ into nasmlib/ (for nasm-specific functions) and stdlib/
(for replacements for C library functions which may be missing.)

Rename the ersatz inttypes.h to nasmint.h so we can use a simple test
in compiler.h instead of dealing with include path magic.

Remove tests in configure.in for ancient missing functions (which will
break the build anyway.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:20:02 -08:00
H. Peter Anvin
7ab5595347 Move fseeko/ftello/off_t handling from compiler.h into lib/file.c
This should only matter in this very specific file, so let's not make
*everything* depend on it...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:23:23 -08:00
H. Peter Anvin
2bc0ab38a2 Move version strings to a separate header
Move version strings to a separate header, instead of needing to
include nasm.h in places where it probably really doesn't belong.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:17:36 -08:00
H. Peter Anvin
cc147f79e4 Makefiles: use actual archive managers
There is no reason to not use an archive manager to build our
executables.  If there really are systems which don't have any kind of
archive manager, we can simply link all the objects.

This also drops any use of configure to detect library objects.
Instead just use HAVE_* and let the archive manager delete them.

A lot of additional functions could be declared library functions and
reorganized.

***FIX*** Mkfiles/*.mak have not yet been updated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:08:44 -08:00
H. Peter Anvin
bdae10bee2 Move file I/O related functions out of nasmlib.c
nasmlib.[ch] desperately need to be broken up into smaller chunks.

Break file I/O related functions out into file.c, so at least we can
avoid the problem with P_WAIT being defined in <io.h> on Windows but
is also used as a prefix constant in "nasm.h".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:22:13 -08:00
H. Peter Anvin
1917f45ec2 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	output/codeview.c
	output/outelf32.c
	output/outelf64.c
	output/outelfx32.c
	output/outform.c
	output/outform.h
	output/outieee.c
	output/outobj.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:08:53 -08:00
H. Peter Anvin
4bef68a84e msvc.mak: /Ox and /Oy are redundant with /O2
Per the MSVC++ docs, /Ox and /Oy are redundant with /O2, and the docs
recommend that they do not be used together.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 00:50:13 -08:00
H. Peter Anvin
134874848c nasmdoc.src: remove unimplemented %comment directive
%comment..%endcomment were never implemented, remove from the
documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:58:11 -08:00
H. Peter Anvin
8da30d0266 Makefiles: run "make alldeps"
Automatic update of dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:23:19 -08:00
H. Peter Anvin
283b3fb15a Defer debug format search until after command line parsing
Avoid funnies with ordering of debug format selection by deferring
debug format search until after command line processing.  Also permit
the -gformat syntax used by many C compilers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:20:00 -08:00
H. Peter Anvin
477ae4419c ofmt: get rid of the debuginfo parameter to ofmt->cleanup()
Get rid of the completely pointless "debuginfo" parameter to
ofmt->cleanup().  Most backends completely ignore it, and the two that
care (obj, ieee) can simply test dfmt instead.

Also, dfmt is never NULL, so any test for a NULL dfmt is bogus.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 22:55:43 -08:00
H. Peter Anvin
3ab8c5f9c6 NASM 2.12.01rc2 2016-03-07 22:18:29 -08:00
H. Peter Anvin
2a74d84d1c doc: document fix to the codeview output format
Document the label fix; although a global error, it was user-visible
in the Codeview backend so document it as such.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:17:10 -08:00
H. Peter Anvin
c941a35e58 outelf*: remove null debug functions
Instead of duplicating empty functions, use the corresponding
null_debug_* functions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 22:12:19 -08:00
H. Peter Anvin
bc42cbe363 codeview: remove hack for handling local labels
Now when labels are properly concatenated in common code, there is no
reason for the debugging backend to need to be aware of local
symbols.  We don't have to consider ..[^@] special symbols either, as
they are now filtered in labels.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Debugged-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:06:16 -08:00
H. Peter Anvin
3def9fcb59 outieee: no need to filter .. symbols in the debug format anymore
labels.c now filter ..[^@] special symbols from the debug backend,
so we don't have to open-code that everywhere.

In the actual output format, don't treat ..@ symbols as special.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:04:54 -08:00
H. Peter Anvin
5686a65fe9 outobj: no need to filter .. symbols in the debug format anymore
labels.c now filter ..[^@] special symbols from the debug backend, so
we don't have to open-code that everywhere.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:03:50 -08:00
H. Peter Anvin
fc0ff223b2 labels: emit the same label name to the output and debug backends!!
When a local label was seen, the debug backend would not receive the
full label name!  In order to both simplify the code and avoid this
kind of discrepancy again, make both the output and debug format calls
from a common static function.

However, none of the current debug format backends want to see NASM
special symbols (that start with .. but not ..@) so filter those from
the debug backend.

Finally, fix an incorrect comment in nasm.h: the debug format is
called *after* the output format.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:00:01 -08:00
Jim Kukunas
63c42f08f7 codeview: Don't treat labels starting with .. as local labels
For local labels, starting with '.', the label name is concatenated with
the previous non-local label to produce a label that can be accessed from
elsewhere. This is the name we want to generate debug info for.

Labels starting with ".." are special and shouldn't be concatenated.

Fix Bugzilla #3392342

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 19:36:41 -05:00
H. Peter Anvin
6224033738 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	.gitignore
	Makefile.in
	assemble.c
	configure.in
	eval.c
	float.c
	listing.c
	nasm.c
	nasmlib.c
	output/outform.h
	preproc.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 12:15:40 -08:00
H. Peter Anvin
172b840aa3 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.

From master branch commit 8ac25aa020

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-07 12:08:48 -08:00
H. Peter Anvin
335c4857ce 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.

From master branch checkin a7bc15dd0a

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-07 12:07:50 -08:00
H. Peter Anvin
0b7969e9a9 Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	compiler.h

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 11:50:38 -08:00
H. Peter Anvin
ccab91f826 Merge branch 'nasm-2.12.xx' of ssh://repo.or.cz/srv/git/nasm into nasm-2.12.xx 2016-03-07 11:37:16 -08:00
H. Peter Anvin
3c6300738c NASM 2.12.01rc1 2016-03-07 11:36:46 -08:00
Cyrill Gorcunov
6832acb6e3 doc: changes -- Don't forget to mention MONITORX and MWAITX
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-07 22:36:18 +03:00
Cyrill Gorcunov
f34cf39459 doc: changes -- Add CLZERO into the list
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-07 22:32:31 +03:00
H. Peter Anvin
cfd56ebb81 configure.in: disable -Wwrite-strings for now
At the moment, NASM is not clean with -Wwrite-strings due to passing
string constants to functions that under some conditions modify their
arguments.  This is problematic if nothing else for guaranteeing
correctness, but will take some work to remedy.  In the meantime,
disable -Wwrite-strings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-06 21:44:14 -08:00
Cyrill Gorcunov
b854be2772 insns.dat: Add CLZERO AMD instruction
https://sourceware.org/ml/binutils/2015-03/msg00078.html
http://bugzilla.nasm.us/show_bug.cgi?id=3392337

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 12:39:06 +03:00
Cyrill Gorcunov
f8b33e9191 nsis: Update icons
To match the main logo.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 11:59:03 +03:00
Cyrill Gorcunov
a19c22ec90 insns.dat: Add MONITORX/MWAITX AMD instructions
http://bugzilla.nasm.us/show_bug.cgi?id=3392336

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 01:36:49 +03:00
H. Peter Anvin
52e8646d17 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.

From master branch checkin 25da6eaf43,
except that -Wwrite-strings is omitted; making the code base
-Wwrite-strings clean is going to take additional work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 11:14:35 -08:00
H. Peter Anvin
409e2df1f2 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.

From master branch checkin ef63588eb4

Resolved Conflicts:
	configure.in

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 11:11:37 -08:00
H. Peter Anvin
d414e5f4cd test/cv8struc.asm: fix missing comma in test case
Fix a missing comma in the test case which make the test case bogus.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 10:59:13 -08:00