This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

section used for static variable


I'm trying to write a checksum function that doesn't use varibles in the
data section, but I need the variables to be static so they are preserved
from call to call.

I tried declaring the variables static without assigning them values at
declaration to attempt to have them allocated from the bss or COMMON
section, but that caused them to be placed in the data section.

I guess what I want is to be able to have them assigned to the bss or
COMMON section without making them global.  I tried using the section
attribute, but I got the message that section attributes are not supported
for this target (a.out)

Is there another way to have a variable assigned to the bss section or is a
static variable by definition assigned to the bss (even if its just
declared static to make it file scope)?

Gary



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]