CVS commit: src/sys/arch/atari/stand/binpatch

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 17:08:16 UTC 2016

Modified Files:
src/sys/arch/atari/stand/binpatch: binpatch.c

Log Message:
Catch up with mdsetimage changes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/binpatch/binpatch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/stand/binpatch/binpatch.c
diff -u src/sys/arch/atari/stand/binpatch/binpatch.c:1.6 src/sys/arch/atari/stand/binpatch/binpatch.c:1.7
--- src/sys/arch/atari/stand/binpatch/binpatch.c:1.6	Thu Aug 20 11:14:49 2009
+++ src/sys/arch/atari/stand/binpatch/binpatch.c	Thu Sep 22 13:08:16 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: binpatch.c,v 1.6 2009/08/20 15:14:49 tsutsui Exp $ */
+/* $NetBSD: binpatch.c,v 1.7 2016/09/22 17:08:16 christos Exp $ */
 
 /*-
  * Copyright (c) 2009 Izumi Tsutsui.  All rights reserved.
@@ -60,7 +60,7 @@ __COPYRIGHT("@(#) Copyright (c) 1996\
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: binpatch.c,v 1.6 2009/08/20 15:14:49 tsutsui Exp $");
+__RCSID("$NetBSD: binpatch.c,v 1.7 2016/09/22 17:08:16 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -79,7 +79,6 @@ __RCSID("$NetBSD: binpatch.c,v 1.6 2009/
 
 #include "extern.h"
 
-int		main(int, char *[]);
 static void	usage(void) __dead;
 
 bool replace, verbose;
@@ -88,20 +87,10 @@ char *symbol;
 size_t size;
 uint64_t val;
 	
-#ifdef NLIST_AOUT
-/*
- * Since we can't get the text address from an a.out executable, we
- * need to be able to specify it.  Note: there's no way to test to
- * see if the user entered a valid address!
- */
-int	T_flag_specified;	/* the -T flag was specified */
-u_long	text_start;		/* Start of kernel text */
-#endif /* NLIST_AOUT */
-
 static const struct {
 	const char *name;
 	int	(*check)(const char *, size_t);
-	int	(*findoff)(const char *, size_t, u_long, size_t *);
+	int	(*findoff)(const char *, size_t, u_long, size_t *, u_long);
 } exec_formats[] = {
 #ifdef NLIST_AOUT
 	{	"a.out",	check_aout,	findoff_aout,	},
@@ -139,8 +128,10 @@ main(int argc, char *argv[])
 	uint64_t uval64;
 	int64_t  sval64;
 	int ch, fd, rv, i, n;
+	u_long	text_start;		/* Start of kernel text (a.out) */
 
 	setprogname(argv[0]);
+	text_start = (unsigned long)~0;
 
 	while ((ch = getopt(argc, argv, "bwldT:a:s:o:r:v")) != -1)
 		switch (ch) {
@@ -182,15 +173,8 @@ main(int argc, char *argv[])
 			verbose = true;
 			break;
 		case 'T':
-#ifdef NLIST_AOUT
-			T_flag_specified = 1;
 			text_start = strtoul(optarg, NULL, 0);
 			break;
-#else
-			fprintf(stderr, "%s: unknown option -- %c\n",
-			getprogname(), (char)ch);
-			/*FALLTHROUGH*/
-#endif /* NLIST_AOUT */
 		case '?':
 		default:
 			usage();
@@ -251,15 +235,13 @@ main(int argc, char *argv[])
 	if (verbose) {
 		fprintf(stderr, "%s is an %s binary\n", fname,
 		exec_formats[i].name);
-#ifdef NLIST_AOUT
-		if (T_flag_specified)
+		if (text_start != (u_long)~0)
 			fprintf(stderr, "kernel text loads at 0x%lx\n",
 			text_start);
-#endif
 	}
 
 	if ((*exec_formats[i].findoff)(mappedfile, sb.st_size,
-	addr, ) != 0)
+	addr, , text_start) != 0)
 		errx(EXIT_FAILURE, "couldn't find file offset for %s in %s",
 		symbol != NULL ? nl[0].n_name : "address" , fname);
 
@@ -365,11 +347,7 @@ usage(void)
 {
 
 	fprintf(stderr,
-	"usage: %s [-b|-w|-l|-d] [-a address | -s symbol] [-o offset]\n"
-	"[-r value] "
-#ifdef NLIST_AOUT
-	"[-T text_start] "
-#endif
-	"[-v] binary\n", getprogname());
+	"Usage: %s [-b|-w|-l|-d] [-a address | -s symbol] [-o offset]"
+	" [-r value] [-T text_start] [-v] binary\n", getprogname());
 	exit(EXIT_FAILURE);
 }



CVS commit: src/sys/arch/atari/stand/binpatch

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 17:08:16 UTC 2016

Modified Files:
src/sys/arch/atari/stand/binpatch: binpatch.c

Log Message:
Catch up with mdsetimage changes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/binpatch/binpatch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/atari/stand/binpatch

2010-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May 10 15:10:54 UTC 2010

Modified Files:
src/sys/arch/atari/stand/binpatch: Makefile

Log Message:
Include bsd.own.mk before ${NETBSDSRCDIR}.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/binpatch/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/stand/binpatch/Makefile
diff -u src/sys/arch/atari/stand/binpatch/Makefile:1.6 src/sys/arch/atari/stand/binpatch/Makefile:1.7
--- src/sys/arch/atari/stand/binpatch/Makefile:1.6	Thu Aug 20 15:14:49 2009
+++ src/sys/arch/atari/stand/binpatch/Makefile	Mon May 10 15:10:54 2010
@@ -1,21 +1,21 @@
-#	$NetBSD: Makefile,v 1.6 2009/08/20 15:14:49 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.7 2010/05/10 15:10:54 tsutsui Exp $
 
 BINDIR?= /sbin
 WARNS?=	4
+NOMAN=
+
+.include bsd.own.mk
 
 PROG=	binpatch
 SRCS=	binpatch.c
 SRCS+=	exec_aout.c exec_ecoff.c exec_elf32.c exec_elf64.c exec_coff.c
 
 #MAN=	binpatch.8	# currently it's in src/share/man/man8/man8.atari
-NOMAN=
 
 MDSETIMAGE=${NETBSDSRCDIR}/usr.sbin/mdsetimage
 CPPFLAGS+= -I${MDSETIMAGE}
 .PATH:	${MDSETIMAGE}
 
-.include bsd.own.mk	# for ${MACHINE_CPU}
-
 .if	${MACHINE_ARCH} == alpha
 CPPFLAGS+=-DNLIST_ECOFF
 CPPFLAGS+=-DNLIST_ELF64



CVS commit: src/sys/arch/atari/stand/binpatch

2010-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May 10 15:10:54 UTC 2010

Modified Files:
src/sys/arch/atari/stand/binpatch: Makefile

Log Message:
Include bsd.own.mk before ${NETBSDSRCDIR}.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/binpatch/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.