This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: "causes a section type conflict"
Ian Lance Taylor-3 wrote:
>
>
> Thanks. Now for the rest of it. Please give us a complete standalone
> test case. Please show us the exact output of the linker.
>
>
Hi
I tried to do the linking so wrong way. I tried to put every C-code
implementations to same section with using __attribute__ command. And that
is wrong.
My orginal problem caused because I was trying to put variables and
functions to same section. I can continue compiling if I put variables to
different section than functions. And later I had to put also consts to
different sections. (My example doesnt show that problem because it doesnt
use attributed variable)
I think that better way to do this is to edit linker script to put defined
files to different memeory.
example:
.sdata :
{
*(EXCLUDE_FILE(*my_object.o) .sdata) /* put every object's .sdata sections
here but not my_object.o*/
} > ram
.sdata_my_section : AT (LOADADDR(.sdata)+SIZEOF(.sdata))
{
*my_object.o(.sdata) /* put only .sdata sections from my_object.o file*/
} > my_own_ram_section
And do this for every section... data, sdata, bss, etc...
BUT
Now I have new problem. How I can make symbols in linker script?
I want to list many files in one symbol like this:
__MY_OBJS = my_file1.o my_file2.o my_file3.o
SECTION
{
.sdata :
{
*(EXCLUDE_FILE(*__MY_OBJS) .sdata)
} > ram
.sdata_hal : AT (LOADADDR(.sdata)+SIZEOF(.sdata))
{
*__MY_OBJS(.sdata)
} > my_own_ram_section
}
Is there any way to do this?
Makefile style $(__MY_OBJS) could be better but that doesnt work too.
Dukex
--
View this message in context: http://old.nabble.com/%22causes-a-section-type-conflict%22-tp27847975p28024536.html
Sent from the gcc - Help mailing list archive at Nabble.com.