From 268e093469d2b652db8b48bbc61e52fa5f608105 Mon Sep 17 00:00:00 2001 From: uz Date: Sat, 13 Nov 2010 22:52:13 +0000 Subject: [PATCH] Fix order of command line arguments: -o should precede -C or -t. git-svn-id: svn://svn.cc65.org/cc65/trunk@4859 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cl65/main.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/cl65/main.c b/src/cl65/main.c index 2c3fd97a8..7ea21f4bb 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -386,23 +386,6 @@ static void Link (void) { unsigned I; - /* If we have a linker config file given, add it to the command line. - * Otherwise pass the target to the linker if we have one. - */ - if (LinkerConfig) { - if (Module) { - Error ("Cannot use -C and --module together"); - } - CmdAddArg2 (&LD65, "-C", LinkerConfig); - } else if (Module) { - CmdSetTarget (&LD65, TGT_MODULE); - } else { - CmdSetTarget (&LD65, Target); - } - - /* Determine which target libraries are needed */ - SetTargetFiles (); - /* Since linking is always the final step, if we have an output file name * given, set it here. If we don't have an explicit output name given, * try to build one from the name of the first input file. @@ -420,6 +403,23 @@ static void Link (void) } + /* If we have a linker config file given, add it to the command line. + * Otherwise pass the target to the linker if we have one. + */ + if (LinkerConfig) { + if (Module) { + Error ("Cannot use -C and --module together"); + } + CmdAddArg2 (&LD65, "-C", LinkerConfig); + } else if (Module) { + CmdSetTarget (&LD65, TGT_MODULE); + } else { + CmdSetTarget (&LD65, Target); + } + + /* Determine which target libraries are needed */ + SetTargetFiles (); + /* Add all object files as parameters */ for (I = 0; I < LD65.FileCount; ++I) { CmdAddArg (&LD65, LD65.Files [I]); -- 2.39.5