From: Robert Hoehne Newsgroups: comp.os.msdos.djgpp Subject: Re: Assembler Help!! Date: Fri, 21 Mar 1997 11:45:28 +0100 Organization: TU Chemnitz-Zwickau Lines: 64 Message-ID: <333266C8.2C73@Mathematik.tu-chemnitz.de> References: <332D8B17 DOT 41C67EA6 AT iet DOT unipi DOT it> NNTP-Posting-Host: errno.hrz.tu-chemnitz.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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 * *****************************************************************