From: Nick Clifton <nickc@redhat.com>
To: Umesh Kalappa <umesh.kalappa0@gmail.com>,
Binutils <binutils@sourceware.org>
Subject: Re: Linker diagnostics for the incorrect options .
Date: Tue, 22 Sep 2020 13:31:01 +0100 [thread overview]
Message-ID: <fa5560b1-7122-1be5-8819-3b12c4c0daba@redhat.com> (raw)
In-Reply-To: <CAGfacvS6FrK+q+RDdDx8+QXXBAoSEsTuzd4c8vWo1BLh6tvsow@mail.gmail.com>
Hi Umesh,
> Linker error handling for non options or incorrect options should be
> robust for instance like
> $gcc -c test.c
> $ld -non-static test.o
>
> The linker interpretation for "-n" as a standard option for nmagic ,then
> "o" as output filename by name "n-static" which is the dynamic executable .
This is really a feature of the getopt functions provided by the libiberty
library. Note that the correct behaviour does happen if you use two dashes
instead of one:
% ld --non-static test.o
ld: unrecognized option '--non-static'
ld: use the --help option for usage information
Essentially this is a user education issue. Long options should be proceeded
by double dashes. Single dashes may work, sometimes, but weird effects can
also occur.
Cheers
Nick
next prev parent reply other threads:[~2020-09-22 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 5:29 Umesh Kalappa
2020-09-22 12:31 ` Nick Clifton [this message]
2020-09-22 18:40 ` Fangrui Song
[not found] ` <MWHPR12MB14567F315D72755B1CC41210CB3B0@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-09-23 9:31 ` Nick Clifton
2020-10-02 0:19 ` Fangrui Song
[not found] ` <MWHPR12MB145628F1D93CC392F9F8F1DECB310@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-10-05 12:55 ` Nick Clifton
2020-12-11 10:25 ` Matthias Klose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa5560b1-7122-1be5-8819-3b12c4c0daba@redhat.com \
--to=nickc@redhat.com \
--cc=binutils@sourceware.org \
--cc=umesh.kalappa0@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).