This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR c++/16276: Group jump table with function
- From: Richard Henderson <rth at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Jul 2004 13:54:29 -0700
- Subject: Re: PATCH: PR c++/16276: Group jump table with function
- References: <20040709183128.GA8289@lucon.org>
On Fri, Jul 09, 2004 at 11:31:28AM -0700, H. J. Lu wrote:
> - if (!(flags & SECTION_DEBUG))
> - *f++ = 'a';
> - if (flags & SECTION_WRITE)
> - *f++ = 'w';
> - if (flags & SECTION_CODE)
> - *f++ = 'x';
> - if (flags & SECTION_SMALL)
> - *f++ = 's';
> - if (flags & SECTION_MERGE)
> - *f++ = 'M';
> - if (flags & SECTION_STRINGS)
> - *f++ = 'S';
> - if (flags & SECTION_TLS)
> - *f++ = 'T';
> - *f = '\0';
I think you most certainly do not want to be pulling out the flags
as a string into the caller. They do not line up 100% between the
targets.
> +#ifdef HAVE_GAS_COMDAT_GROUP
> +#define PUT_JUMP_TABLES_IN_TEXT_SECTION JUMP_TABLES_IN_TEXT_SECTION
> +#else
> +#define PUT_JUMP_TABLES_IN_TEXT_SECTION \
> + (JUMP_TABLES_IN_TEXT_SECTION || DECL_ONE_ONLY (current_function_decl))
> +#endif
I think the !COMDAT case is wrong.
Suppose SUPPORTS_ONE_ONLY is false, but SUPPORTS_WEAK is true. In that
case we don't actually have to worry about what section jump tables go in.
Suppose it's a strict harvard architecture machine. In which case you
can't go putting *any* data in the text section.
I think the only workable solution is to put all the private read-only
data for a function in an rodata linkonce section for the function.
> +#ifdef READONLY_DATA_SECTION_IN_FUNCTION_GROUP
> + READONLY_DATA_SECTION_IN_FUNCTION_GROUP (decl);
> +#else
Now I think you're inventing macros that no one will ever use.
r~