sparc-rtems-size
Joel Sherrill
joel.sherrill at OARcorp.com
Mon Sep 8 14:20:50 UTC 2003
Fabio Degiovanni - Eicas wrote:
> I have two another questions, probably trivial questions but I am new at
> this things:
> -why is the dimension of the executable code far bigger then the text
> dimension given by sparc-rtems-size? It's also bigger then the code+data
> dimension given by sparc-rtems-size. What's the meaning of the
> executable dimension?
I don't know what format the executable is you are looking at but let's
go through some of the reasons.
+ The executable could include debug information. This has been known
to put MB's of debug symbols in an executable file.
+ The executable could be in Srecords which are normally 2.5 times
larger than the corresponding binary image.
+ RTEMS applications include all of the OS and support libraries
(libc.a, libm.a, etc) that you have referenced.
> -why are the sectons .text .data and .bss evaluated using
> sparc-rtems-size on the object far smaller then the .text .data and .bss
> evaluated using sparc-rtems-size on the executable? I think this is due
> to the linking of my object with the rtems libraries to produce the
> executable. What are the rtems libraries that are linked with my code?
Right. An RTEMS application is (normally) statically linked with the OS
and all required libraries. For example, in the SPARC/ERC32 hello world
executable, about 22K is required because of calling printf(). If you
had been on a UNIX box with shared libraries, the executable for the
same hello world would have a much smaller size reported but you would
be relying on the shared C library and functionality in the UNIX kernel.
It's still there, it just isn't showing up in the size because of the
OS differences.
So the nice thing about executable size for an RTEMS application is that
it really is the entire thing. You don't have to think about how much
code space does the kernel or C library take.
--joel
> Thank you very much
>
> Fabio Degiovanni
>
> Joel Sherrill wrote:
>
>> Fabio Degiovanni - Eicas wrote:
>>
>>> What are the exact meaning of the field "text" "data" and "bss" given
>>> by the sparc-rtems-size utility?
>>
>>
>>
>> I was surprised that this wasn't in the binutils size man page. :(
>>
>> .text is where the executable code goes. Sometimes it may also
>> hold read only data. .text should be able to be placed in ROM
>> or Flash.
>>
>> .data is initialized global/static variables.
>>
>> .bss is uninitialized global/static variables.
>>
>> On top of that, you have dynamic heap and RTEMS work space usage
>> which cannot be determined by size.
>>
>>> Thank you very much
>>>
>>> Fabio Degiovanni
>>>
>>
>>
>
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list