Rename SEGALIGN to SECTALIGN
authorCyrill Gorcunov <gorcunov@gmail.com>
Wed, 21 Apr 2010 09:45:32 +0000 (13:45 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Wed, 21 Apr 2010 14:09:54 +0000 (18:09 +0400)
"sectalign" is preferred over "segalign"
since it operates over section attributes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
19 files changed:
directives.dat
macros/smartalign.mac
nasm.c
nasm.h
output/nullout.c
output/outaout.c
output/outas86.c
output/outbin.c
output/outcoff.c
output/outdbg.c
output/outelf32.c
output/outelf64.c
output/outieee.c
output/outlib.h
output/outmacho32.c
output/outmacho64.c
output/outobj.c
output/outrdf2.c
standard.mac

index fbcf666..a8d9261 100644 (file)
@@ -48,7 +48,7 @@ list
 section
 segment
 warning
-segalign
+sectalign
 
 ; --- Format-specific directives
 export                         ; outcoff, outobj
index 410c4d3..9b37f12 100644 (file)
@@ -161,7 +161,7 @@ USE: smartalign
 
 %unimacro align 1-2+.nolist
 %imacro align 1-2+.nolist
-  segalign %1   ; align a segment as well
+  sectalign %1   ; align a segment as well
   %ifnempty %2
     times (((%1) - (($-$$) % (%1))) % (%1)) %2
   %else
diff --git a/nasm.c b/nasm.c
index 96d9105..18548a8 100644 (file)
--- a/nasm.c
+++ b/nasm.c
@@ -1232,17 +1232,17 @@ static void assemble_file(char *fname, StrList **depend_ptr)
                         location.segment = seg;
                     }
                     break;
-                case D_SEGALIGN:        /* [SEGALIGN n] */
+                case D_SECTALIGN:        /* [SECTALIGN n] */
                     {
                         if (*value) {
-                            int align = atoi(value);
+                            unsigned int align = atoi(value);
                             if (!is_power2(align)) {
                                 nasm_error(ERR_NONFATAL,
                                            "segment alignment `%s' is not power of two",
                                             value);
                             }
                             /* callee should be able to handle all details */
-                            ofmt->segalign(location.segment, align);
+                            ofmt->sectalign(location.segment, align);
                         }
                     }
                     break;
