Date: Sun, 22 Sep 1996 13:13:54 -0400 (EDT) From: Kevin Moule Reply-To: Kevin Moule To: "esAlaric B. Williams" cc: djgpp AT delorie DOT com Subject: Re: COFF and ELF exec formats In-Reply-To: <843321026.852.0@abwillms.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 21 Sep 1996, Alaric B. Williams wrote: > Kevin Moule wrote: > > > >2) Would is be possible and/or practical for DJGPP to use the ELF > >exec format? It seems to make loadable modules a breeze. I wouldn't > >even touch shared libraries in linux until I moved to an ELF based > >system. > > For my enlightenment and, I expect, many other people's, could you > briefly outline the reason why this is? I've never seen the specs for > either! > From what I understand ( and I'm no expert ) the ELF binary format generates position independant code (PIC) for shared libraries. All the symbols in the PIC are referenced via a base pointer ( on the x86 this is the ebx register ). So when an application is linked with a shared library only the shared library name and symbol are added to the finaly exec. When the app is run, the dynamic linker will map the shared library into the program's virtual address space and resolve all symbols. The great thing about this is that the PIC code that was generated for the shared library is position independant meaning that it is very easy is to relocate it and map it into the programs address space. This is my rudimentary understanding of this and may be a little wrong and over simplified. The best thing about all this is that its already been implemented for linux, and would require only a port to DJGPP. But this gets back to my original message, is it possible and/or practical to port this to DJGPP? Kevin -