bin/84911: [patch] ndisgen can't cope with .sys-files that begins with a number

Fredrik Lindberg fli+freebsd at
Sun Aug 14 15:40:29 GMT 2005

>Number:         84911
>Category:       bin
>Synopsis:       [patch] ndisgen can't cope with .sys-files that begins with a number
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 14 15:40:18 GMT 2005
>Originator:     Fredrik Lindberg
>Release:        FreeBSD 7.0-CURRENT i386
System: FreeBSD 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Tue Aug 2 19:27:22 CEST 2005 root at i386

ndisgen uses the basename of the windows drivers .sys-file as an internal
This identifier is used as variable names windrv_stub.c which is fine in
most cases, however it will fail to compile if the name of the .sys-file
begins with a number.

Pass a .sys-file which begins with a number to ndisgen.

The following patch adds a ndis_ prefix to the affected variables 

Index: ndiscvt/ndiscvt.c
RCS file: /home/ncvs/src/usr.sbin/ndiscvt/ndiscvt.c,v
retrieving revision 1.11
diff -r1.11 ndiscvt.c
< 	    "objcopy --redefine-sym _binary_%s_start=%s_drv_data_start "
> 	    "objcopy --redefine-sym _binary_%s_start=ndis_%s_drv_data_start "
< 	    "--redefine-sym _binary_%s_end=%s_drv_data_end %s.o %s.o\n",
> 	    "--redefine-sym _binary_%s_end=ndis_%s_drv_data_end %s.o %s.o\n",
< 		    "\nextern unsigned char %s_drv_data_start[];\n",
> 		    "\nextern unsigned char ndis_%s_drv_data_start[];\n",
< 		    "%s_drv_data_start;\n\n", sysfile);
> 		    "ndis_%s_drv_data_start;\n\n", sysfile);
Index: ndiscvt/
RCS file: /home/ncvs/src/usr.sbin/ndiscvt/,v
retrieving revision 1.5
diff -r1.5
< echo "	-DDRV_DATA_START=${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
< echo "	-DDRV_NAME=${SYSBASE} \\"				>> ${MAKEFILE}
< echo "	-DDRV_DATA_END=${SYSBASE}_drv_data_end"			>> ${MAKEFILE}
> echo "	-DDRV_DATA_START=ndis_${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
> echo "	-DDRV_NAME=ndis_${SYSBASE} \\"				>> ${MAKEFILE}
> echo "	-DDRV_DATA_END=ndis_${SYSBASE}_drv_data_end"			>> ${MAKEFILE}


More information about the freebsd-bugs mailing list