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.
gold reports ** file header and ** segment headers.