This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: mips .bss switching patch
> > + else if (! strncmp (NAME, ".bss", 4)) \
> > + fprintf (F, "\t.section %s,\"aw\",@nobits\n", (NAME)); \
>
> But you don't know anything about this section except that
> it starts with ".bss". Bad Juju.
damn! I actually copied what the arm backend was doing. perhaps a
strcmp instead of a strncmp? ;-). actually, i think a couple othe back
ends were doing this strncmp business for the .bss section-- not that that
makes it right.
>
> int x __attribute__((section(".bssiod"))) = 2;
>
> You should never make choices like this based on name. I know
> it happens a lot, but that doesn't make it right.
>
> Why did this come up?
a customer reported that they were getting the following error message:
a.s:5: Warning: Ignoring incorrect section type for .bss
for the following C code:
int a __attribute__ ((aligned(16))) __attribute__ ((section(".bss")));
> I can't think how to solve this properly. The current documentation
> on section attributes is out of date -- we've supported them on
> uninitialized data for a while. I'm of a mind that
>
> int x __attribute__((section(".foo")));
> int y __attribute__((section(".foo"))) = 2;
>
> should continue to work, which means knowing _not_ to mark the
> section @nobits before you've seen _all_ of the decls. Which you
> can't do at the moment.
uggghhh, what should we do? nick had suggested that the user compile
with -fno-common to inhibit putting the "a" in .comm.
suggestions?
aldy