Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: elange AT thegrid DOT net, djgpp AT delorie DOT com Date: Mon, 26 Jan 1998 10:25:34 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Flexible Linking for GCC? In-reply-to: <34CAEB55.6CEC1041@thegrid.net> Precedence: bulk Eric Lange wrote: > I need to do some 32-bit programming under DOS, but not with DPMI > compliance. So far, I have been doing all of my development using MASM > 6.11, because only an assembler gives me the flexibility I need. > However, my development time is too long, and I need to develop an SDK > for other users (my application is an OS-extender). > > I want to be able to develop in C/C++ for obvious reasons. But, all I > need the compiler to do is generate 32-bit code under some set of > assumptions. I also want the linker to allow me to replace all of the > startup code, so I can load it any way I choose. Basically, I just need > to know the compiler assumptions. > > For example: > > * All code in a single code segment (just need to know the size) > * All heap, global and static in a single DS > * All stack in a single SS (DS == SS is okay) > > I believe that just about any compiler (including GCC for DJGPP) can do > this. It's the linker that needs to provide me with flexibility. I do > not need any of the OS-service libraries (I won't use StdIO.H, Malloc.H, > or Stream.H), and I won't need any DPMI services. I just need 32-bit > compiled code linked with my own assembly objects. Does the DJGPP > linker allow me to have some sort of linker definition file? Does it > provide the flexibility I need? Is there another linker out there that > does? For Watcom, Microslop, or Borland? Any experience with this? > > Any help is deeply appreciated. You can configure ld to arrange the code in a lot of ways. Take a look to the djgpp.djl (or similar file) in the lib directory. The info file of ld explains how this file works. But you will need to learn how the COFF format generated by djgpp is arranged. You can get an idea from: 1) DJ's server (COFF spec) 2) The STUB used by DJGPP is a COFF loader for a DPMI enviroment. 3) The help (.inf) files. 4) The sources of the linker/compiler/debuger. I think you can do it. You just need to replace the stub by some code to start the protected mode and load the COFF image. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013