From 439875c1d9773df06cabbe9611f7a67c88f58847 Mon Sep 17 00:00:00 2001 From: Daniel Lundqvist Date: Tue, 4 Oct 2016 10:53:19 +0200 Subject: [PATCH 1/2] ldrdf: Remove output file if there are any errors If there are any errors while linking, we should not create an output file. Signed-off-by: Daniel Lundqvist Signed-off-by: H. Peter Anvin --- rdoff/ldrdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c index ff543f93..2db980f0 100644 --- a/rdoff/ldrdf.c +++ b/rdoff/ldrdf.c @@ -1398,7 +1398,9 @@ int main(int argc, char **argv) write_output(outname); - if (errorcount > 0) + if (errorcount > 0) { + remove(outname); exit(1); + } return 0; } From 3f87a2ac50b018ec463beaf702cb9779bdbe97b3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 4 Oct 2016 14:07:19 -0700 Subject: [PATCH 2/2] preproc: add dummy %pragma directive In future versions of NASM we will presumably have "real" pragmas; add dummy support for the %pragma directive for forward compatibility. Signed-off-by: H. Peter Anvin --- doc/changes.src | 4 ++++ pptok.dat | 3 ++- preproc.c | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/changes.src b/doc/changes.src index 682c7d1c..61b6511b 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -35,6 +35,10 @@ since 2007. included in a shipping product; it is included for completeness only. +\b Add the \c{%pragma} preprocessor directive for forward + compatibility with future versions of NASM. At this time no pragmas + are implemented and this is merely a dummy directive. + \S{cl-2.12.02} Version 2.12.02 \b Fix preprocessor errors, especially \c{%error} and \c{%warning}, diff --git a/pptok.dat b/pptok.dat index b78d138a..a2c64d0a 100644 --- a/pptok.dat +++ b/pptok.dat @@ -1,6 +1,6 @@ ## -------------------------------------------------------------------------- ## -## Copyright 1996-2010 The NASM Authors - All Rights Reserved +## Copyright 1996-2016 The NASM Authors - All Rights Reserved ## See the file AUTHORS included with the NASM distribution for ## the specific copyright holders. ## @@ -78,6 +78,7 @@ %macro %pathsearch %pop +%pragma %push %rep %repl diff --git a/preproc.c b/preproc.c index fdb9fc19..228a65aa 100644 --- a/preproc.c +++ b/preproc.c @@ -2283,6 +2283,14 @@ static int do_directive(Token * tline) tline->text); return NO_DIRECTIVE_FOUND; /* didn't get it */ + case PP_PRAGMA: + /* + * Currently %pragma doesn't do anything; it is here for + * forward compatibility with future versions of NASM. + */ + free_tlist(origline); + return DIRECTIVE_FOUND; + case PP_STACKSIZE: /* Directive to tell NASM what the default stack size is. The * default is for a 16-bit stack, and this can be overriden with