summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-04-21 00:51:22 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-04-21 01:08:36 +0400
commit2a587ab1c98134ceb81c2b7a1e723728d6a62407 (patch)
tree39f8b81e8304ab598bed4d25246e594a0be36ae3
parentd5f2aef30abcba734c51abdadf3255a6f4bd5be9 (diff)
downloadnasm-2a587ab1c98134ceb81c2b7a1e723728d6a62407.tar.gz
nasm-2a587ab1c98134ceb81c2b7a1e723728d6a62407.tar.bz2
nasm-2a587ab1c98134ceb81c2b7a1e723728d6a62407.zip
ofmt: Implement null_segalign stubs
Set stubs for all targets Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--nasm.c2
-rw-r--r--nasm.h6
-rw-r--r--output/nullout.c6
-rw-r--r--output/outaout.c2
-rw-r--r--output/outas86.c1
-rw-r--r--output/outbin.c3
-rw-r--r--output/outcoff.c3
-rw-r--r--output/outdbg.c7
-rw-r--r--output/outelf32.c1
-rw-r--r--output/outelf64.c1
-rw-r--r--output/outieee.c1
-rw-r--r--output/outlib.h1
-rw-r--r--output/outmacho32.c1
-rw-r--r--output/outmacho64.c1
-rw-r--r--output/outobj.c1
-rw-r--r--output/outrdf2.c1
16 files changed, 38 insertions, 0 deletions
diff --git a/nasm.c b/nasm.c
index afd9ea4..96d9105 100644
--- a/nasm.c
+++ b/nasm.c
@@ -1241,6 +1241,8 @@ static void assemble_file(char *fname, StrList **depend_ptr)
"segment alignment `%s' is not power of two",
value);
}
+ /* callee should be able to handle all details */
+ ofmt->segalign(location.segment, align);
}
}
break;
diff --git a/nasm.h b/nasm.h
index 5d5aae7..9b6ced8 100644
--- a/nasm.h
+++ b/nasm.h
@@ -682,6 +682,12 @@ 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
+ */
+ void (*segalign)(int32_t seg, int value);
+
+ /*
* This procedure is called to modify the segment base values
* returned from the SEG operator. It is given a segment base
* value (i.e. a segment value with the low bit set), and is
diff --git a/output/nullout.c b/output/nullout.c
index 228fa16..bcb1bd8 100644
--- a/output/nullout.c
+++ b/output/nullout.c
@@ -49,3 +49,9 @@ int null_directive(enum directives directive, char *value, int pass)
(void)pass;
return 0;
}
+
+void null_segalign(int32_t seg, int value)
+{
+ (void)seg;
+ (void)value;
+}
diff --git a/output/outaout.c b/output/outaout.c
index 31ce5b5..e0a12e8 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -924,6 +924,7 @@ struct ofmt of_aout = {
aout_out,
aout_deflabel,
aout_section_names,
+ null_segalign,
aout_segbase,
null_directive,
aout_filename,
@@ -946,6 +947,7 @@ struct ofmt of_aoutb = {
aout_out,
aout_deflabel,
aout_section_names,
+ null_segalign,
aout_segbase,
null_directive,
aout_filename,
diff --git a/output/outas86.c b/output/outas86.c
index 877eebd..f032730 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -638,6 +638,7 @@ struct ofmt of_as86 = {
as86_out,
as86_deflabel,
as86_section_names,
+ null_segalign,
as86_segbase,
null_directive,
as86_filename,
diff --git a/output/outbin.c b/output/outbin.c
index 332d84e..9b831a2 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -1672,6 +1672,7 @@ struct ofmt of_bin = {
bin_out,
bin_deflabel,
bin_secname,
+ null_segalign,
bin_segbase,
bin_directive,
bin_filename,
@@ -1690,6 +1691,7 @@ struct ofmt of_ith = {
bin_out,
bin_deflabel,
bin_secname,
+ null_segalign,
bin_segbase,
bin_directive,
ith_filename,
@@ -1708,6 +1710,7 @@ struct ofmt of_srec = {
bin_out,
bin_deflabel,
bin_secname,
+ null_segalign,
bin_segbase,
bin_directive,
srec_filename,
diff --git a/output/outcoff.c b/output/outcoff.c
index 5dc4023..20bd705 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -1012,6 +1012,7 @@ struct ofmt of_coff = {
coff_out,
coff_deflabel,
coff_section_names,
+ null_segalign,
coff_segbase,
coff_directives,
coff_std_filename,
@@ -1034,6 +1035,7 @@ struct ofmt of_win32 = {
coff_out,
coff_deflabel,
coff_section_names,
+ null_segalign,
coff_segbase,
coff_directives,
coff_win32_filename,
@@ -1056,6 +1058,7 @@ struct ofmt of_win64 = {
coff_out,
coff_deflabel,
coff_section_names,
+ null_segalign,
coff_segbase,
coff_directives,
coff_win32_filename,
diff --git a/output/outdbg.c b/output/outdbg.c
index 891bc17..c365a93 100644
--- a/output/outdbg.c
+++ b/output/outdbg.c
@@ -166,6 +166,12 @@ static void dbg_out(int32_t segto, const void *data,
}
}
+static void dbg_segalign(int32_t seg, int value)
+{
+ fprintf(ofile, "set alignment (%d) for segment (%d)\n",
+ seg, value);
+}
+
static int32_t dbg_segbase(int32_t segment)
{
return segment;
@@ -259,6 +265,7 @@ struct ofmt of_dbg = {
dbg_out,
dbg_deflabel,
dbg_section_names,
+ dbg_segalign,
dbg_segbase,
dbg_directive,
dbg_filename,
diff --git a/output/outelf32.c b/output/outelf32.c
index f50fa1c..3e515b5 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -1401,6 +1401,7 @@ struct ofmt of_elf32 = {
elf_out,
elf_deflabel,
elf_section_names,
+ null_segalign,
elf_segbase,
elf_directive,
elf_filename,
diff --git a/output/outelf64.c b/output/outelf64.c
index 47eba5b..3ea96de 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -1501,6 +1501,7 @@ struct ofmt of_elf64 = {
elf_out,
elf_deflabel,
elf_section_names,
+ null_segalign,
elf_segbase,
elf_directive,
elf_filename,
diff --git a/output/outieee.c b/output/outieee.c
index e3245f5..4b2be9e 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -1501,6 +1501,7 @@ struct ofmt of_ieee = {
ieee_out,
ieee_deflabel,
ieee_segment,
+ null_segalign,
ieee_segbase,
ieee_directive,
ieee_filename,
diff --git a/output/outlib.h b/output/outlib.h
index f3cd1bc..0448ae4 100644
--- a/output/outlib.h
+++ b/output/outlib.h
@@ -41,6 +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);
/* Do-nothing versions of all the debug routines */
struct ofmt;
diff --git a/output/outmacho32.c b/output/outmacho32.c
index ee08e02..44eb0ec 100644
--- a/output/outmacho32.c
+++ b/output/outmacho32.c
@@ -1317,6 +1317,7 @@ struct ofmt of_macho32 = {
macho_output,
macho_symdef,
macho_section,
+ null_segalign,
macho_segbase,
null_directive,
macho_filename,
diff --git a/output/outmacho64.c b/output/outmacho64.c
index ba785fa..c54e6d9 100644
--- a/output/outmacho64.c
+++ b/output/outmacho64.c
@@ -1488,6 +1488,7 @@ struct ofmt of_macho64 = {
macho_output,
macho_symdef,
macho_section,
+ null_segalign,
macho_segbase,
null_directive,
macho_filename,
diff --git a/output/outobj.c b/output/outobj.c
index 804ff52..8c3c9ef 100644
--- a/output/outobj.c
+++ b/output/outobj.c
@@ -2559,6 +2559,7 @@ struct ofmt of_obj = {
obj_out,
obj_deflabel,
obj_segment,
+ null_segalign,
obj_segbase,
obj_directive,
obj_filename,
diff --git a/output/outrdf2.c b/output/outrdf2.c
index 6d95803..4c2851d 100644
--- a/output/outrdf2.c
+++ b/output/outrdf2.c
@@ -788,6 +788,7 @@ struct ofmt of_rdf2 = {
rdf2_out,
rdf2_deflabel,
rdf2_section_names,
+ null_segalign,
rdf2_segbase,
rdf2_directive,
rdf2_filename,