From: uz Date: Sat, 13 Nov 2010 22:52:13 +0000 (+0000) Subject: Fix order of command line arguments: -o should precede -C or -t. X-Git-Tag: V2.13.3~596 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=268e093469d2b652db8b48bbc61e52fa5f608105;p=cc65 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 --- 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]);