problem with rtems++ Timer & Interrupt class

Joel Sherrill joel.sherrill at OARcorp.com
Tue Dec 4 14:44:21 UTC 2012


On 12/4/2012 8:29 AM, Luca Cinquepalmi wrote:
> I don't understand your answer very well... Can you give me more details?

Gedare is on the right track but missing a subtle point.

As background, think of how ld works. You have a "main" and
for each undefined symbol (e.g. symbol not in that .o), it tries
to resolve it. It will look in libraries (e.g. .a files). When it find
a .o in that .a which has the ONE symbol you want, it pulls
in that ENTIRE .o and then continues trying to resolve symbols
but now it has to resolve all the references in that second .o
as well.

Without looking at code, the rtems++ code is a handful of
.cc files. Most of RTEMS is only one method or very tightly
related functionality per file. Each rtems++ .o file results in
the entire functionality of a manager getting pulled into your
executable.

rtems++ needs to be a set of smaller .cc files which each wrap
only one directive. This will eliminate a lot of your trouble.

But Gedare is right in that if timer or interrupt prints -- especially
using C++ methods -- then your object jumps up. printf() adds
~20-30K to an executable. The C++ libraries to do this are likely
even larger.

Using nm look at the "U" or undefined symbols for each .o
in rtems++. I think you will find a .o that has extremely
"sticky fingers".

A contribution to drop the application size impact of using
rtems++ would be welcomed.

> Thanks a lot!
>         Luca
>
> On 12/04/2012 03:26 PM, Gedare Bloom wrote:
>> Check if printf is getting included in the new image and not in the 
>> old one. If for some reason those files pull in printf that can be a 
>> lot of extra code.
>>
>>
>> On Tue, Dec 4, 2012 at 3:48 AM, Luca Cinquepalmi 
>> <cinquepalmi at planetek.it <mailto:cinquepalmi at planetek.it>> wrote:
>>
>>     Hi all,
>>     I'm trying to compile rtems C++ source code with rtems provided
>>     class.
>>     I compile the following class without any problems:
>>
>>     rtemsTask.cc
>>     rtemsSeamphore.cc
>>     rtemsMessageQueue.cc
>>     rtemsEvent.cc
>>     rtemsStatusCode.cc
>>
>>     and the program perfectly works, but when I compile
>>
>>     *rtemsInterrupt.cc* or *rtemsTimer.cc*
>>
>>     the code is well compiled, but it doubles its dimension and
>>     doesn't work when loaded on my target board (LEON2).
>>     I'm using spar-rtems4.11-gcc as compiler.
>>     Did anyone have the same problem? Thanks!
>>
>>         Luca
>>
>>     _______________________________________________
>>     rtems-users mailing list
>>     rtems-users at rtems.org <mailto:rtems-users at rtems.org>
>>     http://www.rtems.org/mailman/listinfo/rtems-users
>>
>>
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20121204/80cd4558/attachment-0001.html>


More information about the users mailing list