Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199911050530.XAA03616@mercury.xraylith.wisc.edu> To: "Jon Leichter" cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Specifying a base address In-Reply-To: Your message of "Thu, 04 Nov 1999 20:54:02 PST." <000001bf2749$c7e9afe0$a0418218 AT bass DOT we DOT mediaone DOT net> Date: Thu, 04 Nov 1999 23:30:11 -0600 From: Mumit Khan "Jon Leichter" writes: > Forgive me if this has been asked before. I searched the archives but didn't > come up with an answer. > > With the Cygwin set of compiler utilities, how does one go about setting the > base image address for a DLL? Pass the --image-base= to the linker. If you're using GCC to create the DLL, use -Wl,--image-base= $ gcc -Wl,--image-base=0x66000000 [... rest ...] > Is there a particular tool that I can use to change the base image address > after the DLL is built? For instance, MSVC provides a tool called EDITBIN tha > t > does just that. (By the way, I tried to use EDITBIN on a DLL that I built wit > h > gcc, and EDITBIN failed). EDITBIN has always worked for me, so perhaps something is wrong with the DLL (eg,. due to a bug in the linker)? There's also REBASE, but I've never used it. > If there is no tool, is there a way to specify the base address at link time? > Do I need to provide a .def file for this? You can use a .DEF file, but I prefer either (1) using dllwrap, which takes an --image-base parameter, and if not supplied, creates an image base by hashing the output filename, or (2) supply -Wl,--image-base to GCC or --image-base to the linker. See the documentation on the linker (ld) for more info. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com