# HG changeset patch
# Parent 2c72579b3945b50373c09b9c93a37f00d94eee79
Fix Solaris gty handling (PR target/84379)
@@ -880,6 +880,7 @@ case ${target} in
fi
tm_p_file="${tm_p_file} sol2-protos.h"
tmake_file="${tmake_file} t-sol2 t-slibgcc"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/sol2.c"
c_target_objs="${c_target_objs} sol2-c.o"
cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
extra_objs="${extra_objs} sol2.o sol2-stubs.o"
@@ -163,7 +163,7 @@ solaris_assemble_visibility (tree decl,
/* Group section information entry stored in solaris_comdat_htab. */
-typedef struct comdat_entry
+typedef struct GTY((for_user)) comdat_entry
{
const char *name;
unsigned int flags;
@@ -173,11 +173,10 @@ typedef struct comdat_entry
/* Helpers for maintaining solaris_comdat_htab. */
-struct comdat_entry_hasher : nofree_ptr_hash <comdat_entry>
+struct comdat_entry_hasher : ggc_ptr_hash <comdat_entry>
{
static inline hashval_t hash (const comdat_entry *);
static inline bool equal (const comdat_entry *, const comdat_entry *);
- static inline void remove (comdat_entry *);
};
inline hashval_t
@@ -195,7 +194,7 @@ comdat_entry_hasher::equal (const comdat
/* Hash table of group signature symbols. */
-static hash_table<comdat_entry_hasher> *solaris_comdat_htab;
+static GTY (()) hash_table<comdat_entry_hasher> *solaris_comdat_htab;
/* Output assembly to switch to COMDAT group section NAME with attributes
FLAGS and group signature symbol DECL, using Sun as syntax. */
@@ -237,14 +236,14 @@ solaris_elf_asm_comdat_section (const ch
remember the signature symbols and emit those not marked
TREE_SYMBOL_REFERENCED in solaris_file_end. */
if (!solaris_comdat_htab)
- solaris_comdat_htab = new hash_table<comdat_entry_hasher> (37);
+ solaris_comdat_htab = hash_table<comdat_entry_hasher>::create_ggc (37);
entry.sig = signature;
slot = solaris_comdat_htab->find_slot (&entry, INSERT);
if (*slot == NULL)
{
- *slot = XCNEW (comdat_entry);
+ *slot = ggc_alloc<comdat_entry> ();
/* Remember fragmented section name. */
(*slot)->name = section;
/* Emit as regular section, .group declaration has already been done. */
@@ -299,3 +298,5 @@ solaris_override_options (void)
if (!HAVE_LD_EH_FRAME_CIEV3 && !global_options_set.x_dwarf_version)
dwarf_version = 2;
}
+
+#include "gt-sol2.h"