Commit Graph

626 Commits

Author SHA1 Message Date
H. Peter Anvin
18e87ce7bd doc: we really need a Fontmap file
It turns out that we need a Fontmap file after all, *and* -I. to make
gs find it. Inconsistent results came from stray Fontmap files from
previous debug attempts.

Now generate both fontpath and Fontmap, and hopefully at least one of
them should work. We might, in fact, need both, one for gs to know
where the files are and one for gs to know it is allowed to read them.

The core problem seems to be that gs will find OTF fonts by its normal
discovery mechanisms, but for some reason don't seem to use them
unless it can find them in a Fontmap, Font directory, of CIDFont
directory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-10-04 13:09:30 -07:00
H. Peter Anvin
f8a15a8ea3 Correct __ALIGN_ -> __?ALIGN_
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-08-27 17:21:28 -07:00
H. Peter Anvin
d235408c65 preproc: standard macros now C-safe, %aliases off, fix %? recursion
Enough users expect the namespace starting with underscore to be safe
for symbols. Change our private namespace from __foo__ to
__?foo?__. Use %defalias to provide backwards compatiblity (by using
%defalias instead of %define, we handle the case properly where the
user changes the value.)

Add a preprocessor directive:

%aliases off

... to disable all smacro aliases and thereby making the namespace
clean.

Finally, fix infinite recursion when seeing %? or %?? due to
paste_tokens(). If we don't paste anything, the expansion is done.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-08-27 16:42:41 -07:00
H. Peter Anvin (Intel)
3d10569bbe doc: actually build and propagate fontpath file
The machinery was built in, but the option wasn't invoked from the
Makefile.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-08-06 23:07:44 -07:00
H. Peter Anvin
186f9a0514 doc: fix yet another set of Ghostscript font problems
Seems like Ghostscript has managed to break fontconfig support again,
at least in Fedora 30. Help Ghostscript along by giving it an explicit
font path.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-06-06 20:51:10 -07:00
H. Peter Anvin
e678020878 outelf: get rid of long-since-obsolete gnu extensions warning
R_386_[PC]{8,16} have been part of the official ELF32 spec for a very
long time now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-06-06 18:33:42 -07:00
H. Peter Anvin (Intel)
9bb55bd127 Merge branch 'evalmacro'
Resolved Conflicts:
	asm/preproc.c
	output/elf.h
	output/outelf.c
	output/outelf.h
	version

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-04-24 11:14:43 -07:00
H. Peter Anvin
a8604c83fa ELF: the .note section should be 4-byte aligned
The ELF .note section contains of 4-byte words and should be aligned
accordingly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 02:36:15 -08:00
H. Peter Anvin
dc5939b496 Handle more ELF section types
note, preinit_array, init_array, and fini_array are ELF section types
that can matter to the assembly programmer.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 01:44:55 -08:00
H. Peter Anvin
b2004511dd ELF: handle more than 32,633 sections
Dead code elimination in ELF uses separate ELF sections for every
functions or data items that may be garbage collected. This can end up
being more than 32,633 sections which, when the ELF internal and
relocation sections are added in, can exceed the legacy ELF maximum of
65,279 sections.

Newer versions of the ELF specification has added support for much
larger number of sections by putting a place holder value (usually
SHN_XINDEX == 0xffff, but 0 in some cases) into fields where the
section index is a 16-bit value, and storing the full value in a
diffent place: the program header uses entries in section header 0,
the symbol table uses an auxiliary segment with the additional
indicies; the section header did not need it as the sh_link field is
already 32 (or 64) bits long.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2019-02-26 00:02:35 -08:00
H. Peter Anvin (Intel)
1df7263ae9 warnings: add [warning push] and [warning pop]
Add [warning push] and [warning pop] directives.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-01-11 13:13:03 -08:00
H. Peter Anvin
88477764f3 ELF: add support for the ELF "merge" attribute
Add support for the "merge" attribute in ELF, along with the
associated "strings" and size specifier attributes.

Fix a few places where we used "int", but a larger type really ought
to have been used.

Be a bit more lax about respecifying attributes. For example, align=
can be respecified; the highest resulting value is used.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-12-30 07:54:48 -08:00
H. Peter Anvin
bd2803964e Merge tag 'nasm-2.14.03rc1'
NASM 2.14.03rc1

