From: Peter Johnson Date: Tue, 16 Dec 2003 07:45:04 +0000 (-0000) Subject: Add a workaround for the lack of per-objfmt macro support to fix the common X-Git-Tag: v0.4.0~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f286417266b2dc64b0fd382e863fd0788272bbc2;p=yasm Add a workaround for the lack of per-objfmt macro support to fix the common use of the ORG macro (several user comments about the lack of this) and the initial value of the __SECT__ macro (used by ENDSTRUC among other macros). Fortunately, for all current objfmts, __SECT__ is currently defined as [section .text], so one common definition can be used for now. FIXME: remove this workaround when a better solution has been implemented. svn path=/trunk/yasm/; revision=1087 --- diff --git a/modules/preprocs/nasm/standard.mac b/modules/preprocs/nasm/standard.mac index bbbf90d8..26d77f7a 100644 --- a/modules/preprocs/nasm/standard.mac +++ b/modules/preprocs/nasm/standard.mac @@ -22,7 +22,7 @@ %define __FILE__ %define __LINE__ -%define __SECT__ ; it ought to be defined, even if as nothing +%define __SECT__ [section .text] ; it ought to be defined, even if as nothing %imacro section 1+.nolist %define __SECT__ [section %1] @@ -107,4 +107,7 @@ __SECT__ [cpu %1] %endmacro +%imacro org 1+.nolist +[org %1] +%endmacro diff --git a/modules/preprocs/nasm/tests/Makefile.inc b/modules/preprocs/nasm/tests/Makefile.inc index 57fc86a7..99625e4e 100644 --- a/modules/preprocs/nasm/tests/Makefile.inc +++ b/modules/preprocs/nasm/tests/Makefile.inc @@ -7,3 +7,6 @@ EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.asm EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.asm EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.errwarn +EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.asm +EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.errwarn +EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.hex diff --git a/modules/preprocs/nasm/tests/orgsect.asm b/modules/preprocs/nasm/tests/orgsect.asm new file mode 100644 index 00000000..d8e9c417 --- /dev/null +++ b/modules/preprocs/nasm/tests/orgsect.asm @@ -0,0 +1,7 @@ +ORG 100h +label: +db 5 +STRUC Foo +.bar resb 4 +ENDSTRUC +dw label diff --git a/modules/preprocs/nasm/tests/orgsect.errwarn b/modules/preprocs/nasm/tests/orgsect.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/preprocs/nasm/tests/orgsect.hex b/modules/preprocs/nasm/tests/orgsect.hex new file mode 100644 index 00000000..d055b678 --- /dev/null +++ b/modules/preprocs/nasm/tests/orgsect.hex @@ -0,0 +1,3 @@ +05 +00 +01