Mail Archives: djgpp/1996/03/14/18:53:06
Xref: | news2.mv.net comp.os.msdos.djgpp:1850
|
From: | Shawn Hargreaves <slh100 AT york DOT ac DOT uk>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | "start" and "end" symbols?
|
Date: | Thu, 14 Mar 1996 19:09:05 +0000
|
Organization: | The University of York, UK
|
Lines: | 26
|
Message-ID: | <Pine.SGI.3.91.960314190441.24601E-100000@tower.york.ac.uk>
|
NNTP-Posting-Host: | tower.york.ac.uk
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I notice that the file dpmiexep.c in the djgpp C library refers to a
symbol called "end" (this is the asm name, there is no underbar added
when used from C). In looking through nm dumps of djgpp programs, I find
that they all have a "start" before the other symbols, and an "end" after
the last one. What is the deal with these? Are they added by the linker?
It occurs to me that they could be very useful as a way of locking
interrupt handler code. Locking data is easy, but locking functions is
really awkward because there is no reliable way to determine the size of
the function. Inserting dummy functions after each routine that needs
locking works most of the time, but depends on the compiler and linker
leaving your functions in the same order they were defined in.
So, is there any reason why I couldn't just lock all the memory from
&start, for (&end - &start) bytes, to include all the functions in my
program? That would prevent _any_ code from being swapped, but virtual
memory would still work for malloced data, and it would be a lot more
reliable than my current approach.
..---------------------------------------------------------------.
| Shawn Hargreaves | Why is 'phonetic' spelt with a ph? |
|---------------------------------------------------------------|
| Check out Allegro and FED on http://www.york.ac.uk/~slh100/ |
`---------------------------------------------------------------'
- Raw text -