Add overlay file option to rgblink (-O)

This option takes a file and places fixed sections on top of it.
Should prove useful for patches and partial disassemblies.
This commit is contained in:
Sanqui
2016-03-28 01:02:05 +02:00
parent 2ea2e47231
commit 2e9c68f8c3
5 changed files with 74 additions and 12 deletions

View File

@@ -35,8 +35,8 @@ static void
usage(void)
{
printf(
"usage: rgblink [-t] [-m mapfile] [-n symfile] [-o outfile] [-p pad_value]\n"
" [-s symbol] file [...]\n");
"usage: rgblink [-t] [-m mapfile] [-n symfile] [-O overlay] [-o outfile] \n"
" [-p pad_value] [-s symbol] file [...]\n");
exit(1);
}
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
progname = argv[0];
while ((ch = getopt(argc, argv, "m:n:o:p:s:t")) != -1) {
while ((ch = getopt(argc, argv, "m:n:o:O:p:s:t")) != -1) {
switch (ch) {
case 'm':
SetMapfileName(optarg);
@@ -67,6 +67,10 @@ main(int argc, char *argv[])
case 'o':
out_Setname(optarg);
break;
case 'O':
out_SetOverlayname(optarg);
options |= OPT_OVERLAY;
break;
case 'p':
fillchar = strtoul(optarg, &ep, 0);
if (optarg[0] == '\0' || *ep != '\0') {