X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Rod Pemberton Newsgroups: comp.os.msdos.programmer,comp.os.msdos.djgpp Subject: Re: linker error segment_text exceeds 64k in c Date: Fri, 23 Jun 2017 20:49:18 -0400 Organization: Aioe.org NNTP Server Lines: 43 Message-ID: References: <32f75ea1-2f4b-476e-a524-661bbae40ad5 AT googlegroups DOT com> <2c82f868-3721-4749-9439-159b91d3767a AT googlegroups DOT com> <0aeb15e6-767a-443b-ba24-a1c22191db02 AT googlegroups DOT com> <144gqr6md2lo5 DOT 1oia572hfg8dg DOT dlg AT 40tude DOT net> NNTP-Posting-Host: ZTD62cW/Uw8bymX5ok+0NA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse AT aioe DOT org X-Notice: Filtered by postfilter v. 0.8.2 Bytes: 2890 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 23 Jun 2017 17:56:56 +0000 (UTC) rridge AT csclub DOT uwaterloo DOT ca (Ross Ridge) wrote: > JJ wrote: (Added, comp.os.msdos.djgpp. in case someone wants to criticize.) > >Does that mean that DJGPP's C/C++ compiler only have one large > >memory model? > > DJGPP has only the 32-bit "flat" memory model. It's like the tiny > memory model except the size of its one segment is 4 gigabytes instead > of 64 kilobytes. > Actually, by default, DJGPP segments are limited to 640KB (0x0009FFFF) in size for CS, DS, ES and SS, but not FS and GS. So, you must call __djgpp_nearptr_enable() to enable 4GB segments. That will boost the limit of those four segments to 0xFFFFFFFF. FS will still be limited to 64KB and GS will still be limited to 1MB+64KB. The base for the four main segments is 1MB, not zero. GS' base is zero. FS' base varies, usually around 0x7C00. This is true for all 3 compatible DPMI hosts: CWSDPMI, CWSDPR0, and PMODEDJ. You can change the base and privileges of the selectors using other calls. CS (code segment) is used by _my_cs() and _go32_my_cs(). DS (data segment) is used by _my_ds() and _go32_my_ds(). SS (stack segment) is used for _my_ss() and _go32_my_ss(). ES (extra segment) is used for the PSP selector. GS is used for __djgpp_dos_sel, _dos_ds, _go32_info_block.selector_for_linear_memory, _go32_conventional_mem_selector(). GS is used by libc for the segment 1MB+64KB, e.g., for real-mode DOS or BIOS or VGA routines. __djgpp_ds_alias mirrors DS' settings and is used for RMCB's. FS is used for far pointers (farpeek, farpoke). Rod Pemberton -- The entire idea that the U.S. government obtained information from deep sources in the Russian government that Putin ordered a cyber campaign to disrupt our democracy is itself dezinformatsiya. Wake up sheeple.