1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Memory listing from gcc

Discussion in 'Embedded' started by Paul Burke, Mar 27, 2006.

  1. Paul Burke

    Paul Burke Guest

    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
     
    Paul Burke, Mar 27, 2006
    #1
    1. Advertisements

  2. Paul Burke <> 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
     
    John Devereux, Mar 27, 2006
    #2
    1. Advertisements

  3. John Devereux wrote:
    > Paul Burke <> 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"?
     
    David R Brooks, Mar 27, 2006
    #3
  4. 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)?


    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 (-aachen.de)
    Even if all the snow were burnt, ashes would remain.
     
    Hans-Bernhard Broeker, Mar 27, 2006
    #4
  5. Paul Burke

    Tauno Voipio Guest

    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
     
    Tauno Voipio, Mar 27, 2006
    #5
  6. Paul Burke

    CBFalconer Guest

    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/>
     
    CBFalconer, Mar 27, 2006
    #6
  7. Paul Burke

    Paul Burke Guest

    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
     
    Paul Burke, Mar 28, 2006
    #7
  8. Paul Burke

    Tauno Voipio Guest

    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
     
    Tauno Voipio, Mar 28, 2006
    #8
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Mathieu Lafontaine

    TV Listing with TV Wonder freezing problem

    Mathieu Lafontaine, Nov 12, 2003, in forum: ATI
    Replies:
    0
    Views:
    292
    Mathieu Lafontaine
    Nov 12, 2003
  2. Barry Watzman

    GuidePlus has "no listing" ???

    Barry Watzman, Apr 20, 2004, in forum: ATI
    Replies:
    2
    Views:
    271
  3. Edward
    Replies:
    0
    Views:
    357
    Edward
    Apr 23, 2004
  4. FilterPunk
    Replies:
    1
    Views:
    873
    Hans-Bernhard Broeker
    Jan 28, 2005
  5. Replies:
    0
    Views:
    641
  6. Replies:
    0
    Views:
    339
  7. ä¼è™Ž
    Replies:
    5
    Views:
    528
    Hans-Bernhard Bröker
    Oct 8, 2012
Loading...