delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/07/23/19:02:48

Subject: Re: cross compilation for DJ1.0x
From: Alvin Starr <alvin AT eyepoint DOT on DOT ca>
To: rcharif AT math DOT utexas DOT edu
Date: Thu, 23 Jul 1992 17:54:08 -0400
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (Go32 mail server)

> The a.out format used by gld supposes that the text segment starts at
> a 0x1000 boundary in the file. DJ makes the text segment start at 0x20
> just after the exec structure. In the old binutil you just have to
> modify the a.out file and set : #define _N_HDROFF(x) 0. Unfortunately,
> I couldn't find the location to make such modification for the cross
> linker.
> 
> Another particularity is that data segment starts at 0x400000. So when
> you link give the following switch : -Tdata 0x400000, and gld will get
> you the proper data segment alignment.
> 
> Please let me know if you manage to find how to change the text
> segment offset .
> 
> You can find the latest versions of the binutils at
> 	cygnus.com:/pub
> 	alpha.gnu.ai.mit.edu (128.52.46.26)
> 
> Regards,
> Rami El Charif

The following is an linkage control file that I have been using
OUTPUT_FORMAT("a.out-i386")
OUTPUT_ARCH(i386)
ENTRY(start)
SEARCH_DIR(../lib/sunlib)
SECTIONS
        {
        .text 0x1020 :
                {
                        CREATE_OBJECT_SYMBOLS
                        *(.text)
                        _etext  =  ALIGN(0x1000);
                }
        .data ALIGN(0x400000) :
                {
                        *(.data)
                        CONSTRUCTORS
                        _edata  =  .;
                }
        .bss SIZEOF(.data) + ADDR(.data) :
                {
                        *(.bss)
                        [COMMON]
                        _end = .;
                }
        }
this seems to work but the size of the text segment is 0x20 bytes
larger than what is genrated by the loader under dos. To get around 
this problem I have pached go32, but this is not the result that
I want in the long run.
-- 
================================================================================
Alvin Starr                   ||   Seymore Cray
Eyepoint Inc.                 ||   was heard to say
alvin AT eyepoint DOT on DOT ca          ||   parity is for farmers.
voice: (416)513-6717          ||
fax:   (416)513-6718          ||(Sorry, I don't know the author)
================================================================================

- Raw text -


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