delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/03/16:49:52

Date: Mon, 04 Aug 1997 08:50:05 +1100
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: .section
In-reply-to: <33DC6F7B.399A@israel.sun.com>
To: aharon AT israel DOT sun DOT com, djgpp AT delorie DOT com
Message-id: <199708032054.IAA12675@teleng1.tait.co.nz gatekeeper.tait.co.nz>
Organization: Tait Electronics Limited
MIME-version: 1.0
Comments: Authenticated sender is <billc AT blackmagic DOT tait DOT co DOT nz>

On 28 Jul 97 at 13:07, Aharon Beyo Eng. wrote:

> Does anyone know why the directive ".section" for the "as" compiler
> does not work in dos? Is there anyway to get around this

It does. It's just that your extra sections are not linked in by 
default and the stub only loads the `.text' and `.data' sections 
(`.bss' is only allocated and later zeroed).  To get your sections 
linked in, you have to provide a modified linker script.  Here's a 
sample that includes `.ltext' and `.ldata':


OUTPUT_FORMAT("coff-go32")
ENTRY(start)
SECTIONS
{
  .text  0x1000+SIZEOF_HEADERS : {
    *(.text)
    etext  =  . ; _etext = .;
    sltext = . ;
    *(.ltext)
    eltext = . ;
    . = ALIGN(0x200);
  }
  .data  ALIGN(0x200) : {
    djgpp_first_ctor = . ;
    *(.ctor)
    djgpp_last_ctor = . ;
    djgpp_first_dtor = . ;
    *(.dtor)
    djgpp_last_dtor = . ;
    *(.data)
     edata  =  . ; _edata = .;
    sldata = . ;
    *(.ldata)
    eldata = . ;
     . = ALIGN(0x200);
  }
  .bss  SIZEOF(.data) + ADDR(.data) :
  { 					
    *(.bss)
    *(COMMON)
     end = . ; _end = .;
     . = ALIGN(0x200);
  }
}

Note: there is a bug in gas 2.8.1 that causes it to have probles with 
`call's in other code sections.  I have the patch (and recompiled 
as.exe) to fix this and I can email it if it's needed.

Bill
--
Leave others their otherness.

- Raw text -


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