www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/22/13:50:40

Date: Sun, 22 Sep 1996 13:13:54 -0400 (EDT)
From: Kevin Moule <krmoule AT undergrad DOT math DOT uwaterloo DOT ca>
Reply-To: Kevin Moule <krmoule AT undergrad DOT math DOT uwaterloo DOT ca>
To: "esAlaric B. Williams" <alaric AT abwillms DOT demon DOT co DOT uk>
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: <Pine.SUN.3.93.960922124049.380A-100000@napier.uwaterloo.ca>
MIME-Version: 1.0


On Sat, 21 Sep 1996, Alaric B. Williams wrote:

> Kevin Moule <krmoule AT undergrad DOT math DOT uwaterloo DOT ca> wrote:
> 
	<snip>
> 
> >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
-


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019