Resolved Conflicts:
	asm/labels.c
	include/error.h

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-12-27 11:37:22 -08:00
H. Peter Anvin
8eedebc1ed changes.src: document suppressed messages
Document the suppression of error messages from "label changed".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-12-27 11:32:42 -08:00
H. Peter Anvin
2f0f5b0189 Merge tag 'nasm-2.14.02'
NASM 2.14.02

Resolved Conflicts:
	asm/listing.c
2018-12-26 07:15:28 -08:00
H. Peter Anvin
6b8765fb0c changes.src: document fix for listing module crash
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-12-26 04:42:01 -08:00
H. Peter Anvin (Intel)
727c85263f Merge tag 'nasm-2.14.01rc5'
NASM 2.14.01rc5

Resolved Conflicts:
	asm/labels.c
	asm/nasm.c
	version
2018-12-14 13:24:19 -08:00
H. Peter Anvin (Intel)
1e2358b17f Document the -Ov option, minor fix for gcc -Og
The -Ov option is useful but was undocumented.

Add an initialization to keep gcc from complaining at optimization
level -Og.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-12-14 13:02:39 -08:00
H. Peter Anvin (Intel)
800c168688 --no-line: new option to ignore %line directives
For debugging preprocessed code, it is useful to be able to ignore
%line directives rather than having to filter them out externally.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-12-14 12:22:11 -08:00
H. Peter Anvin (Intel)
723ab481a6 warnings: define warning classes at point of use
It is extremely desirable to allow the user fine-grained control of
warnings, but this has been complicated by the fact that a warning
class has had to be defined in no less than three places (error.h,
error.c, nasmdoc.src) before it can be used in source code. Instead,
use a script to define these via magic comments at the point of use.

This hopefully will encourage creating new classes as needed.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-12-13 21:53:31 -08:00
H. Peter Anvin
5e1d1a8edd changes.src: update list of changes since 2.14 2018-12-10 13:36:58 -08:00
H. Peter Anvin
3475462ee8 nasm: fix the combination -E -MD, handle -MD without a filename
-E -MD should work and output a dependency file.
-MD can be used without a filename; there is a default filename or
-\c{-MF} can be used.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-28 12:40:58 -08:00
H. Peter Anvin
c06c87dbb5 changes.src: fp bug: there are probably other corner cases
There are probably other corner cases where we could at the very
least produce an incorrectly rounded result, so be a bit more cagey
about the description of the bug.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-28 09:50:14 -08:00
H. Peter Anvin
d7498067ca BR 3392368: actually fix the documentation; add test case
Add a mimimal test case for this bug; correct the documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-26 21:38:14 -08:00
H. Peter Anvin
8fa279954c Correctly document the BR 3392368 fix, add test case
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-26 14:59:35 -08:00
H. Peter Anvin
88959910d8 changes.src: document more fixes
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-26 14:38:32 -08:00
H. Peter Anvin
bf6230baa9 preproc: command-line preproc directive after system-generated
BR 3392527: make sure that all command-line specified preprocessing
directives are processed after the system-generated ones. In
particular __OUTPUT_FORMAT__ was generated after command line pass 2,
at which point -p, -d, -u, --pragma and --before had already been
processed.

There is no reason to split up defined_macros() anymore: the right
place to execute it is simply between command line passes 1 and 2. We
can also set dfmt here, which lets us define a __DEBUG_FORMAT__ macro
as well.

