http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55514
Bug #: 55514
Summary: PowerPC EABI: Warning: setting incorrect section
attributes for .sdata2
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: [email protected]
ReportedBy: [email protected]
I am compiling with -meabi -msdata=eabi, and I am getting this compilation
warning every now and then:
Warning: setting incorrect section attributes for .sdata2
This line of code triggers it:
const uint8_t utf8TestStringKanji[] = { 0xE6, 0xBC, 0xA2, 0xE5, 0xAD, 0x97,
0x00 };
This is the assembler output for those 7 bytes of data:
11768 .section .sdata2,"aw",@progbits
11769 .align 2
11770 .LC1:
11771 0000 E6 .byte -26
11772 0001 BC .byte -68
11773 0002 A2 .byte -94
11774 0003 E5 .byte -27
11775 0004 AD .byte -83
11776 0005 97 .byte -105
11777 0006 00 .byte 0
The 'w' in the "aw" means "writable", which is wrong in this case.
I replaced that line of code with the following, which is more or less the same
for my purposes:
const char * const utf8TestStringKanji = "\xE6\xBC\xA2\xE5\xAD\x97\x00";
And that compiles fine (no warnings).