This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix PR 33168



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]