This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix PR 33168
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Nathan Froyd <froydnj at codesourcery dot com>, David Edelsohn <dje at watson dot ibm dot com>, Alan Modra <amodra at bigpond dot net dot au>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 27 Aug 2007 15:53:07 +0200
- Subject: Re: [PATCH] fix PR 33168
- References: <20070824205455.GA15735@codesourcery.com> <20070827133852.GP2063@devserv.devel.redhat.com>
Anyway, you want to consider:
.sdata .sdata.* .gnu.linkonce.s.*
.sbss .sbss.* .gnu.linkonce.sb.*
If *2 sections are appropriate for this use (it is a different area), then
.sdata2 .sdata2.* .gnu.linkonce.s2.*
.sbss2 .sbss2.* .gnu.linkonce.sb2.*
and
.PPC.EMB.sdata0 .PPC.EMB.sbss0
only as is.
So IMHO the above needs to be something like:
Or, more readable,
static inline
compare_section_name (const char *section, const char *template)
{
int len;
len = strlen (template);
return (strncmp (section, template, len) == 0
&& (section[len] == 0 || section[len] == '.');
}
if (compare_section_name (section, ".sdata")
|| compare_section_name (section, ".sdata2")
|| compare_section_name (section, ".gnu.linkonce.s")
|| compare_section_name (section, ".sbss")
|| compare_section_name (section, ".sbss2")
|| compare_section_name (section, ".gnu.linkonce.sb")
|| !strcmp (section, ".PPC.EMB.sdata0")
|| !strcmp (section, ".PPC.EMB.sbss0"))
(It also passes for "naked" .gnu.linkonce.s{,b} which I'd say should not
be a problem).
Paolo