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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user