Multiple symbols when defining __attribute__ ((section ("...")))
I'm trying to put a pointer variable to a specific section defined in my linker script.
If I don't define a section everything works fine, and the variable is in .bss. Fine so far, with definition like:
my_struct* my_struct_store;
But my requirement in to map this variable to a memory section before bss, stack etc as its a part of my MMU-less stack protection framework. I want it to be as far from stack as possible. To do this, I made a specific section in the linker script.
Issue is when I try to do something like this:
my_struct* my_struct_store __attribute__ ((section (".my_section")));
I'll just get multiple definition from every module including it. Is this a bug or known behavior?
My gcc is on Mac OS X 10.10:
% arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_
COLLECT_
Target: arm-none-eabi
Configured with: ../configure --enable-interwork --disable-multilib --with-newlib --disable-nls --disable-lto --with-gnu-as --with-gnu-ld --enable-
Thread model: single
gcc version 4.9.0 (GCC)
//HS
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Henri Sundelin for more information if necessary.