section_entry_eq (const void *p1, const void *p2)
{
const section *old = (const section *) p1;
- const char *new = (const char *) p2;
+ const char *new_name = (const char *) p2;
- return strcmp (old->named.name, new) == 0;
+ return strcmp (old->named.name, new_name) == 0;
}
static hashval_t
object_block_entry_eq (const void *p1, const void *p2)
{
const struct object_block *old = (const struct object_block *) p1;
- const section *new = (const section *) p2;
+ const section *new_section = (const section *) p2;
- return old->sect == new;
+ return old->sect == new_section;
}
static hashval_t
{
section *sect;
- sect = ggc_alloc (sizeof (struct unnamed_section));
+ sect = GGC_NEW (section);
sect->unnamed.common.flags = flags | SECTION_UNNAMED;
sect->unnamed.callback = callback;
sect->unnamed.data = data;
{
section *sect;
- sect = ggc_alloc (sizeof (struct unnamed_section));
+ sect = GGC_NEW (section);
sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
sect->noswitch.callback = callback;
flags |= SECTION_NAMED;
if (*slot == NULL)
{
- sect = ggc_alloc (sizeof (struct named_section));
+ sect = GGC_NEW (section);
sect->named.common.flags = flags;
sect->named.name = ggc_strdup (name);
sect->named.decl = decl;
}
}
-/* In unit-at-a-time mode, we delay assemble_external processing until
+/* We delay assemble_external processing until
the compilation unit is finalized. This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final. See PR 17982 for further discussion. */
#endif
}
+/* This TREE_LIST contains any weak symbol declarations waiting
+ to be emitted. */
+static GTY(()) tree weak_decls;
+
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
return;
+ if (SUPPORTS_WEAK && DECL_WEAK (decl))
+ weak_decls = tree_cons (NULL, decl, weak_decls);
+
/* We want to output external symbols at very last to check if they
are references or not. */
pending_assemble_externals = tree_cons (0, decl,
assemble_zeros (size - total_bytes);
}
-/* This TREE_LIST contains any weak symbol declarations waiting
- to be emitted. */
-static GTY(()) tree weak_decls;
-
/* Mark DECL as weak. */
static void
error ("weak declaration of %q+D must be public", decl);
else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
error ("weak declaration of %q+D must precede definition", decl);
- else if (SUPPORTS_WEAK)
- {
- if (! DECL_WEAK (decl))
- weak_decls = tree_cons (NULL, decl, weak_decls);
- }
- else
+ else if (!SUPPORTS_WEAK)
warning (0, "weak declaration of %q+D not supported", decl);
mark_weak (decl);
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
- target_decl = find_decl_and_mark_needed (decl, target);
+ if (cgraph_global_info_ready)
+ target_decl = find_decl_and_mark_needed (decl, target);
+ else
+ target_decl= NULL;
if (target_decl && TREE_ASM_WRITTEN (target_decl))
do_assemble_alias (decl, target);
else