Path: csiph.com!xmission!news.alt.net!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Hans-Peter Diettrich Newsgroups: comp.compilers Subject: Re: The different groups and segments of object files Date: Sat, 20 Jun 2020 16:01:10 +0200 Organization: Compilers Central Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <20-06-006@comp.compilers> References: <20-06-004@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="42434"; mail-complaints-to="abuse@iecc.com" Keywords: object, history Posted-Date: 20 Jun 2020 16:04:01 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2527 Am 19.06.2020 um 17:22 schrieb Johann 'Myrkraverk' Oskarsson: > When I am defining my own compiler, do the traditional names of object > file segments, _TEXT, _DATA, STACK, _BSS, CONST (to name a few from the > MS manual) any meaning?  When I place my code in a _TEXT segment, the > disassembler will show a list of the instructions; this does not happen > if I name the segment FOO.  Is there any particular reason I want my > code in a _TEXT segment rather than FOO? I think that it's not the segment name that enforces special handling but segment attributes. Eventually these attributes are defined in the various segment groups only, not at segment level? It depends on the target OS and hardware whether deailed hardware protection is applied to memory segments. Code segments can be read-only or execute-only, all others non-execute. Const segments also can/should be read-only. The same protection schemes can apply to paged memory. A compiler only can assign attributes to memory sections, the use of these attributes depends on the linker and loader for the target platform. DoDi