Mail Archives: djgpp/1997/08/03/16:49:52
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 -