[PATCH] allow empty string as argument to -Map
Nick Clifton
nickc@redhat.com
Wed May 27 16:50:53 GMT 2020
Hi Rasmus,
> So, as the next best thing, use a previously bogus value (the empty
> string) as a sentinel to indicate "use the output filename + .map".
Thanks for suggesting this patch. I have applied it along with a couple
of changes:
* If a filename is supplied, but it references a directory, then
create a file inside that directory, again based upon the output
filename with .map appended. (I actually did this to make it
easier to test the new feature, but it strikes that it might be
useful in its own right).
* Added a test case.
* Added an entry to the ld/NEWS file.
* Updated the --help output from the linker to show that the
filename is optional.
* Minor formatting fixes, and the addition of a few comments.
* Created a ChangeLog entry.
Cheers
Nick
ld/ChangeLog
2020-05-27 Rasmus Villemoes <rv@rasmusvillemoes.dk>
Nick Clifton <nickc@redhat.com>
* lexsup.c (parse_args): If the map filename is defined but empty
create a name based upon the output file name. If the name is
defined but refers to a directory create a file inside the
directory based on the output file name.
* ld.texi: Document the new feature.
* testsuite/ld-script/map-address.exp: Add test of new feature.
* NEWS: Mention the new feature.
More information about the Binutils
mailing list