diff options
author | Anthony Green <green@redhat.com> | 2002-02-04 03:03:44 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2002-02-04 03:03:44 +0000 |
commit | 10c459437e4444fc5a111d1c3bdb96022e23716f (patch) | |
tree | 9e8245138c4f5a27f756f13a4d867cb52d972455 /gcc/java/class.c | |
parent | 14b7105512eb617f5a80c1853ff0f8ab18ad0324 (diff) | |
download | gcc-10c459437e4444fc5a111d1c3bdb96022e23716f.zip gcc-10c459437e4444fc5a111d1c3bdb96022e23716f.tar.gz gcc-10c459437e4444fc5a111d1c3bdb96022e23716f.tar.bz2 |
output.h (SECTION_OVERRIDE): Define.
2002-02-04 Anthony Green <green@redhat.com>
* 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.
From-SVN: r49469
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index 2e70081..367a448 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -967,7 +967,7 @@ build_utf8_ref (name) 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) @@ -1000,6 +1000,20 @@ build_utf8_ref (name) 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); |