diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-01-11 13:24:36 -0800 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-01-11 13:24:36 -0800 |
commit | d7450a6478c787dcc8d2a18ef29f84e34b19cecf (patch) | |
tree | ae63d0ca8d0c57a4cecf4f20dc109b26ef429bfe /macros | |
parent | 52266ad42490f48b91a70efb5c2f93ea281eeb60 (diff) | |
download | nasm-d7450a6478c787dcc8d2a18ef29f84e34b19cecf.tar.gz |
sectalign: "sectalign on|off" should not affect an explicit directive
sectalign on|off is documented to only affect the align/alignb
directives, *not* an explicit sectalign directive. This is fairly
obviously the proper behavior, so make it work accordingly.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'macros')
-rw-r--r-- | macros/standard.mac | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/macros/standard.mac b/macros/standard.mac index a6c50b68..03944ee7 100644 --- a/macros/standard.mac +++ b/macros/standard.mac @@ -1,6 +1,6 @@ ;; -------------------------------------------------------------------------- ;; -;; Copyright 1996-2016 The NASM Authors - All Rights Reserved +;; Copyright 1996-2019 The NASM Authors - All Rights Reserved ;; See the file AUTHORS included with the NASM distribution for ;; the specific copyright holders. ;; @@ -68,17 +68,13 @@ STD: nasm %endmacro %define __SECTALIGN_ALIGN_UPDATES_SECTION__ 1 -%imacro sectalign 1.nolist - %ifnum %1 - %if __SECTALIGN_ALIGN_UPDATES_SECTION__ = 1 - [sectalign %1] - %endif +%imacro sectalign 1+.nolist + %ifidni %1,off + %define __SECTALIGN_ALIGN_UPDATES_SECTION__ 0 + %elifidni %1,on + %define __SECTALIGN_ALIGN_UPDATES_SECTION__ 1 %else - %ifidni %1,off - %define __SECTALIGN_ALIGN_UPDATES_SECTION__ 0 - %elifidni %1,on - %define __SECTALIGN_ALIGN_UPDATES_SECTION__ 1 - %endif + [sectalign %1] %endif %endmacro @@ -117,12 +113,16 @@ STD: nasm %endmacro %imacro align 1-2+.nolist nop - sectalign %1 + %if __SECTALIGN_ALIGN_UPDATES_SECTION__ + sectalign %1 + %endif times (((%1) - (($-$$) % (%1))) % (%1)) %2 %endmacro %imacro alignb 1-2+.nolist - sectalign %1 + %if __SECTALIGN_ALIGN_UPDATES_SECTION__ + sectalign %1 + %endif %ifempty %2 resb (((%1) - (($-$$) % (%1))) % (%1)) %else |