Clone of official tools

Revision:
7:5af61d55adbe
Parent:
2:07730b0f452c
Child:
13:ab47a20b66f0
--- a/toolchains/iar.py	Sat May 21 20:17:44 2016 +0100
+++ b/toolchains/iar.py	Tue Jun 07 11:21:44 2016 +0100
@@ -142,10 +142,11 @@
     @hook_tool
     def link(self, output, objects, libraries, lib_dirs, mem_map):
         # Build linker command
-        cmd = [self.ld, "-o", output, "--skip_dynamic_initialization"] + objects + libraries
+        map_file = splitext(output)[0] + ".map"
+        cmd = [self.ld, "-o", output, "--skip_dynamic_initialization", "--map=%s" % map_file] + objects + libraries
 
         if mem_map:
-            args.extend(["--config", mem_map])
+            cmd.extend(["--config", mem_map])
 
         # Call cmdline hook
         cmd = self.hook.get_cmdline_linker(cmd)