===================================================================
@@ -914,6 +914,7 @@ extern void lto_symtab_merge_cgraph_node
extern tree lto_symtab_prevailing_decl (tree decl);
extern enum ld_plugin_symbol_resolution lto_symtab_get_resolution (tree decl);
extern void lto_symtab_free (void);
+extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
/* In lto-opts.c. */
===================================================================
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.
#include "gimple.h"
#include "diagnostic-core.h"
#include "toplev.h"
+#include "lto-streamer.h"
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
===================================================================
@@ -79,7 +79,7 @@ $(LTO_EXE): $(LTO_OBJS) $(BACKEND) $(LIB
lto/lto-lang.o: lto/lto-lang.c $(CONFIG_H) coretypes.h debug.h \
flags.h $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(SYSTEM_H) \
$(TARGET_H) $(LTO_H) $(GIMPLE_H) gtype-lto.h gt-lto-lto-lang.h \
- $(EXPR_H)
+ $(EXPR_H) lto-streamer.h
lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \
toplev.h $(TREE_H) $(DIAGNOSTIC_CORE_H) $(TM_H) \
$(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
===================================================================
@@ -2432,6 +2427,8 @@ lto_register_var_decl_in_symtab (struct
ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
rest_of_decl_compilation (decl, 1, 0);
+
+ VEC_safe_push (tree, gc, lto_global_var_decls, decl);
}
/* If this variable has already been declared, queue the