1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00

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
This commit is contained in:
uz 2010-11-13 22:52:13 +00:00
parent 09a62690f3
commit 268e093469

View File

@ -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]);