[PATCH] D63190: Add -gnu-map option to emit a map file in the GNU-tsyle format.
Keir Mierle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 13:28:21 PDT 2019
mierle added a comment.
I am one of the engineers at Google wanting to have machine readable `.map` file output from lld and ld. Regarding Peter's suggestion to eventually only offer a `.json` format and helper scripts, then removing the other `.map` output formats, I'm less excited. In practice maintaining scripts (and their associated runtimes and dependencies) can be a big burden. The map export code isn't enormous and so I would suggest we just keep it.
================
Comment at: lld/ELF/Options.td:192
+defm gnu_map: Eq<"gnu-map",
+ "Print a link map to the specified file in the same format as GNU gold">;
----------------
peter.smith wrote:
> MaskRay wrote:
> > Without looking at the documentation, I think people would mostly likely think `-gnu-map` means a GNU ld compatible format.
> >
> > ld.bfd is GNU ld :) (I have to say `-gold-map` sounds like a weird option name)
> I agree with MaskRay here. Perhaps another command line option --map-file-format=<format> where <format> defaults to lld. We could then add gold, bfd etc.
As someone who wants to get a JSON-based map format added to LLD, I like Peter's suggestion. With JSON added, the flags could be:
- `--map-file-format=lld`
- `--map-file-format=gold`
- `--map-file-format=json`
- `--map-file-format=csv`
which feels clean, readable, and extendable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63190/new/
https://reviews.llvm.org/D63190
More information about the llvm-commits
mailing list