aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2013-08-02 18:24:19 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-08-02 18:24:19 +0000
commita572c4549742bb0876335f3be4c5a76fac555454 (patch)
tree11d47e6c0e0d1bb423cf9f9a28ee06378cf5492c /gcc/go
parentaa7e089fdc0e8095f6790ec53ccad0472573de79 (diff)
downloadgcc-a572c4549742bb0876335f3be4c5a76fac555454.zip
gcc-a572c4549742bb0876335f3be4c5a76fac555454.tar.gz
gcc-a572c4549742bb0876335f3be4c5a76fac555454.tar.bz2
go-gcc.cc (immutable_struct_set_init): Always call resolve_unique_section.
* go-gcc.cc (immutable_struct_set_init): Always call resolve_unique_section. From-SVN: r201446
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/ChangeLog5
-rw-r--r--gcc/go/go-gcc.cc9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index db9d444..f0317c4 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-02 Ian Lance Taylor <iant@google.com>
+
+ * go-gcc.cc (immutable_struct_set_init): Always call
+ resolve_unique_section.
+
2013-07-24 Ian Lance Taylor <iant@google.com>
* go-gcc.cc (Gcc_backend::non_zero_size_type): If a struct has a
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 27c756e..50dbb31 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -1521,10 +1521,11 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&,
TREE_PUBLIC(decl) = 1;
}
else
- {
- make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
- resolve_unique_section(decl, 1, 0);
- }
+ make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
+
+ // These variables are often unneeded in the final program, so put
+ // them in their own section so that linker GC can discard them.
+ resolve_unique_section(decl, 1, 1);
rest_of_decl_compilation(decl, 1, 0);
}