| 1 |
(* M2RTS.def implement the smallest number of routines for linking. |
| 2 |
|
| 3 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 4 |
Contributed by Gaius Mulley <[email protected]>. |
| 5 |
|
| 6 |
This file is part of GNU Modula-2. |
| 7 |
|
| 8 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 14 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
General Public License for more details. |
| 17 |
|
| 18 |
Under Section 7 of GPL version 3, you are granted additional |
| 19 |
permissions described in the GCC Runtime Library Exception, version |
| 20 |
3.1, as published by the Free Software Foundation. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License and |
| 23 |
a copy of the GCC Runtime Library Exception along with this program; |
| 24 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 25 |
<http://www.gnu.org/licenses/>. *) |
| 26 |
|
| 27 |
DEFINITION MODULE M2RTS ; |
| 28 |
|
| 29 |
(* Implement the smallest number of routines to enable GNU Modula-2 |
| 30 |
to link an executable (possibly targetting tiny embedded systems). *) |
| 31 |
|
| 32 |
FROM SYSTEM IMPORT ADDRESS ; |
| 33 |
|
| 34 |
TYPE |
| 35 |
ArgCVEnvP = PROCEDURE (INTEGER, ADDRESS, ADDRESS) ; |
| 36 |
|
| 37 |
|
| 38 |
(* |
| 39 |
all these procedures do nothing except satisfy the linker. |
| 40 |
*) |
| 41 |
|
| 42 |
PROCEDURE ConstructModules (applicationmodule, libname: ADDRESS; |
| 43 |
argc: INTEGER; argv, envp: ADDRESS) ; |
| 44 |
|
| 45 |
PROCEDURE DeconstructModules (applicationmodule, libname: ADDRESS; |
| 46 |
argc: INTEGER; argv, envp: ADDRESS) ; |
| 47 |
|
| 48 |
|
| 49 |
(* |
| 50 |
RegisterModule - adds module name to the list of outstanding |
| 51 |
modules which need to have their dependencies |
| 52 |
explored to determine initialization order. |
| 53 |
*) |
| 54 |
|
| 55 |
PROCEDURE RegisterModule (name, libname: ADDRESS; |
| 56 |
init, fini: ArgCVEnvP; |
| 57 |
dependencies: PROC) ; |
| 58 |
|
| 59 |
(* |
| 60 |
RequestDependant - used to specify that modulename is dependant upon |
| 61 |
module dependantmodule. |
| 62 |
*) |
| 63 |
|
| 64 |
PROCEDURE RequestDependant (modulename, libname, |
| 65 |
dependantmodule, dependantlibname: ADDRESS) ; |
| 66 |
|
| 67 |
PROCEDURE ExecuteTerminationProcedures ; |
| 68 |
PROCEDURE ExecuteInitialProcedures ; |
| 69 |
PROCEDURE HALT <* noreturn *> ; |
| 70 |
PROCEDURE NoException (filename: ADDRESS; |
| 71 |
line, column: CARDINAL; scope, message: ADDRESS) ; |
| 72 |
|
| 73 |
|
| 74 |
END M2RTS. |