" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet a compiler include directory path\n"
" --mapfile name\tCreate a map file\n"
+ " --start-addr addr\tSet the default start address\n"
" --target sys\t\tSet the target system\n"
" --version\t\tPrint the version number\n"
" --verbose\t\tVerbose mode\n",
+static void OptStartAddr (const char* Opt, const char* Arg)
+/* Set the default start address */
+{
+ CmdAddArg (&LD65, "-S");
+ CmdAddArg (&LD65, Arg);
+}
+
+
+
static void OptTarget (const char* Opt, const char* Arg)
/* Set the target system */
{
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--mapfile", 1, OptMapFile },
+ { "--start-addr", 1, OptStartAddr },
{ "--target", 1, OptTarget },
{ "--verbose", 0, OptVerbose },
{ "--version", 0, OptVersion },
"Long options:\n"
" --help\t\tHelp (this text)\n"
" --mapfile name\tCreate a map file\n"
+ " --start-addr addr\tSet the default start address\n"
" --target sys\t\tSet the target system\n"
" --version\t\tPrint the linker version\n",
ProgName);
/* Check if we do really have a number */
if (Converted != 1) {
- fprintf (stderr, "Invalid number given in argument: %s\n", Arg);
- exit (EXIT_FAILURE);
+ Error ("Invalid number given in argument: %s\n", Arg);
}
/* Return the result */
+static void OptStartAddr (const char* Opt, const char* Arg)
+/* Set the default start address */
+{
+ StartAddr = CvtNumber (Opt, Arg);
+}
+
+
+
static void OptTarget (const char* Opt, const char* Arg)
/* Set the target system */
{
{ "--config", 1, OptConfig },
{ "--help", 0, OptHelp },
{ "--mapfile", 1, OptMapFile },
+ { "--start-addr", 1, OptStartAddr },
{ "--target", 1, OptTarget },
{ "--version", 0, OptVersion },
};
case 'v':
switch (Arg [2]) {
- case 'm': VerboseMap = 1; break;
- case '\0': ++Verbose; break;
+ case 'm': VerboseMap = 1; break;
+ case '\0': ++Verbose; break;
default: UnknownOption (Arg);
}
break;
case 'L':
switch (Arg [2]) {
case 'n': LabelFileName = GetArg (&I, 3); break;
- case 'p': WProtSegs = 1; break;
+ case 'p': WProtSegs = 1; break;
default: UnknownOption (Arg); break;
}
break;
case 'S':
- StartAddr = CvtNumber (Arg, GetArg (&I, 2));
+ OptStartAddr (Arg, GetArg (&I, 2));
break;
case 'V':