UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor mdhalleck
Visitor
18,879 Views
Registered: ‎05-07-2008

Generate a mapfile

Jump to solution

Hi all,

 

Hopefully a simple question from a newbie.  How do I tell the linker to generate a mapfile?

 

Thanks!

Michael

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
24,767 Views
Registered: ‎08-13-2007

Re: Generate a mapfile

Jump to solution

Here is the official answer record which addresses the PPC405:

http://www.xilinx.com/support/answers/23025.htm (9.1i EDK - How do I generate a GNU linker MAP file with XPS? )

I tried this a while back with MicroBlaze. My notes aren't official, but maybe they will be helpful:

 

/*

 I tried this same suggestion with MicroBlaze and it didn't initially work. I was able to get it to work for MicroBlaze with EDK 9.1.02i with a few minor modifications:
Right click on the appropriate project in Applications field, (e.g. Project: TestApp_Memory( ->Set Compiler Options...
 Paths and Options tab, "Other Compiler Options to Append", then add this text to the field:
-Wl,-Map=TestApp_Memory/executable.map
 
Note the 2nd letter is a lower case "L" not a "1". The "=" instead of the space also appears to be important for the MicroBlaze compiler (mb-gcc). It will not work with a space " " instead of the "="

So the actual command that got run as observed by the output in the XPS output field in my case was
 
mb-gcc -O2 TestApp_Memory/src/TestApp_Memory.c  -o TestApp_Memory/executable.elf \
    -mno-xl-soft-mul -mxl-pattern-compare -mcpu=v6.00.b  -Wl,-T -Wl,TestApp_Memory/src/TestApp_Memory_LinkScr.ld  -g    -I./microblaze_0/include/  -L./microblaze_0/lib/  \
-Wl,-Map=executable.map 


This will produce an ASCII map file in the TestApp_Memory directory, e.g. executable.map
You can substitute your correct project name here (instead of "TestApp_Memory") and executable name (instead of "executable.map") to get the correct directory.

*/

 

I hope that helps.

 

bt

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
24,768 Views
Registered: ‎08-13-2007

Re: Generate a mapfile

Jump to solution

Here is the official answer record which addresses the PPC405:

http://www.xilinx.com/support/answers/23025.htm (9.1i EDK - How do I generate a GNU linker MAP file with XPS? )

I tried this a while back with MicroBlaze. My notes aren't official, but maybe they will be helpful:

 

/*

 I tried this same suggestion with MicroBlaze and it didn't initially work. I was able to get it to work for MicroBlaze with EDK 9.1.02i with a few minor modifications:
Right click on the appropriate project in Applications field, (e.g. Project: TestApp_Memory( ->Set Compiler Options...
 Paths and Options tab, "Other Compiler Options to Append", then add this text to the field:
-Wl,-Map=TestApp_Memory/executable.map
 
Note the 2nd letter is a lower case "L" not a "1". The "=" instead of the space also appears to be important for the MicroBlaze compiler (mb-gcc). It will not work with a space " " instead of the "="

So the actual command that got run as observed by the output in the XPS output field in my case was
 
mb-gcc -O2 TestApp_Memory/src/TestApp_Memory.c  -o TestApp_Memory/executable.elf \
    -mno-xl-soft-mul -mxl-pattern-compare -mcpu=v6.00.b  -Wl,-T -Wl,TestApp_Memory/src/TestApp_Memory_LinkScr.ld  -g    -I./microblaze_0/include/  -L./microblaze_0/lib/  \
-Wl,-Map=executable.map 


This will produce an ASCII map file in the TestApp_Memory directory, e.g. executable.map
You can substitute your correct project name here (instead of "TestApp_Memory") and executable name (instead of "executable.map") to get the correct directory.

*/

 

I hope that helps.

 

bt

0 Kudos
Highlighted
Visitor mdhalleck
Visitor
18,849 Views
Registered: ‎05-07-2008

Re: Generate a mapfile

Jump to solution

thank you bt, that worked well. 

 

For those that may want to know how to do this in SDK:

 

Project->Properties (or do the right click thing)

   Select Page "C/C++ Build":

      Select "Tool Settings" Tab:

         Choose "Miscellaneous" under "MicroBlaze C Linker" in the selection list

            In the text box labeled "Linker Flags" type in the options bt suggested:  -Wl,-Map=<filepath and name> 

 

-M

Participant nc6
Participant
14,515 Views
Registered: ‎05-07-2009

Re: Generate a mapfile

Jump to solution

Hi Bt,

 

I tried the exact same thing today (edk 9.1i)  and it gave me an error.

 

quote"

........

mb-gcc: unrecognized option '-Map=\TestApp_Memory\system.map'

 

/cygdrive/e/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real: cannot open: No such file or directory

collect2: ld returned 1 exit status

make:*** [TestApp_Memry/executable.elf] Error 1

 

Done!

 

"unquote

 

any suggestions about why this might give me an error.

 

Tags (5)
0 Kudos
Visitor floydg
Visitor
12,299 Views
Registered: ‎10-20-2010

Re: Generate a mapfile

Jump to solution

13.1

 

1) I had to "manually" create the "empty" map file in the output folder, otherwise a linker error was generated

2) C/C++ Build Settings->Miscellaneous->Linker Flags          add    -Map D:/myOutput.map

3) build project

 

 

Note:

use --help (added as a linker flag) to see all linker options

0 Kudos
Explorer
Explorer
11,128 Views
Registered: ‎09-28-2012

Re: Generate a mapfile

Jump to solution

Hi,

I am using EDK 14.5 with Microblazer. I need to generate a link MAP file. I have tried the above No. 3 and 5 methods (link build configuration/misc/ ....), but both fail. Could you help me on that?

 

Thanks,

0 Kudos
Visitor colinbathe
Visitor
6,914 Views
Registered: ‎12-12-2013

Re: Generate a mapfile

Jump to solution
Just got this working in EDK14.7 (windows 10) Project -> Properties -> C/C++ Build -> Settings -> MicroBlaze gcc linker -> Miscellaneous -> Linker Flags -> -Wl,-Map=filename.map I hope that helps.
0 Kudos