diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2016-01-15 10:46:12 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2016-01-15 11:03:40 -0800 |
commit | f29123b936b1751c6d72dad86b05eb293cca5c6c (patch) | |
tree | 80a89e969f7d08f7a649c7449f14a8839ff51eb7 | |
parent | dcc2cbce8d4cad5879265b74c6076f924d1725bd (diff) | |
download | nasm-f29123b936b1751c6d72dad86b05eb293cca5c6c.tar.gz |
smartalign.mac: Ignore smartalign in preprocess-only mode
When running in preprocess-only mode generate the equivalent of
standard alignment using nops. This at the very least allows some
kind of reasonable output and allows for dependency generation to
proceed; the only way to *really* address this problem is to move
alignment generation into the assembler proper; this would also allow
the align/alignb distinction to be removed and handle padding with
instructions which are more than one byte.
This should resolve bug 3392319.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | macros/smartalign.mac | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/macros/smartalign.mac b/macros/smartalign.mac index 9b37f12c..e5c0b99a 100644 --- a/macros/smartalign.mac +++ b/macros/smartalign.mac @@ -1,6 +1,6 @@ ;; -------------------------------------------------------------------------- ;; -;; Copyright 1996-2009 The NASM Authors - All Rights Reserved +;; Copyright 1996-2016 The NASM Authors - All Rights Reserved ;; See the file AUTHORS included with the NASM distribution for ;; the specific copyright holders. ;; @@ -164,6 +164,8 @@ USE: smartalign sectalign %1 ; align a segment as well %ifnempty %2 times (((%1) - (($-$$) % (%1))) % (%1)) %2 + %elif __PASS__ == 0 || __PASS__ == 3 + times (((%1) - (($-$$) % (%1))) % (%1)) nop %else %push %assign %$pad (((%1) - (($-$$) % (%1))) % (%1)) |