From 65e7c711f6847692dc17ec1fb6d49b1181f398ac Mon Sep 17 00:00:00 2001 From: mw Date: Wed, 26 Jan 1994 21:13:15 +0000 Subject: [PATCH] Updated from current amiga branch. --- sys/arch/amiga/stand/binpatch/binpatch.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/arch/amiga/stand/binpatch/binpatch.c b/sys/arch/amiga/stand/binpatch/binpatch.c index 6f96f745e0b5..e1fb52de3b92 100644 --- a/sys/arch/amiga/stand/binpatch/binpatch.c +++ b/sys/arch/amiga/stand/binpatch/binpatch.c @@ -19,7 +19,7 @@ main(argc, argv) { struct exec e; int c; - u_long addr = 0; + u_long addr = 0, offset = 0; u_long replace = 0, do_replace = 0; char *symbol = 0; char size = 4; /* default to long */ @@ -31,7 +31,7 @@ main(argc, argv) u_char cval; - while ((c = getopt (argc, argv, "a:bwlr:s:")) != EOF) + while ((c = getopt (argc, argv, "a:bwlr:s:o:")) != EOF) switch (c) { case 'a': @@ -70,6 +70,15 @@ main(argc, argv) error ("only one address/symbol allowed"); symbol = optarg; break; + + case 'o': + if (offset) + error ("only one offset allowed"); + if (! strncmp (optarg, "0x", 2)) + sscanf (optarg, "%x", &offset); + else + offset = atoi (optarg); + break; } argv += optind; @@ -108,6 +117,7 @@ main(argc, argv) else if (addr >= N_DATADDR(e) && addr < N_DATADDR(e) + e.a_data) type = N_DATA; } + addr += offset; /* if replace-mode, have to reopen the file for writing. Can't do that from the beginning, or nlist() will not