This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
creating section with no contents with gcc-2.95.3
- To: gcc-help at gcc dot gnu dot org
- Subject: creating section with no contents with gcc-2.95.3
- From: Philippe GIACINTI <Philippe dot Giacinti at sxb dot bsf dot alcatel dot fr>
- Date: Thu, 11 Oct 2001 09:10:43 +0200
Hello,
When using the section attribute for changing the output section of a
variable (eg: int val __attribute__((section (".sect"));), gcc issues an
asm statement like: `.section .sect,"aw",@progbits' which will create a
new named section WITH CONTENT (i.e @progbits).
But, in my case, I want to have a section without any content (and I
can't put these variables directly in .bss because they have to be
handled a different way than common variables). Actually I wish I have
an asm statement like: `.section .sect,"aw",@nobits'.
Up to now, I've found a workaround in putting the asm directive
__asm__(".section .sect,"aw",@nobits) before any usage of
__attribute__. This way the second section definition issued by gcc is
ignored and we _only_ get an assembler warning...
This solution is not satisfactory, and I think a better solution would
be to force gcc to issue the correct asm directive.
If someone has some clue about this issue, it will help me a lot.
TIA.
--
Philippe Giacinti - Alcatel Business Systems
mailto:Philippe.Giacinti@sxb.bsf.alcatel.fr