Dear Sir,

We are getting the following error "section type conflict" with xtensa
gcc when a const and non const global variable is placed in the same
section?

I am using a bare metal cross gcc toolchain for Xtensa architecture
built as per instructions in
http://wiki.linux-xtensa.org/index.php/Crosstool-NG. We are using a
custom Xtensa processor in our firmware.

For example consider the code below

__attribute__((section(".dram0.data"))) int x;
__attribute__((section(".dram0.data"))) const int y = 10;

main()
{

}

This throws up an error during compilation

test3.c:2:51: error: y causes a section type conflict with x
 __attribute__((section(".dram0.data"))) const int y = 10;
                                                   ^
test3.c:1:45: note: ‘x’ was declared here
 __attribute__((section(".dram0.data"))) int x;

Removing the const attribute for y will remove this error.

We built our firmware by removing const attributes.Firmware built
using xcc works fine but the same code built using gcc works partly


Thanks and Regards
Hari

Reply via email to