delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/07/27/14:02:51

Date: Mon, 27 Jul 92 12:14:48 -0500
From: rcharif AT math DOT utexas DOT edu
Posted-Date: Mon, 27 Jul 92 12:14:48 -0500
To: alvin AT eyepoint DOT on DOT ca
Cc: hideki AT isl DOT rdc DOT toshiba DOT co DOT jp, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: cross compilation for DJ1.0x
Reply-To: rcharif AT math DOT utexas DOT edu

    > for go32 --- text does not start at 0x20.  Is this a bug?

    On the other issue the text should start at 0x1020 and not 0x20. This is because
    the first page of memory(4K,0x1000) is left unallocated forcing any referances
    to it to  cause a page fault, so that null pointer referances will cause
    a trapable error. 

One thing to bare in mind. DJ changed the a.out format so that text
starts at physical offset 0x20 in the file. Usually in ZMAGIC a.out
files (magic number == 0413) have their text starting at physical
offset 0x1000 in the file. You will need to patch go32 file paging.c
and set the areas[0].foffset and areas[1].foffset to the right offset
values, otherwise go32 will load 0x1000 - 0x20 null characters and
tries to execute them as if they were the start routine. You can
verify that by using debug32 and setting a breakpoint at start. You
will find zeroes unless you patch paging.c.

The only problem is that it is not enough. When I applied the patch I
found that my program starts without any problem but when I try to
call malloc it craches, so there must be more than that to do.

The version binutils-920602 doesn't work very well. I prefer version
binutils-1.97 from alpha.gnu.ai.mit.edu (128.52.46.26). It is a little
bit older but works better on SPARC stations, the binutils-920602
craches with a segmentation violation.

Rami El Charif

- Raw text -


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