www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/16/12:34:32

From: Michael Castle <mcastle AT umr DOT edu>
Subject: Re: Successful port of DLD?
To: nolasco AT who DOT ch (Perfecto NOLASCO)
Date: Wed, 16 Feb 1994 11:11:08 -0600 (CST)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

> 
> 	Hello to all!
> 
> 	Has anyone out there been able to successfully port DLD using
> DJGPP? I still haven't had much luck (too busy with bread-and-butter 
> work). I heard there was a new version (3.2.4) available for Linux. 
> I ought to look into that once I find the time ...


I did a port of DLD using DJGPP 1.09.  I put it out on the net somewhere,
but I don't remember where.  I no longer use DJGPP, and don't have what
changes I made to DLD handy.  

I was communicating with someone else on this list (John Fischer I think)
who was working on adding minimal C++ support to DLD (name demangling).
Hopefully he'll respond with pointers to where it is.  

I put it into what I thought was an upload location for djgpp related
material, but either I was mistaken or it was deemed unimportant and never
incorporated into the djgpp distribution.

Some pointers off the top of my head, though, if someone wants to do a new
port:

DLD-3.2.3 only worked with a.out style files; coff was not supported.
(This may have changed with the Linux stuff; I've no idea).  I imagine that
this will be the major sticking point.  (This was also mentioned in the
TODO list for DLD-3.2.3, btw).  

I had to modify one of the system header files (aout.h, I believe) because
it was missing a define (N_COMM, I believe).  I simply pulled this value out 
of one of the header files that came with one of the gnu packages (fileutil
or textutil, but I think it was fileutil).  This may be a non problem now
if DJ is using newer versions of header files.  *shrug*  this may also be a
non problem since gcc now produces COFF files rather than a.out style
files.

I added some simple code to handle parsing of dos style path names as well
as unix styles.  That is, handle both backward and forward slash, and also
to handle semi-colon as separators, and to handle the colon as 2nd char as
indicating a specific drive.  

I also stole some code from go32 to skip the prepended dos excutable header
(either stub.exe or go32.exe).  This allowed dld to work with straight
a.out file, or stubbed to go32ed files.  Just remember, you can NOT strip
the a.out code if you want to use it with dld, even if this does make for
much larger executables.

The port worked reasonably well; only one example (reload-test) did not
work.  In debugging the code for this example, I kept getting unresolved
references to ctor_list and dtor_list.  At the time I was C++ illiterate,
but I now suspect that these are contructor/destructor lists.  I believe
these are linked in from crt0.o.  In this example, the entire current
program is unlinked, then a new, different program is linked in.  This
different program is not completely linked (that is, it hasn't been linked
with crt0.o) and so these last couple things are missing.  Hurm.. I just
now thought of it... these *might* be able to be resolved if libc.a is
dynamically linked in.... *shrug*


One drawback of 
Anyway... the port was fairly easy to do.  But, since the change in djgpp to
coff format (why was this anyway?), that next person to port it will face a
greater challenge. 

mrc


- Raw text -


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