* output.h (SECTION_OVERRIDE): Define.
* varasm.c (named_section): Obey SECTION_OVERRIDE.
java:
2002-02-04 Anthony Green <green@redhat.com>
* class.c (build_utf8_ref): Put UTF-8 constants into merged
sections if available.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49469
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-02-04 Anthony Green <green@redhat.com>
+
+ * output.h (SECTION_OVERRIDE): Define.
+ * varasm.c (named_section): Obey SECTION_OVERRIDE.
+
2002-02-03 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (arm*-*-netbsdelf*): Placeholder to prevent match
+2002-02-04 Anthony Green <green@redhat.com>
+
+ * class.c (build_utf8_ref): Put UTF-8 constants into merged
+ sections if available.
+
2002-02-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* parse.y (java_expand_classes): Fix typo in static field loop.
char buf[60];
tree ctype, field = NULL_TREE, str_type, cinit, string;
static int utf8_count = 0;
- int name_hash;
+ int name_hash, decl_size;
tree ref = IDENTIFIER_UTF8_REF (name);
tree decl;
if (ref != NULL_TREE)
TREE_READONLY (decl) = 1;
TREE_THIS_VOLATILE (decl) = 0;
DECL_INITIAL (decl) = cinit;
+#ifdef HAVE_GAS_SHF_MERGE
+ /* Ensure decl_size is a multiple of utf8const_type's alignment. */
+ decl_size = (name_len + 5 + TYPE_ALIGN_UNIT (utf8const_type) - 1)
+ & ~(TYPE_ALIGN_UNIT (utf8const_type) - 1);
+ if (flag_merge_constants && decl_size < 256)
+ {
+ char buf[32];
+ int flags = (SECTION_OVERRIDE
+ | SECTION_MERGE | (SECTION_ENTSIZE & decl_size));
+ sprintf (buf, ".rodata.jutf8.%d", decl_size);
+ named_section_flags (buf, flags);
+ DECL_SECTION_NAME (decl) = build_string (strlen (buf), buf);
+ }
+#endif
TREE_CHAIN (decl) = utf8_decl_list;
layout_decl (decl, 0);
pushdecl (decl);
#define SECTION_MERGE 0x08000 /* contains mergeable data */
#define SECTION_STRINGS 0x10000 /* contains zero terminated strings without
embedded zeros */
-#define SECTION_MACH_DEP 0x20000 /* subsequent bits reserved for target */
+#define SECTION_OVERRIDE 0x20000 /* allow override of default flags */
+#define SECTION_MACH_DEP 0x40000 /* subsequent bits reserved for target */
extern unsigned int get_named_section_flags PARAMS ((const char *));
extern bool set_named_section_flags PARAMS ((const char *, unsigned int));
flags = (* targetm.section_type_flags) (decl, name, reloc);
/* Sanity check user variables for flag changes. Non-user
- section flag changes will abort in named_section_flags. */
+ section flag changes will abort in named_section_flags.
+ However, don't complain if SECTION_OVERRIDE is set.
+ We trust that the setter knows that it is safe to ignore
+ the default flags for this decl. */
if (decl && ! set_named_section_flags (name, flags))
{
- error_with_decl (decl, "%s causes a section type conflict");
flags = get_named_section_flags (name);
+ if ((flags & SECTION_OVERRIDE) == 0)
+ error_with_decl (decl, "%s causes a section type conflict");
}
named_section_flags (name, flags);