Establishing exception handlers before main()

tmoog@mcs.com (Thomas H. Moog)
Thu, 29 Sep 1994 02:27:57 GMT

          From comp.compilers

Related articles
Linker ... still useful ? guerin@IRO.UMontreal.CA (1994-09-21)
Re: Linker ... still useful ? jan@neuroinformatik.ruhr-uni-bochum.de (1994-09-28)
Establishing exception handlers before main() tmoog@mcs.com (1994-09-29)
| List of all articles for this month |

Newsgroups: comp.compilers
From: tmoog@mcs.com (Thomas H. Moog)
Keywords: linker
Organization: Compilers Central
References: 94-09-122 94-09-170
Date: Thu, 29 Sep 1994 02:27:57 GMT

The VMS linker's initialization vector can be used to establish mulitple,
nested, exception handlers prior to the execution of main().


The init vector consists of a series of function address. When an
init-routine is called it is passed the address of the next element in the
init vector. The routine can (1) execute a "return" which results in the
system calling the next element in the vector or (2) it can execute a
function call to the next element in the vector (with an appropriate
argument for the next element in the init vector) which results in a
nesting of the functions. If the routines establish exception handlers
before executing a "call" to the next routine in the sequence then the
handlers will be nested. The "main" routine is the last element in the
init-vector, and it is followed by a 0.


I don't think C++ has anyway of establishing a "try" block which includes
main() - even with the use of static initializers.


The linker can also change psect attributes - for instance making a COMMON
block shareable among multiple tasks (when properly installed) or making a
COMMON block process private even when the program is shared among
multiple tasks.


Tom Moog
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.