This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
section type conflict in gcc xtensa
- From: "Hari Narasimhan H.N" <hari dot narasimhanhn at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 22 Feb 2016 14:57:43 +0530
- Subject: section type conflict in gcc xtensa
- Authentication-results: sourceware.org; auth=none
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