This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32458] __attribute((section(".myname"))) is not working as expected in G++ but works ni GCC
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2007 20:34:22 -0000
- Subject: [Bug c++/32458] __attribute((section(".myname"))) is not working as expected in G++ but works ni GCC
- References: <bug-32458-14735@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-06-21 20:34 -------
You forgot to mark the variables as being used.
You mark the variable used with the attribute used.
Once you do that, the variables are emitted.
This is not a bug but by design that GCC can optimize out unused variables,
even the ones marked with a different section.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32458