[lld][ELF] Implement –print-memory-usage
authorPetr Hosek <phosek@google.com>
Tue, 16 May 2023 07:18:26 +0000 (07:18 +0000)
committerPetr Hosek <phosek@google.com>
Thu, 25 May 2023 07:14:18 +0000 (07:14 +0000)
commit811cbfc26233587f01f1b7b8cdeb8200747c366a
treef7467505899f2f396f4c311598f272edaa1d4fc5
parent3d90c8126f8990490cd25a8a4b67a16b99898970
[lld][ELF] Implement –print-memory-usage

This option was introduced in GNU ld in
https://sourceware.org/legacy-ml/binutils/2015-06/msg00086.html and is
often used in embedded development. This change implements this option
in LLD matching the GNU ld output verbatim.

Differential Revision: https://reviews.llvm.org/D150644
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/Options.td
lld/ELF/Writer.cpp
lld/test/ELF/linkerscript/print-memory-usage.s [new file with mode: 0644]