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>
This commit is contained in:
H. Peter Anvin 2016-01-15 10:46:12 -08:00
parent dcc2cbce8d
commit f29123b936

View file

@ -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))