[Nasm-commits] [nasm:macho64] output: combine macros for the most generic output formats

nasm-bot for H. Peter Anvin hpa at zytor.com
Thu Jun 4 19:56:16 PDT 2020


Commit-ID:  45d6b618780b2b5d7adcdccc828a9826c603fb01
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=45d6b618780b2b5d7adcdccc828a9826c603fb01
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Tue, 9 Sep 2008 10:16:15 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 9 Sep 2008 10:16:15 -0700

output: combine macros for the most generic output formats

Several output formats have a macro package that looks like:

%define __SECT__ [section .text]
%macro __NASM_CDecl__ 1
%endmacro

Combine them all into a single macro package (generic.mac).

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 output/{outaout.mac => generic.mac} | 2 +-
 output/outaout.c                    | 6 +++---
 output/outas86.c                    | 4 ++--
 output/outas86.mac                  | 4 ----
 output/outmacho.mac                 | 4 ----
 output/outmacho32.c                 | 6 +++---
 output/outmacho64.c                 | 4 ++--
 7 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/output/outaout.mac b/output/generic.mac
similarity index 56%
rename from output/outaout.mac
rename to output/generic.mac
index f00cb960..0a371ede 100644
--- a/output/outaout.mac
+++ b/output/generic.mac
@@ -1,4 +1,4 @@
-OUT: aout aoutb
+OUT: generic aout aoutb as86 macho macho32 macho64
 %define __SECT__ [section .text]
 %macro __NASM_CDecl__ 1
 %endmacro
diff --git a/output/outaout.c b/output/outaout.c
index 48a2cffd..25f1c663 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -905,7 +905,7 @@ static void aout_filename(char *inname, char *outname, efunc error)
     standard_extension(inname, outname, ".o", error);
 }
 
-extern macros_t aout_stdmac[];
+extern macros_t generic_stdmac[];
 
 static int aout_set_info(enum geninfo type, char **val)
 {
@@ -923,7 +923,7 @@ struct ofmt of_aout = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    aout_stdmac,
+    generic_stdmac,
     aout_init,
     aout_set_info,
     aout_out,
@@ -945,7 +945,7 @@ struct ofmt of_aoutb = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    aout_stdmac,
+    generic_stdmac,
     aoutb_init,
     aout_set_info,
     aout_out,
diff --git a/output/outas86.c b/output/outas86.c
index b59fe6b3..ba49aa3f 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -603,7 +603,7 @@ static void as86_filename(char *inname, char *outname, efunc error)
     standard_extension(inname, outname, ".o", error);
 }
 
-extern macros_t as86_stdmac[];
+extern macros_t generic_stdmac[];
 
 static int as86_set_info(enum geninfo type, char **val)
 {
@@ -626,7 +626,7 @@ struct ofmt of_as86 = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    as86_stdmac,
+    generic_stdmac,
     as86_init,
     as86_set_info,
     as86_out,
diff --git a/output/outas86.mac b/output/outas86.mac
deleted file mode 100644
index 1edf908c..00000000
--- a/output/outas86.mac
+++ /dev/null
@@ -1,4 +0,0 @@
-OUT: as86
-%define __SECT__ [section .text]
-%macro __NASM_CDecl__ 1
-%endmacro
diff --git a/output/outmacho.mac b/output/outmacho.mac
deleted file mode 100644
index 58a7c423..00000000
--- a/output/outmacho.mac
+++ /dev/null
@@ -1,4 +0,0 @@
-OUT: macho macho32 macho64
-%define __SECT__ [section .text]
-%macro __NASM_CDecl__ 1
-%endmacro
diff --git a/output/outmacho32.c b/output/outmacho32.c
index a3b01315..6b6cfaba 100644
--- a/output/outmacho32.c
+++ b/output/outmacho32.c
@@ -717,7 +717,7 @@ static void macho_filename(char *inname, char *outname, efunc error)
     standard_extension(inname, outname, ".o", error);
 }
 
-extern macros_t macho_stdmac[];
+extern macros_t generic_stdmac[];
 
 /* Comparison function for qsort symbol layout.  */
 static int layout_compare (const struct symbol **s1,
@@ -1312,7 +1312,7 @@ struct ofmt of_macho32 = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    macho_stdmac,
+    generic_stdmac,
     macho_init,
     macho_setinfo,
     macho_output,
@@ -1330,7 +1330,7 @@ struct ofmt of_macho = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    macho_stdmac,
+    generic_stdmac,
     macho_init,
     macho_setinfo,
     macho_output,
diff --git a/output/outmacho64.c b/output/outmacho64.c
index 79b6a451..0e4d991c 100644
--- a/output/outmacho64.c
+++ b/output/outmacho64.c
@@ -763,7 +763,7 @@ static void macho_filename(char *inname, char *outname, efunc error)
     standard_extension(inname, outname, ".o", error);
 }
 
-extern macros_t macho_stdmac[];
+extern macros_t generic_stdmac[];
 
 /* Comparison function for qsort symbol layout.  */
 static int layout_compare (const struct symbol **s1,
@@ -1375,7 +1375,7 @@ struct ofmt of_macho64 = {
     NULL,
     null_debug_arr,
     &null_debug_form,
-    macho_stdmac,
+    generic_stdmac,
     macho_init,
     macho_setinfo,
     macho_output,


More information about the Nasm-commits mailing list