This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: link-time merging of gcj's UTF-8 constants
- To: green at cygnus dot com
- Subject: Re: RFC: link-time merging of gcj's UTF-8 constants
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 13 Sep 2001 11:38:32 -0400
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200109131513.IAA04122@fencer.cygnus.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 13, 2001 at 08:13:16AM -0700, Anthony Green wrote:
>
> libgcj.so shrinks by almost 300k on x86 Linux when we merge UTF-8
> constants at link time with Jakub's constant merging linker work.
>
> I suspect that I'm not doing things exactly right, so comments would
> be helpful...
gcc will call named_section when outputing that DECL, thus get default flags
for that section which of course differ from those you set in
build_utf8_ref, thus you get the error.
I see two solutions:
1) come up with a special bit, say SECTION_OVERRIDE, which if set means
use the section flags already recorded for that section, not the default
ones, basically:
if (decl && ! set_named_section_flags (name, flags))
{
+ flags = get_named_section_flags (name);
+ if ((flags & SECTION_OVERRIDE) == 0)
+ error_with_decl (decl, "%s causes a section type conflict");
- error_with_decl (decl, "%s causes a section type conflict");
- flags = get_named_section_flags (name);
}
2) hack up default_section_type_flags, so that it recognizes .rodata.jutf8.*
sections and does strtoul on them to get SECTION_ENTSIZE.
1) has the advantage that it is cleaner and does not put Java specific
knowledge into generic file, 2) has the advantage that it will not switch
to .rodata.jutf8.* section and back unecessarily (you'd avoid the
named_section_flags call).
Jakub