PATCH: tidy documentation of ld command-line option syntax

Dave Korn dave.korn.cygwin@googlemail.com
Mon Feb 23 05:50:00 GMT 2009


Sandra Loosemore wrote:
> We've noticed that users have a hard time figuring out how to pass
> linker options that take arguments on the gcc command line, using
> -Xlinker or -Wl. When options are documented in the ld manual as
> "--option value", from gcc you have to do "-Xlinker --option -Xlinker
> value" or "-Wl,--option,value" to get that effect, and that seems to
> really confuse people.
> 
> OTOH, ld already defines that "--option=value" is equivalent to
> "--option value" for all long options, and from the gcc command line,
> this is much less user-error-prone; you can just say the obvious
> "-Xlinker --option=value" or "-Wl,--option=value".  While the
> "--option=value" syntax is already discussed generally in the ld manual,
> and many ld command-line options are already documented that way,
> several others are not.  This patch fixes the documentation of those
> remaining long options to consistently use the "--option=value" syntax.

  I would have preferred if you didn't actually conceal the existence of the
"--option value" form but just added the "--option=value" form where missing.
 That might be confusing to anyone who is familiar with standard getopt()
behaviour.  Did you consider and decide against doing it that way for some reason?

    cheers,
      DaveK




More information about the Binutils mailing list