www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/07/13:50:30

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: <Pine DOT NEB DOT 3 DOT 93 DOT 960726171833 DOT 18376B-100000 AT ananke DOT amu DOT edu DOT pl> <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
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019