Menu

Generating a map of the build

2015-01-27
2015-08-18
  • Simon Wright

    Simon Wright - 2015-01-27

    srini said, in [tickets:#9],

    b. If I wanted to find the memory map of the binary, i.e. ROM space used, addresses used, how can I generate this map?

    Look at demo_tasking.gpr, package Linker:

    package Linker is
       --  --create-map-file isn't supported in this configuration
       for Default_Switches ("ada") use
         (
          "-Wl,-Map," & Project'Project_Dir & Project'Name & ".map"
          );
    end Linker;
    

    Project’Project_Dir is the directory where the .gpr file is, and Project’Name is the .gpr file’s name (in this case, demo_tasking). As you can see from the comment, there should be a --create-map-file switch to automate this, but it doesn’t work with the current cross-compiler. I think I know why, and it should be fixed in the next compiler release I make.

     

    Related

    Tickets: #9

  • Simon Wright

    Simon Wright - 2015-08-18

    With GNAT GPL 2015 (and with the GCC 5.1.0 OS X port at Sourceforge), --create-map-file is supported.

    Builder'Default_Switches ("ada") should contain "--create-map-file".

    If you specify Project'Object_Dir, there's an additional step, because gprbuild changes directory to Object_Dir before the link: package Linker should contain

    for Map_File_Option use "-Wl,-Map," & Project'Project_Dir;
    
     

    Last edit: Simon Wright 2015-08-18

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.