I have the following C code:
struct myStruct_t
{
const char m_name[60];
const uint32_t m_data;
};
const struct myStruct_t myStruct
__attribute__(( __aligned__( 64 ), section(".init") )) =
{
"myName",
(uint32_t)&someOtherStruct
};
When I compile in gcc 4.1.1 (for PS3), I get the warning:
1>c:/t/ccy6.s: Assembler messages:
1>c:/t/ccy6.s(106): Warning: setting incorrect section attributes for .init
The assembly code the warning points to is the ".section" clause below:
.section .init,"aw",@progbits
.align 6
.type myStruct , @object
.size myStruct , 64
myStruct :
.ascii "myName"
.long someOtherStruct
It doesn't like the "w" (writable) part of the flags since stuff in .init is read-only, and "const" in all the possible places doesn't compel the compiler not to spit out the "w". How can I tell the compiler "no, really, it is const, I'm not kidding"?