creating section with no contents with gcc-2.95.3

Philippe GIACINTI Philippe.Giacinti@sxb.bsf.alcatel.fr
Thu Oct 11 00:11:00 GMT 2001


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



More information about the Gcc-help mailing list