Personal tools
You are here: Home Forums SH Family A problem about link ...HELP!!!

A problem about link ...HELP!!!

Up to SH Family

A problem about link ...HELP!!!

Posted by Michael Q at March 15. 2007
Hi !

I have got the testbench source code with me and want to port that code to the REnesas SH7124 platform. I am a young engineer in this area and also working for the first time on ARM system. I am using HEW4 ( High-performance Embedded Workshop Version 4.00.02.008, Renesas Technology Corp ) for the same.
I have compiled the code in Windows environment ( C++ compiler ) and it works fine there.
I am now tring to build it using HEW. While building, The compilation gets completed successfully but while linking, following error comes.

-----------------------------------------------------------------------------------------

Phase OptLinker starting

L2310 (E) Undefined external symbol "_wait_sem" referenced in "malloc"

Optimizing Linkage Editor Abort

Phase OptLinker finished

-------------------------------------------------------------------------------------------

Now there in no file or function named "_wait_sem".
I am stuck with the problem. Please help me out.
I am stuck with the problem. Please help me out.
I am stuck with the problem. Please help me out.

Thanks,

Sincerely
Michael

RE: A problem about link ...HELP!!!

Posted by Michael Q at March 15. 2007
FAQ 100949


http://www.renesas.com/print_this_page.jsp?cnt=/tool_linker_2004060409.jsp&fp=/support/faqs/faq_results/Q100901-Q101000&title=FAQ%20Search%20Results&lid=&nodepath=support/faqs/faq_results&syspath=/ren-web/internet/active/act-en-gl


FAQ 100949

Functions : Warnings & Errors ; Link ; Libraries ; Build and Makefile ;



Question:
Standard library files are not bundled. (SHC V6,7, H8C V4,5)




Answer:

The standard library is bundled with the SH C Compiler packages V5 and below and H8 C compiler package V3 and below. But it is not bundled with the SH C Compiler packages V6 and above and H8 C compiler package V4 and avobe, and they need to be generated by using a standard library configuration tool.


Generate the standard library according to the following steps.

And includ standard library header file like #include <***> in a source file.




HEW menu :

:Select "Build a library file".

Check a library required on the tab.


When you use the sub command file in link option, add the following command in the sub command file.

library <The standard library generated >.lib

If you do not use the sub command file, the standard library generated is automatically linked.




HEW menu :

tab

:Select "Mode"

: Select "Build a library file" or "Build a library file (anytime)" or

"Build a library file (option changed)".

The selectable items are different in (*)HEW2.0 and HEW2.1.

And check a library required on the :"Standard Library".


When you use the sub command file in link option , add the following command in the sub command file.

Library<The standard library generated >Lib

If you do not use the sub command file, the standard library generated is automatically linked.




A lbgsh.exe(for SH) or a lbg38.exe(for H8) is in the same folder as the compiler (shc.exe). Generate the standard library by this tool and link them by the link option.The usage of this tool is in chapter 5. Standard Library Generator Operating Method of in the online manual.

RE: A problem about link ...HELP!!!

Posted by Michael Q at March 15. 2007
although i read the instructions , and I did something but it still does not work , i still stuck there...
I am stuck with the problem. Please help me out

RE: A problem about link ...HELP!!!

Posted by George Patsilaras at March 15. 2007
The standard library might not have been linked to.

FAQ 100948

http://www.renesas.com/print_this_page.jsp?cnt=/tool_linker_2004060408.jsp&fp=/support/faqs/faq_results/
Q100901-Q101000&title=FAQ%20Search%20Results&lid=&nodepath=support/faqs/faq_results&syspath=/ren-web/internet/active/act-en-gl


Try this:

From the Pull down Menu "Build", click the H8S/H8/300 Toolchain,
Click on the "Standard Library" Tab
Change the category to "Standard Library"
Click on the Libraries you want added.

Re: RE: A problem about link ...HELP!!!

Posted by Michael Q at March 15. 2007
gpatsil wrote:
The standard library might not have been linked to.

FAQ 100948

http://www.renesas.com/print_this_page.jsp?cnt=/tool_linker_2004060408.jsp&fp=/support/faqs/faq_results/
Q100901-Q101000&title=FAQ%20Search%20Results&lid=&nodepath=support/faqs/faq_results&syspath=/ren-web/internet/active/act-en-gl


Try this:

From the Pull down Menu "Build", click the H8S/H8/300 Toolchain,
Click on the "Standard Library" Tab
Change the category to "Standard Library"
Click on the Libraries you want added.


Thanks a lot !
but I did this , even I selected all options, the HEW ran quite slow.... but the problem is still there...

L2310 (E) Undefined external symbol "_wait_sem" referenced in "malloc"

I can not understand this , so strange...who can tell me what is LNK-11???
maybe someone can tell me the PHONE NUMBER of tech support of RENESAS?
thanks in advanced!

RE: Re: RE: A problem about link ...HELP!!!

Posted by George Patsilaras at March 15. 2007
Ok the problem is with malloc.

I was looking here: http://tool-support.renesas.com/eng/toolnews/faq/faq.pdf and I saw that you shouldn't use malloc.

If you are using it for an array then just say char x.

If its a dynamically allocated structure the document suggests as an alternative to use a system call which includes the variable-size memorypool function.
Powered by Ploneboard