Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Aug 2005 17:39:15 +0200 (CEST)
From:      Fredrik Lindberg <fli+freebsd@shapeshifter.se>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/84911: [patch] ndisgen can't cope with .sys-files that begins with a number 
Message-ID:  <20050814153915.BB8C8415E@biocandy.shapeshifter.se>
Resent-Message-ID: <200508141540.j7EFeITQ061636@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 14 15:40:18 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Fredrik Lindberg
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD biocandy.shapeshifter.se 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Tue Aug 2 19:27:22 CEST 2005 root@biocandy.shapeshifter.se:/usr/obj/usr/src/sys/BIOCANDY-CURRENT i386


	
>Description:
ndisgen uses the basename of the windows drivers .sys-file as an internal
identifier.
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.

>How-To-Repeat:
Pass a .sys-file which begins with a number to ndisgen.

>Fix:
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
210c210
< 	    "objcopy --redefine-sym _binary_%s_start=%s_drv_data_start "
---
> 	    "objcopy --redefine-sym _binary_%s_start=ndis_%s_drv_data_start "
212c212
< 	    "--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",
387c387
< 		    "\nextern unsigned char %s_drv_data_start[];\n",
---
> 		    "\nextern unsigned char ndis_%s_drv_data_start[];\n",
390c390
< 		    "%s_drv_data_start;\n\n", sysfile);
---
> 		    "ndis_%s_drv_data_start;\n\n", sysfile);
Index: ndiscvt/ndisgen.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ndiscvt/ndisgen.sh,v
retrieving revision 1.5
diff -r1.5 ndisgen.sh
417,419c417,419
< 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}

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050814153915.BB8C8415E>