mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #118 from c1728p9/map_file
Create map file when building
commit
3fe60fdf1b
|
@ -157,10 +157,11 @@ class ARM(mbedToolchain):
|
||||||
|
|
||||||
@hook_tool
|
@hook_tool
|
||||||
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
||||||
|
map_file = splitext(output)[0] + ".map"
|
||||||
if len(lib_dirs):
|
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:
|
else:
|
||||||
args = ["-o", output, "--info=totals", "--list=.link_totals.txt"]
|
args = ["-o", output, "--info=totals", "--map", "--list=%s" % map_file]
|
||||||
|
|
||||||
if mem_map:
|
if mem_map:
|
||||||
args.extend(["--scatter", mem_map])
|
args.extend(["--scatter", mem_map])
|
||||||
|
|
|
@ -216,7 +216,8 @@ class GCC(mbedToolchain):
|
||||||
libs.extend(libs)
|
libs.extend(libs)
|
||||||
|
|
||||||
# Build linker command
|
# 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:
|
if mem_map:
|
||||||
cmd.extend(['-T', mem_map])
|
cmd.extend(['-T', mem_map])
|
||||||
|
|
|
@ -145,7 +145,8 @@ class IAR(mbedToolchain):
|
||||||
@hook_tool
|
@hook_tool
|
||||||
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
||||||
# Build linker command
|
# 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:
|
if mem_map:
|
||||||
args.extend(["--config", mem_map])
|
args.extend(["--config", mem_map])
|
||||||
|
|
Loading…
Reference in New Issue