Xref: news2.mv.net comp.os.msdos.djgpp:6823 From: malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor) Newsgroups: comp.os.msdos.djgpp Subject: Re: __attribute__((section)) Date: Mon, 29 Jul 1996 20:28:04 GMT Organization: Grafik Software Lines: 31 Message-ID: <4tjatp$33a@news.manawatu.gen.nz> References: <838478248 DOT 10640 DOT 0 AT abwillms DOT demon DOT co DOT uk> Reply-To: malcolm AT manawatu DOT gen DOT nz NNTP-Posting-Host: malcolm.manawatu.gen.nz Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams) wrote: >While we're at it, if we can put things easily into different >sections, wouldn't that provide a nice easy method of locking memory >for hardware interrupt handlers? Stick everything in a '.lock' >section, with sentinel labels in it so that a "lock_everything()" call >could lock the entire (guaranteed contiguous) section? >BTW, is there a better way of getting the extent of a section? Some >trickery with the linker ADDR and SIZE commands? This seems to be quite a good idea. You would probably want a lock_text and .lock_data section, and then you write a new linker script file that just places these at the begining (or end) of the text and .data sections respectively and defines the symbols TextLockStart etc or similar. This is actually what happens for the constructors in djgpp as the linker script file defines the start and end of them. eg. ... TextLockStart = . ; *(.ltext) TextLockEnd = . ; ... inside the text section, .ltext is the section name. Malcolm