Mail Archives: djgpp/1997/03/21/07:14:08
Francesco Marcelloni wrote:
>
> Hello,
>
> I am a user of *386 assembler "as".
> I read in the "as" manual that it is possible to create several sections
> by directive ".section name".
> I'd like to use several data sections in my program, but I have the
> following problem.
At first you should (at least for me) clearify more what
you realy want.
Do want only multiple sections and/or in the final
linked program multiple data sections where each
get a different selector?
I have only only a solution if you want to have multiple
sections in the object files, but only one data section
in the executable. For this you can use the code as you
posted it and assume that the selector is "%ds". But
for linking you have to modify the "djgpp.djl" file
to tell the linker, where to link your additional sections.
It should be something like this:
OUTPUT_FORMAT("coff-go32")
ENTRY(start)
SECTIONS
{
.text 0x1000+SIZEOF_HEADERS : {
*(.text)
etext = . ; _etext = .;
. = ALIGN(0x200);
}
.data ALIGN(0x200) : {
*(proof1)
*(proof2)
djgpp_first_ctor = . ;
*(.ctor)
djgpp_last_ctor = . ;
djgpp_first_dtor = . ;
*(.dtor)
djgpp_last_dtor = . ;
*(.data)
edata = . ; _edata = .;
. = ALIGN(0x200);
}
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
*(COMMON)
end = . ; _end = .;
. = ALIGN(0x200);
}
}
Robert
--
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -