2008-12-15 04:55:40 Issues while Placing Library code in L1 Instruction SRAM
Vasanth Nayak (INDIA)
Message: 66710
Hi all,
http://docs.blackfin.uclinux.org/doku.php?id=using_l1_memory&s[]=memory gives
-Wl,--sep-code -Wl,--code-in-l1 -Wl,-z,now
as the linker switches to be added while compiling to put shared library code in L1 instruction SRAM.
When i add this, during linking, i get
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/lib/crt1.o: In function `__start':
(.text+0x12): warning: warning: relocation references a different segment
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/lib/crt1.o: In function `__start':
(.text+0x16): warning: warning: relocation references a different segment
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/lib/crt1.o: In function `__start':
(.text+0x1a): warning: warning: relocation references a different segment
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/lib/crt1.o: In function `__start':
(.text+0x1e): warning: warning: relocation references a different segment
and the resultant executable files fails to load and execute.
But if i add -pie -Wl,--sep-code -Wl,--code-in-l1 -Wl,-z,now -Wl,--sep-code -Wl,--code-in-l1 -Wl,-z,now
The code links properly and executes.
Is this the correct way if i want to put both application code and library code in L1 ?
How do i verify that the library code(not application code) is in L1 instruction SRAM ?
I am using gcc 4.1.2 version toolchain. and building the code for BF527.
Thanks,
Vasanth
QuoteReplyEditDelete
2008-12-16 02:30:29 Re: Issues while Placing Library code in L1 Instruction SRAM
Yi Li (CHINA)
Message: 66743
Vasanth,
What is your toolchain version? 2008R1.5? Please list the whole command you invoke gcc, e.g "bfin-linux-uclibc-gcc ....".
-Yi
QuoteReplyEditDelete
2008-12-16 05:22:18 Re: Issues while Placing Library code in L1 Instruction SRAM
Vasanth Nayak (INDIA)
Message: 66750
Hi Yi,
Previously i was using 2008R1.But i tried with 2008R1.5 also. Gives me the same linker warning.
The command line is
bfin-linux-uclibc-g++ -o MyTest test.o test1.o -Wl,--sep-code -Wl,--code-in-l1 -Wl,-z,now -L/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime/usr/lib -lm -lbffastfp
Regards,
Vasanth
QuoteReplyEditDelete
2008-12-16 13:36:41 Re: Issues while Placing Library code in L1 Instruction SRAM
Mike Frysinger (UNITED STATES)
Message: 66764
how exactly did you compile test.o/test1.o ?
QuoteReplyEditDelete
2008-12-16 22:04:17 Re: Issues while Placing Library code in L1 Instruction SRAM
Vasanth Nayak (INDIA)
Message: 66774
Hi Mike,
I used
bfin-linux-uclibc-g++ -c -O2 -Wall -save-temps -mfast-fp -ffast-math -fno-jump-tables test.c
for compiling.