aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sol2-c.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/sol2-c.c')
-rw-r--r--gcc/config/sol2-c.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/config/sol2-c.c b/gcc/config/sol2-c.c
index da00377..601db97 100644
--- a/gcc/config/sol2-c.c
+++ b/gcc/config/sol2-c.c
@@ -170,9 +170,10 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree decl = identifier_global_value (t);
if (decl && DECL_P (decl))
{
- tree init_list = build_tree_list (get_identifier ("init"),
- NULL);
- tree attrs = tree_cons (get_identifier ("used"), NULL, init_list);
+ tree attrs = build_tree_list (get_identifier ("init"),
+ NULL);
+ TREE_USED (decl) = 1;
+ DECL_PRESERVE_P (decl) = 1;
decl_attributes (&decl, attrs, 0);
}
else
@@ -228,9 +229,10 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree decl = identifier_global_value (t);
if (decl && DECL_P (decl))
{
- tree fini_list = build_tree_list (get_identifier ("fini"),
- NULL);
- tree attrs = tree_cons (get_identifier ("used"), NULL, fini_list);
+ tree attrs = build_tree_list (get_identifier ("fini"),
+ NULL);
+ TREE_USED (decl) = 1;
+ DECL_PRESERVE_P (decl) = 1;
decl_attributes (&decl, attrs, 0);
}
else