delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/26/11:37:46

Date: Tue, 26 Aug 1997 17:37:00 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Subject: ELF binaries (was Re: Function Sizes)
To: chirayu AT radiolink DOT net (Chirayu Krishnappa)
Cc: djgpp AT delorie DOT com
Message-id: <01IMWJQGABH88WX7LN@mail>
Organization: RWTH Aachen, III. physikalisches Institut B
Newsgroups: comp.os.msdos.djgpp

In article <1 DOT 5 DOT 4 DOT 16 DOT 19970826145204 DOT 121fc6c8 AT giasbga DOT vsnl DOT net DOT in> 
Chirayu Krishnappa wrote:

> Also, I hear a lot that elf binaries r better. 

I don't know where you heard this, but in the context of DJGPP this is
not really true. It's a matter of theory and practisc: In theory, ELF
is superior by far, but in practice, it's useless right now.

> I want to use them. I
> could'nt find references to elf in the faq. 

That's because, currently, ELF binaries are simply not an option for
DJGPP: they simply cannot be used at all, and I haven't heard of
anyone seriously working on making them work, either. And without a
way to execute ELF binaries, there's not much to be gained from using
ELF .o files either.

[remaining questions snipped away]

There have been several questions and discussion threads about 'why
not simply switch to ELF?' in the DJGPP community. Mostly, they got
triggered by some of the problems the currently used file format COFF
causes, like 

1) no more than 64K lines with debugging information in a program
2) stock DJGPP gcc and gdb won't let you debug into code that
    is not in the source file compiled, but instead in some included
    file (C++ inlines, in particular), or 
3) for a C file generated from some other source (by tools like bison,
    flex or f2c, e.g.), gdb won't show the 'original' source, but
    instead the .c file, but it uses the line numbers from the 
    original source, messing things up completely.

(BTW: 2) can be fixed by using stabs debugging info, and 3) by appying
  another little patch to gcc from R.Hoehne, so only 1) is a *real*
  problem)

Well, the answer to all of these discussions is that gcc, gdb and
binutils do support ELF almost out of the box (or could be changed to
do so without a big effort), but the DJGPP startup code, and
considerable portions of the libc as well, would have to be rewritten
almost from scratch. The structure of an ELF binary is quite a bit
more complicated than that of a COFF one, so the new startup code
would almost certainly be more than the currently used 2048 bytes
long.  And, as already said, no-one turned up yet to take this quite
hard task.

HBB

- Raw text -


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