diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2022-12-21 09:05:32 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2023-01-01 09:29:07 +0000 |
commit | d423e8dc59045d8f281dcb1a02559cb6f91456bf (patch) | |
tree | 088b25509669b82ce774366aeeee36662a457631 | |
parent | 90323d0b4b9f7eeba6c044498346257db82fb024 (diff) | |
download | gcc-d423e8dc59045d8f281dcb1a02559cb6f91456bf.zip gcc-d423e8dc59045d8f281dcb1a02559cb6f91456bf.tar.gz gcc-d423e8dc59045d8f281dcb1a02559cb6f91456bf.tar.bz2 |
modula2: Ensure that module registration constructors are 'extern' [PR108183].
The symbols for module registration constructors need to be external
or we get wrong code generated for targets that allow direct access to
local symbol definitions.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR modula2/108183
gcc/m2/ChangeLog:
* gm2-compiler/M2GCCDeclare.mod: Module registration constructors are
externs to the builder of m2_link.
Co-Authored-By: Gaius Mulley <gaiusmod2@gmail.com>
-rw-r--r-- | gcc/m2/gm2-compiler/M2GCCDeclare.mod | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/m2/gm2-compiler/M2GCCDeclare.mod b/gcc/m2/gm2-compiler/M2GCCDeclare.mod index 7e814b6..d784fbc 100644 --- a/gcc/m2/gm2-compiler/M2GCCDeclare.mod +++ b/gcc/m2/gm2-compiler/M2GCCDeclare.mod @@ -2294,6 +2294,11 @@ PROCEDURE IsExternal (sym: CARDINAL) : BOOLEAN ; VAR mod: CARDINAL ; BEGIN + Assert (NOT IsDefImp (sym)) ; + IF IsProcedure (sym) AND IsExtern (sym) + THEN + RETURN TRUE + END ; mod := GetScope(sym) ; REPEAT IF mod=NulSym |