From d7450a6478c787dcc8d2a18ef29f84e34b19cecf Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 11 Jan 2019 13:24:36 -0800 Subject: [PATCH] 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) --- macros/standard.mac | 26 +++++++++++++------------- 1 file 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