diff --git a/nasm.h b/nasm.h
index 9b6ced8..4bdaec8 100644 (file)
--- a/nasm.h
+++ b/nasm.h
@@ -682,10 +682,10 @@ struct ofmt {
     int32_t (*section) (char *name, int pass, int *bits);
 
     /*
-     * This procedure is called to modify segment alignment,
-     * there is a trick, the alignment can only increase
+     * This procedure is called to modify section alignment,
+     * note there is a trick, the alignment can only increase
      */
-    void (*segalign)(int32_t seg, int value);
+    void (*sectalign)(int32_t seg, unsigned int value);
 
     /*
      * This procedure is called to modify the segment base values
index bcb1bd8..196a09d 100644 (file)
@@ -50,7 +50,7 @@ int null_directive(enum directives directive, char *value, int pass)
     return 0;
 }
 
-void null_segalign(int32_t seg, int value)
+void null_sectalign(int32_t seg, unsigned int value)
 {
     (void)seg;
     (void)value;
index e0a12e8..e096392 100644 (file)
@@ -924,7 +924,7 @@ struct ofmt of_aout = {
     aout_out,
     aout_deflabel,
     aout_section_names,
-    null_segalign,
+    null_sectalign,
     aout_segbase,
     null_directive,
     aout_filename,
@@ -947,7 +947,7 @@ struct ofmt of_aoutb = {
     aout_out,
     aout_deflabel,
     aout_section_names,
-    null_segalign,
+    null_sectalign,
     aout_segbase,
     null_directive,
     aout_filename,
index f032730..b288637 100644 (file)
@@ -638,7 +638,7 @@ struct ofmt of_as86 = {
     as86_out,
     as86_deflabel,
     as86_section_names,
-    null_segalign,
+    null_sectalign,
     as86_segbase,
     null_directive,
     as86_filename,
index 9b831a2..260d99d 100644 (file)
@@ -1672,7 +1672,7 @@ struct ofmt of_bin = {
     bin_out,
     bin_deflabel,
     bin_secname,
-    null_segalign,
+    null_sectalign,
     bin_segbase,
     bin_directive,
     bin_filename,
@@ -1691,7 +1691,7 @@ struct ofmt of_ith = {
     bin_out,
     bin_deflabel,
     bin_secname,
-    null_segalign,
+    null_sectalign,
     bin_segbase,
     bin_directive,
     ith_filename,
@@ -1710,7 +1710,7 @@ struct ofmt of_srec = {
     bin_out,
     bin_deflabel,
     bin_secname,
-    null_segalign,
+    null_sectalign,
     bin_segbase,
     bin_directive,
     srec_filename,
index 20bd705..07974d8 100644 (file)
@@ -1012,7 +1012,7 @@ struct ofmt of_coff = {
     coff_out,
     coff_deflabel,
     coff_section_names,
-    null_segalign,
+    null_sectalign,
     coff_segbase,
     coff_directives,
     coff_std_filename,
@@ -1035,7 +1035,7 @@ struct ofmt of_win32 = {
     coff_out,
     coff_deflabel,
     coff_section_names,
-    null_segalign,
+    null_sectalign,
     coff_segbase,
     coff_directives,
     coff_win32_filename,
@@ -1058,7 +1058,7 @@ struct ofmt of_win64 = {
     coff_out,
     coff_deflabel,
     coff_section_names,
-    null_segalign,
+    null_sectalign,
     coff_segbase,
     coff_directives,
     coff_win32_filename,
index c365a93..13d53bd 100644 (file)
@@ -166,7 +166,7 @@ static void dbg_out(int32_t segto, const void *data,
     }
 }
 
-static void dbg_segalign(int32_t seg, int value)
+static void dbg_sectalign(int32_t seg, unsigned int value)
 {
     fprintf(ofile, "set alignment (%d) for segment (%d)\n",
             seg, value);       
@@ -265,7 +265,7 @@ struct ofmt of_dbg = {
     dbg_out,
     dbg_deflabel,
     dbg_section_names,
-    dbg_segalign,
+    dbg_sectalign,
     dbg_segbase,
     dbg_directive,
     dbg_filename,
index 2179f6b..4d238a7 100644 (file)
@@ -1305,7 +1305,7 @@ static void elf_sect_write(struct Section *sect,
     sect->len += len;
 }
 
-static void elf_segalign(int32_t seg, int value)
+static void elf_sectalign(int32_t seg, unsigned int value)
 {
     struct Section *s = NULL;
     int i;
@@ -1319,7 +1319,7 @@ static void elf_segalign(int32_t seg, int value)
     if (!s || !is_power2(value))
         return;
 
-    if ((unsigned int)value > s->align)
+    if (value > s->align)
         s->align = value;
 }
 
@@ -1419,7 +1419,7 @@ struct ofmt of_elf32 = {
     elf_out,
     elf_deflabel,
     elf_section_names,
-    elf_segalign,
+    elf_sectalign,
     elf_segbase,
     elf_directive,
     elf_filename,
index c7baf4f..47581b4 100644 (file)
@@ -1405,7 +1405,7 @@ static void elf_sect_writeaddr(struct Section *sect, int64_t data, size_t len)
     sect->len += len;
 }
 
-static void elf_segalign(int32_t seg, int value)
+static void elf_sectalign(int32_t seg, unsigned int value)
 {
     struct Section *s = NULL;
     int i;
@@ -1419,7 +1419,7 @@ static void elf_segalign(int32_t seg, int value)
     if (!s || !is_power2(value))
         return;
 
-    if ((unsigned int)value > s->align)
+    if (value > s->align)
         s->align = value;
 }
 
@@ -1519,7 +1519,7 @@ struct ofmt of_elf64 = {
     elf_out,
     elf_deflabel,
     elf_section_names,
-    elf_segalign,
+    elf_sectalign,
     elf_segbase,
     elf_directive,
     elf_filename,
index 4b2be9e..d443271 100644 (file)
@@ -1501,7 +1501,7 @@ struct ofmt of_ieee = {
     ieee_out,
     ieee_deflabel,
     ieee_segment,
-    null_segalign,
+    null_sectalign,
     ieee_segbase,
     ieee_directive,
     ieee_filename,
index 0448ae4..29c27a0 100644 (file)
@@ -41,7 +41,7 @@ uint64_t realsize(enum out_type type, uint64_t size);
 /* Do-nothing versions of some output routines */
 int null_setinfo(enum geninfo type, char **string);
 int null_directive(enum directives directive, char *value, int pass);
-void null_segalign(int32_t seg, int value);
+void null_sectalign(int32_t seg, unsigned int value);
 
 /* Do-nothing versions of all the debug routines */
 struct ofmt;
index 44eb0ec..b0c9560 100644 (file)
@@ -1317,7 +1317,7 @@ struct ofmt of_macho32 = {
     macho_output,
     macho_symdef,
     macho_section,
-    null_segalign,
+    null_sectalign,
     macho_segbase,
     null_directive,
     macho_filename,
index c54e6d9..f949881 100644 (file)
@@ -1488,7 +1488,7 @@ struct ofmt of_macho64 = {
     macho_output,
     macho_symdef,
     macho_section,
-    null_segalign,
+    null_sectalign,
     macho_segbase,
     null_directive,
     macho_filename,
index 8c3c9ef..053ca4f 100644 (file)
@@ -2559,7 +2559,7 @@ struct ofmt of_obj = {
     obj_out,
     obj_deflabel,
     obj_segment,
-    null_segalign,
+    null_sectalign,
     obj_segbase,
     obj_directive,
     obj_filename,
index 4c2851d..02518a1 100644 (file)
@@ -788,7 +788,7 @@ struct ofmt of_rdf2 = {
     rdf2_out,
     rdf2_deflabel,
     rdf2_section_names,
-    null_segalign,
+    null_sectalign,
     rdf2_segbase,
     rdf2_directive,
     rdf2_filename,
index a7a52db..32a75a8 100644 (file)
@@ -66,9 +66,8 @@
 %define __SECT__ [segment %1]
          __SECT__
 %endmacro
-%imacro segalign 1+.nolist
-%define __SECT__ [segalign %1]
-         __SECT__
+%imacro sectalign 1.nolist
+       [sectalign %1]
 %endmacro
 
 %imacro absolute 1+.nolist