Path: utzoo!attcan!uunet!lll-winken!tekbspa!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.sys.ibm.pc Subject: Re: Replacing a Microsoft C library routine Keywords: C, Microsoft, link Message-ID: <784@optilink.UUCP> Date: 9 Jan 89 18:04:10 GMT References: <5041@b-tech.ann-arbor.mi.us> Organization: Optilink Corporation, Petaluma, CA Lines: 53 In article <5041@b-tech.ann-arbor.mi.us>, zeeff@b-tech.ann-arbor.mi.us (Jon Zeeff) writes: > For a few programs I've written, I believe that I need to disable > calls to chkstk (I'm calling microsoft C routines from an interrupt > handler). I know about the /Gs option, but I'm concerned that the > library routines might also call it. > > The best solution seems to be to write a null chkstk routine and link > it in. This creates an error message about multiply defined symbols. > Is there any way to get the linker to quietly use the first chkstk > routine it finds? > > I've tried removing chkstk from the library with -chkstk, but this seems > to remove some other needed routine or variable (STKHQQ). > > Are there any other ways to make sure that no routine calls chkstk? > > Jon Zeeff zeeff@b-tech.ann-arbor.mi.us Writing your own null chkstk function doesn't work because the real chkstk function defines STKHQQ. Here's what I'm using to deal with all those library functions that call chkstk: TITLE CHKSTK.ASM: Replacement For CHKSTK PAGE 122,132 DOSSEG .MODEL LARGE .CODE SUBTTL __chkstk: Replacement chkstk public __chkstk public STKHQQ __chkstk proc far pop cx pop dx sub sp,ax push dx push cx retf __chkstk endp .DATA STKHQQ dw 0 end -- Clayton E. Cramer {pyramid,pixar,tekbspa}!optilink!cramer Disclaimer? You must be kidding! No company would hold opinions like mine!