Finally move some options that have no business being processed in
pass 2 to pass 1.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-11-11 13:36:13 -08:00
H. Peter Anvin (Intel)
522d15c407 nasmdoc.src: fix compound word 2018-11-07 12:54:23 -08:00
Chang S. Bae
4310eb9d42 doc: Add a description for a useful case of mangling symbols
Signed-off-by: Chang S. Bae <changseok.bae@gmail.com>
2018-10-30 10:11:08 +03:00
Cyrill Gorcunov
fe2e1d469a doc: Clarify %include search directory semantics
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-10-26 01:29:52 +03:00
Cyrill Gorcunov
0e7f511151 doc: Update changes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-10-21 15:45:02 +03:00
Cyrill Gorcunov
1cbd48ad48 doc: Update changes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-10-14 21:09:30 +03:00
Cyrill Gorcunov
d94402d6f7 doc: Update changes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-10-13 23:03:24 +03:00
Cyrill Gorcunov
a98a84b0d5 doc: Update changes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-10-13 18:15:36 +03:00
H. Peter Anvin
ab2c4dfff9 pspdf.pl: GhostScript font integration seems broken with -dSAFER
-dSAFER seems to break font integration on some systems.  Furthermore,
once given -dSAFER seems to not be possible to override, so instead of
calling via the ps2pdf script, call GhostScript explicitly with the
equivalent options, sans -dSAFER.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2018-09-24 18:02:22 -07:00
Cyrill Gorcunov
10c0f66570 doc: changes -- Add a few more bullets
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2018-09-23 23:30:44 +03:00
Chang S. Bae
1fd4c45c96 doc: Fix macho section name for code
While today's manual lists "text" as the code section name,
"code" has been effectively named from d1da074.

Reported-by: <zenith432@users.sourceforge.net>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2018-08-24 11:21:53 +03:00
Chang S. Bae
a578634b61 optimization: Introduce new flag to turn-off selectively
While configuring optimization in a level is conventional,
a certain optimization tends to conflict with some pragma.

For example, jump match conflicts with Mach-O's
"subsections-via-symbols" macro.

This configurability will workaround such conflicts.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2018-08-16 00:01:31 +03:00
H. Peter Anvin (Intel)
58a275c3e9 doc/rdsrc.pl: fix unescaped brace
The latest version of Perl complains about an unescaped brace in a
regexp and states that it will be a fatal error in Perl 5.30.  Fix it
now before it becomes a problem.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-06-25 23:13:59 -07:00
H. Peter Anvin (Intel)
d558598ebe doc: add a few more updates
In particular, document the new behavior of EXTERN, GLOBAL and COMMON.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-06-25 18:19:15 -07:00
H. Peter Anvin (Intel)
b6b4b5d546 changes.src: cleanup and fixes
Clean up the language somewhat, and fix a couple of confusing
statements.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-06-25 14:19:39 -07:00
Chang S. Bae
ef21926ec2 doc: 2.14 change log
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-06-25 14:15:10 -07:00
Chang S. Bae
754edd85ee doc: document new feature from version 2.14
Added descriptions about new commandline options, STATIC
directive, symbol mingling, and some output format
specifics.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2018-06-25 14:15:04 -07:00
H. Peter Anvin
4dbf3a96a4 Merge remote-tracking branch 'origin/nasm-2.13.xx'
Resolved Conflicts:
	version

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-20 12:40:11 -08:00
H. Peter Anvin
8524e16303 insns.dat: add aliases of the RET instruction with explicit operand size
Make it possible to generate variants of RET(F) with explicit operand
size specified without having to use o16/o32/o64.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-14 11:09:07 -08:00
H. Peter Anvin
1b53750430 Merge tag 'nasm-2.13.03'
NASM 2.13.03

Resolved Conflicts:
	include/iflag.h
	version
	x86/insns-iflags.ph

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-07 13:51:54 -08:00
H. Peter Anvin
cb7b097b3e doc: some more documentation on 64-bit programming
Some more information about 64-bit programming and its quirks.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-07 12:28:42 -08:00
H. Peter Anvin
ddea5fc0cd doc: clarify need for ABS QWORD to do a 64-bit absolute load
The rarely used 64-bit absolute load instruction (what gas calls
movabsq) needs to be declared ABS if we are in relative mode, which is
normally the case.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-07 11:19:26 -08:00
H. Peter Anvin
f53c9778cd doc: add a bit more text about 64-bit immediates and pointers
There are some gotchas in how immediates and pointers are loaded in
64-bit mode and how they interact with optimization.  Document those
cases.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-07 11:16:20 -08:00
H. Peter Anvin
73c804c31e doc/changes.src: add missing blank line between bullet points
Bullet points are considered paragraphs, so our documentation compiler
require an empty line between them.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-02-07 10:52:50 -08:00