+2001-10-08 Robert Lipe <robertlipe@usa.net>
+
+ * varasm.c (struct in_named_entry): Add declared.
+ (named_section_first_declaration): New function.
+ (default_elf_asm_named_section): Use it.
+ * output.h (named_section_first_declaration): New.
+
2001-10-08 Richard Henderson <rth@redhat.com>
* i386.md (movsi_xor): Export.
extern unsigned int get_named_section_flags PARAMS ((const char *));
extern bool set_named_section_flags PARAMS ((const char *, unsigned int));
extern void named_section_flags PARAMS ((const char *, unsigned int));
+extern bool named_section_first_declaration PARAMS((const char *));
union tree_node;
extern unsigned int default_section_type_flags PARAMS ((union tree_node *,
{
const char *name;
unsigned int flags;
+ bool declared;
};
static htab_t in_named_htab;
return slot ? (*slot)->flags : 0;
}
+/* Returns true if the section has been declared before. Sets internal
+ flag on this section in in_named_hash so subsequent calls on this
+ section will return false. */
+
+bool
+named_section_first_declaration (name)
+ const char *name;
+{
+ struct in_named_entry **slot;
+
+ slot = (struct in_named_entry**)
+ htab_find_slot_with_hash (in_named_htab, name,
+ htab_hash_string (name), NO_INSERT);
+ if (! (*slot)->declared)
+ {
+ (*slot)->declared = true;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
/* Record FLAGS for SECTION. If SECTION was previously recorded with a
different set of flags, return false. */
char flagchars[10], *f = flagchars;
const char *type;
+ if (! named_section_first_declaration (name))
+ {
+ fprintf (asm_out_file, "\t.section\t%s\n", name);
+ return;
+ }
+
if (!(flags & SECTION_DEBUG))
*f++ = 'a';
if (flags & SECTION_WRITE)