]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
modula-2: Module registration constructors need to be visible [PR108259].
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 1 Jan 2023 15:42:03 +0000 (15:42 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 4 Jan 2023 14:53:07 +0000 (14:53 +0000)
In the current design the main executable links explicitly to the module
registration construtors that it uses.  This means that they must be
visible in shared libraries.

PR modula2/108259

gcc/m2/ChangeLog:

* gm2-gcc/m2decl.cc (m2decl_DeclareModuleCtor): Make module
registration constructors visible.

gcc/m2/gm2-gcc/m2decl.cc

index 62bfefd253029557f30d8f364b98e294f5efa4d5..d849f8aefc4ce3ac65c0d988b7be76419ca8b830 100644 (file)
@@ -276,7 +276,7 @@ m2decl_DeclareModuleCtor (tree decl)
   /* Declare module_ctor ().  */
   TREE_PUBLIC (decl) = 1;
   DECL_ARTIFICIAL (decl) = 1;
-  DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+  DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
   DECL_VISIBILITY_SPECIFIED (decl) = 1;
   DECL_STATIC_CONSTRUCTOR (decl) = 1;
   return decl;