This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Specifiying alternatives to .data .bss in C source files
- From: Ravishankar S <ravishankar dot s at hathway dot com>
- To: 'Jeff Lasslett' <jeff dot lasslett at datataker dot com dot au>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 01 Sep 2006 21:12:40 +0530
- Subject: RE: Specifiying alternatives to .data .bss in C source files
// preserve variables across wakeup
#pragma section DATA ".dataW" ".bssW" far-absolute
#pragma section SDATA ".sdataW" ".sbssW" far-absolute -> Should
this not be near ?
In gcc we specify the section in this way:
int var __attribute__((section(".mysection"));
There is no way to separate initalized variable and uninitialized
variable: it has to done explicitly.
example:
int u_var __attribute__((section(".bssW"));
int i_var __attribute__((section(".dataW")) = 10;
Coming to addressing mode: It has to be specied in command line.
Options are -msdata=eabi, -G <NUM> -fno-common. Refer to GCC manual for
details. However refer to an earlier mail of mine to see the problems in
the full utilization of SDA in PPC by GCC.
Diab is very powerful in this sense: it allows the definition of more
SDA's than what is specified by the EABI. This is currently may not be
possible in GCC.
- Ravishankar
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Jeff Lasslett
Sent: Thursday, August 31, 2006 12:35 PM
To: gcc-help@gcc.gnu.org
Subject: Specifiying alternatives to .data .bss in C source files
Hello,
The old diab compiler that I am in the process of replacing with GCC
supports the following ...
// preserve variables across wakeup
#pragma section DATA ".dataW" ".bssW" far-absolute
#pragma section SDATA ".sdataW" ".sbssW" far-absolute
... which causes the compiler to put stuff normally destined for .data,
.bss, .sdata and .sbss into different input sections (.dataW, .sdataW,
.bassW, .sbssW).
We do this because our hardware can start cold, or warm, or 'wake from
sleep' and we don't always want to initialise variables.
Could someone please advise me as to how I can get GCC to do the same
thing?
Thanks,
Jeff
__________ NOD32 1.1454 (20060321) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com