From: Cyrill Gorcunov Date: Tue, 20 Apr 2010 11:33:45 +0000 (+0400) Subject: Introduce SEGALIGN directive X-Git-Tag: nasm-2.11.05~669 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5f2aef30abcba734c51abdadf3255a6f4bd5be9;p=platform%2Fupstream%2Fnasm.git Introduce SEGALIGN directive No real handling yet though. Definition only. Signed-off-by: Cyrill Gorcunov --- diff --git a/directives.dat b/directives.dat index b08d387..fbcf666 100644 --- a/directives.dat +++ b/directives.dat @@ -48,6 +48,7 @@ list section segment warning +segalign ; --- Format-specific directives export ; outcoff, outobj diff --git a/nasm.c b/nasm.c index a1ff56c..afd9ea4 100644 --- a/nasm.c +++ b/nasm.c @@ -1232,7 +1232,19 @@ static void assemble_file(char *fname, StrList **depend_ptr) location.segment = seg; } break; - case D_EXTERN: /* [EXTERN label:special] */ + case D_SEGALIGN: /* [SEGALIGN n] */ + { + if (*value) { + int align = atoi(value); + if (!is_power2(align)) { + nasm_error(ERR_NONFATAL, + "segment alignment `%s' is not power of two", + value); + } + } + } + break; + case D_EXTERN: /* [EXTERN label:special] */ if (*value == '$') value++; /* skip initial $ if present */ if (pass0 == 2) { diff --git a/standard.mac b/standard.mac index a3e8eea..a7a52db 100644 --- a/standard.mac +++ b/standard.mac @@ -66,6 +66,10 @@ %define __SECT__ [segment %1] __SECT__ %endmacro +%imacro segalign 1+.nolist +%define __SECT__ [segalign %1] + __SECT__ +%endmacro %imacro absolute 1+.nolist %define __SECT__ [absolute %1]