Motherboard Forums


Reply
Thread Tools Display Modes

Memory listing from gcc

 
 
Paul Burke
Guest
Posts: n/a
 
      03-27-2006, 10:53 AM
I've read the F manuals and I'm still no wiser... anyone know how I can
get a memory usage listing from gcc (I'm using msp430-gcc)? I've tried
-fmem-report, doesn't not do nowt.

Paul Burke
 
Reply With Quote
 
 
 
 
John Devereux
Guest
Posts: n/a
 
      03-27-2006, 10:57 AM
Paul Burke <(E-Mail Removed)> writes:

> I've read the F manuals and I'm still no wiser... anyone know how I
> can get a memory usage listing from gcc (I'm using msp430-gcc)? I've
> tried -fmem-report, doesn't not do nowt.


How about the "size" command? Or you can get detailed listings with
objdump. Both of these operate on the compiled object files.


--

John Devereux
 
Reply With Quote
 
 
 
 
David R Brooks
Guest
Posts: n/a
 
      03-27-2006, 11:13 AM
John Devereux wrote:
> Paul Burke <(E-Mail Removed)> writes:
>
>> I've read the F manuals and I'm still no wiser... anyone know how I
>> can get a memory usage listing from gcc (I'm using msp430-gcc)? I've
>> tried -fmem-report, doesn't not do nowt.

>
> How about the "size" command? Or you can get detailed listings with
> objdump. Both of these operate on the compiled object files.
>

You can get a map from the Linker: is that what you mean by a "usage
listing"?

 
Reply With Quote
 
Hans-Bernhard Broeker
Guest
Posts: n/a
 
      03-27-2006, 11:38 AM
Paul Burke <(E-Mail Removed)> wrote:
> I've read the F manuals and I'm still no wiser... anyone know how I can
> get a memory usage listing from gcc (I'm using msp430-gcc)?


Generally you can't --- because it's not the job of gcc to decide
about memory usage. That's done by the linker. Get a map file,
and/or run 'size' or 'objdump' on the resulting files.

--
Hans-Bernhard Broeker ((E-Mail Removed)-aachen.de)
Even if all the snow were burnt, ashes would remain.
 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a
 
      03-27-2006, 04:33 PM
Paul Burke wrote:
> I've read the F manuals and I'm still no wiser... anyone know how I can
> get a memory usage listing from gcc (I'm using msp430-gcc)? I've tried
> -fmem-report, doesn't not do nowt.
>
> Paul Burke



If you're looking for assembly listings try adding

-Wa,-ahlms=myfile.lst

to the gcc compilation command line.


If you're looking for the big picture after linking,
get a linker map by adding

-Wl,-Map=myfile.map,--cref

to the gcc command line performing the final link.

If the module cross-reference produces too much output,
use the simpler form

-Wl,-Map=myfile.map


Please do not put any extra spaces in the switches or
they will be misunderstood by the toolchain.

HTH

--

Tauno Voipio
tauno voipio (at) iki fi

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      03-27-2006, 07:37 PM
Tauno Voipio wrote:
> Paul Burke wrote:
>
>> I've read the F manuals and I'm still no wiser... anyone know
>> how I can get a memory usage listing from gcc (I'm using
>> msp430-gcc)? I've tried -fmem-report, doesn't not do nowt.

>
> If you're looking for assembly listings try adding
>
> -Wa,-ahlms=myfile.lst
>
> to the gcc compilation command line.


I use: gcc -gstabs+ -Wa,-ahldn -c | less

possibly with -Os, -O1, -O2 or -O3. The output can be redirected
to a file if you want to keep it around.

>
> If you're looking for the big picture after linking,
> get a linker map by adding
>
> -Wl,-Map=myfile.map,--cref
>
> to the gcc command line performing the final link.
>
> If the module cross-reference produces too much output,
> use the simpler form
>
> -Wl,-Map=myfile.map
>
> Please do not put any extra spaces in the switches or
> they will be misunderstood by the toolchain.


--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>


 
Reply With Quote
 
Paul Burke
Guest
Posts: n/a
 
      03-28-2006, 01:52 PM
CBFalconer wrote:

>
> I use: gcc -gstabs+ -Wa,-ahldn -c | less


Thanks everyone. There seem to be more switches vavailable that there
are chinese characters.

Paul Burke
 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a
 
      03-28-2006, 02:18 PM
Paul Burke wrote:
> CBFalconer wrote:
>
>>
>> I use: gcc -gstabs+ -Wa,-ahldn -c | less

>
>
> Thanks everyone. There seem to be more switches vavailable that there
> are chinese characters.


Get the GNU assembler and linker documentation for these switches:

The gcc -Wa option passes the rest of the option
to the assembler (as or gas).

The same applies to the -Wl option, but the rest
is passed to the linker (ld).

HTH

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to let the gcc compiler optimizer know that my GCC inline asmcode is using stack? 伏虎 Embedded 5 10-08-2012 08:15 PM
iTunes desktop listing of Podcasts does not match iPod listing kyle.ballard80@gmail.com Apple 0 06-07-2007 09:55 PM
gcc-4.1.1/gcc/libgcc2.c:1956: undefined reference to `atexit' techie.embedded@gmail.com Embedded 0 12-11-2006 07:39 AM
Using constrains: GCC vs ICCAVR (was: Assembly delay function: GCC vs ICCAVR) FilterPunk Embedded 1 01-28-2005 12:43 PM
XS International HP Hardware Liquidation - Usenet HP Listing.zip (0/1) Jay Willis HP 0 01-06-2005 09:44 PM


All times are GMT. The time now is 03:14 AM.


Welcome!
Welcome to Motherboard Point
 

Advertisment