Linker diagnostics for the incorrect options .

Nick Clifton nickc@redhat.com
Wed Sep 23 09:31:03 GMT 2020


Hi Fangrui,

> This is a conflict between the grouped short options syntax and single
> dash prefixed long options.
> 
> % touch an ommand ':)'
> % ld.bfd -you -can -ofcourse -use -this -Long -command -Line ':)'
> :)

he!

> For newer long options, we should encourage EXACTLY_TWO_DASHES

Definitely.

> (ld/lexsup.c). I have not seen grouped short options in a very large
> code base and FreeBSD.
> Maybe we can deprecate grouped short options syntax for ld.

I like this idea.  How about the attached patch ?  With it applied I
get output like this:

  % ld -vn -non-static -e 0 -v -e2 hello.o
  GNU ld (GNU Binutils) 2.35.50.20200923
  ld: Warning: grouped short command line options are deprecated: -vn
  ld: Error: unable to disambiguate: -non-static (did you mean --non-static ?)

  % echo $?
  1

Cheers
  Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-deprecate-grouped-options.patch
Type: text/x-patch
Size: 1105 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200923/ecfbf4d5/attachment.bin>


More information about the Binutils mailing list