[PATCH] D63190: Add -gnu-map option to emit a map file in the GNU-tsyle format.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 02:38:49 PDT 2019


ruiu created this revision.
ruiu added reviewers: MaskRay, peter.smith, grimar.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

lld supports -Map option to write the layout information to a specified
file in a human-readable format. GNU ld and gold support that option as
well, but their format is different from others.

If the output were consumed only by humans, that's not a problem. However,
in practice, there are a lot of post-link tools that parses map files, and
they almost always support the GNU-style map file because of a historical
reason. It is not too hard to update a program if a post-link tool is
written by a scripting language, but if it is a proprietary tool, it's not
easy to update. In reality, it is sometimes very hard to update a program
so that the tool can read the lld-style map file.

So, in this patch, I added `-gnu-map` option to print out a map file in
the GNU-style format. I'm not super happy to do this, as this is basically
a duplicate feature, but given that the amount of code to implement the
feature is very small, I think doing this makes sense. It should help
users who has tools that consume map files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63190

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/MapFile.cpp
  lld/ELF/MapFile.h
  lld/ELF/Options.td
  lld/ELF/Writer.cpp
  lld/test/ELF/gnu-map.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63190.204241.patch
Type: text/x-patch
Size: 10357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190612/507ec2da/attachment.bin>


More information about the llvm-commits mailing list