[PATCH] allow empty string as argument to -Map

Nick Clifton nickc@redhat.com
Thu Nov 5 10:01:58 GMT 2020


Hi Fangrui,

>>   -Map=<file>   Put the map into <file>.  <file> can be relative or absolute.
>>   -Map=<dir>    Put the map into <dir>/basename (outfile).map.  Overwrites existing maps.

> This looks like a complex operation. Is it really needed?

This actually reflects the current situation (well without the basename operation).
Providing a directory name for the map option is useful as it allows build systems to use the option without having to worry about generating unique map names.


>>   -Map=%        Put the map into (outfile).map.  Includes all path components in (outfile)
> 
> Maybe -Map=%.map to avoid hard coding the extension name?

Except that we already hard code the .map extension when the directory version of the option is used.  But it would be simple enough to extend the specification so that:

   -Map=%         Puts the map into (outfile).map
   -Map=%.<foo>   Puts the map into (outfile).<foo>

Cheers
   Nick




More information about the Binutils mailing list