[PATCH] D28617: Implement -Map
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 10:45:47 PST 2017
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.
LGTM with these changes as everybody seems happy with this output format.
================
Comment at: lld/ELF/Driver.cpp:515
Config->LTONewPmPasses = getString(Args, OPT_lto_newpm_passes);
+ Config->MapFile = getString(Args, OPT_Map);
Config->OutputFile = getString(Args, OPT_o);
----------------
Move the definitions of `-Map` and `-Map=` in Options.td so that they are not under the comment saying that they are for compatibility and silently ignored.
================
Comment at: lld/ELF/MapFile.cpp:38
+ uint64_t Align, StringRef Name) {
+ OS << format_hex_no_prefix(Address, 8) << ' ' << format_hex_no_prefix(Size, 8)
+ << ' ' << format("%5x ", Align) << left_justify(Name, 7);
----------------
For 64-bit output, you want to write `Address` in 64 bit.
================
Comment at: lld/ELF/MapFile.cpp:39
+ OS << format_hex_no_prefix(Address, 8) << ' ' << format_hex_no_prefix(Size, 8)
+ << ' ' << format("%5x ", Align) << left_justify(Name, 7);
+}
----------------
This and in other write* functions probably should print out a trailing "\n" so that you don't need to do that in `writeMapFile2`.
https://reviews.llvm.org/D28617
More information about the llvm-commits
mailing list