section
segment
warning
-segalign
+sectalign
; --- Format-specific directives
export ; outcoff, outobj
%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
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;
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
return 0;
}
-void null_segalign(int32_t seg, int value)
+void null_sectalign(int32_t seg, unsigned int value)
{
(void)seg;
(void)value;
aout_out,
aout_deflabel,
aout_section_names,
- null_segalign,
+ null_sectalign,
aout_segbase,
null_directive,
aout_filename,
aout_out,
aout_deflabel,
aout_section_names,
- null_segalign,
+ null_sectalign,
aout_segbase,
null_directive,
aout_filename,
as86_out,
as86_deflabel,
as86_section_names,
- null_segalign,
+ null_sectalign,
as86_segbase,
null_directive,
as86_filename,
bin_out,
bin_deflabel,
bin_secname,
- null_segalign,
+ null_sectalign,
bin_segbase,
bin_directive,
bin_filename,
bin_out,
bin_deflabel,
bin_secname,
- null_segalign,
+ null_sectalign,
bin_segbase,
bin_directive,
ith_filename,
bin_out,
bin_deflabel,
bin_secname,
- null_segalign,
+ null_sectalign,
bin_segbase,
bin_directive,
srec_filename,
coff_out,
coff_deflabel,
coff_section_names,
- null_segalign,
+ null_sectalign,
coff_segbase,
coff_directives,
coff_std_filename,
coff_out,
coff_deflabel,
coff_section_names,
- null_segalign,
+ null_sectalign,
coff_segbase,
coff_directives,
coff_win32_filename,
coff_out,
coff_deflabel,
coff_section_names,
- null_segalign,
+ null_sectalign,
coff_segbase,
coff_directives,
coff_win32_filename,
}
}
-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);
dbg_out,
dbg_deflabel,
dbg_section_names,
- dbg_segalign,
+ dbg_sectalign,
dbg_segbase,
dbg_directive,
dbg_filename,
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;
if (!s || !is_power2(value))
return;
- if ((unsigned int)value > s->align)
+ if (value > s->align)
s->align = value;
}
elf_out,
elf_deflabel,
elf_section_names,
- elf_segalign,
+ elf_sectalign,
elf_segbase,
elf_directive,
elf_filename,
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;
if (!s || !is_power2(value))
return;
- if ((unsigned int)value > s->align)
+ if (value > s->align)
s->align = value;
}
elf_out,
elf_deflabel,
elf_section_names,
- elf_segalign,
+ elf_sectalign,
elf_segbase,
elf_directive,
elf_filename,
ieee_out,
ieee_deflabel,
ieee_segment,
- null_segalign,
+ null_sectalign,
ieee_segbase,
ieee_directive,
ieee_filename,
/* 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;
macho_output,
macho_symdef,
macho_section,
- null_segalign,
+ null_sectalign,
macho_segbase,
null_directive,
macho_filename,
macho_output,
macho_symdef,
macho_section,
- null_segalign,
+ null_sectalign,
macho_segbase,
null_directive,
macho_filename,
obj_out,
obj_deflabel,
obj_segment,
- null_segalign,
+ null_sectalign,
obj_segbase,
obj_directive,
obj_filename,
rdf2_out,
rdf2_deflabel,
rdf2_section_names,
- null_segalign,
+ null_sectalign,
rdf2_segbase,
rdf2_directive,
rdf2_filename,
%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