Merge pull request #118 from c1728p9/map_file

Create map file when building
Sam Grove 2016-05-20 15:35:33 -05:00
commit 3fe60fdf1b
3 changed files with 7 additions and 4 deletions

View File

@ -157,10 +157,11 @@ class ARM(mbedToolchain):
@hook_tool
def link(self, output, objects, libraries, lib_dirs, mem_map):
map_file = splitext(output)[0] + ".map"
if len(lib_dirs):
args = ["-o", output, "--userlibpath", ",".join(lib_dirs), "--info=totals", "--list=.link_totals.txt"]
args = ["-o", output, "--userlibpath", ",".join(lib_dirs), "--info=totals", "--map", "--list=%s" % map_file]
else:
args = ["-o", output, "--info=totals", "--list=.link_totals.txt"]
args = ["-o", output, "--info=totals", "--map", "--list=%s" % map_file]
if mem_map:
args.extend(["--scatter", mem_map])

View File

@ -216,7 +216,8 @@ class GCC(mbedToolchain):
libs.extend(libs)
# Build linker command
cmd = self.ld + ["-o", output] + objects
map_file = splitext(output)[0] + ".map"
cmd = self.ld + ["-o", output, "-Wl,-Map=%s" % map_file] + objects
if mem_map:
cmd.extend(['-T', mem_map])

View File

@ -145,7 +145,8 @@ class IAR(mbedToolchain):
@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])