public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: binutils@sourceware.org
Subject: Re: ld error message %C format
Date: Fri, 20 May 2011 00:24:00 -0000	[thread overview]
Message-ID: <mcrr57ujk28.fsf@coign.corp.google.com> (raw)
In-Reply-To: <20110520000025.GS20800@bubble.grove.modra.org> (Alan Modra's	message of "Fri, 20 May 2011 09:30:25 +0930")

Alan Modra <amodra@gmail.com> writes:

> On Wed, May 18, 2011 at 04:59:07PM -0700, Ian Lance Taylor wrote:
>> Alan Modra <amodra@gmail.com> writes:
>> 
>> > How do people feel about extending typical linker error messages like
>> > the following
>> > 	tmpdir/dump0.o: In function `foo':
>> > 	./compressed1.c:13: undefined reference to `bar'
>> > to always include the section and offset information?
>> > 	tmpdir/dump0.o: In function `foo':
>> > 	./compressed1.c:13:(.text+0x8): undefined reference to `bar'
>> >
>> > When debugging toolchain problems, the section and offset is often
>> > more useful than the source information.  I've checked that this
>> > change doesn't seem to break emacs parsing of error messages.
>> 
>> While I'm generally not happy about adding options, I think this is a
>> case where we should consider it.  That is, consider an option
>> requesting more verbose information from linker errors.  I think that
>> for ordinary users of the linker, i.e., 99.9% of linker users, the
>> section+offset will be far more confusing than helpful.
>
> Perhaps I should give some more background as to why I'd like to make
> this change.  Current uses of %C are
> - multiple definition error
> - warning symbol call-back
> - undefined symbol error
> - reloc overflow/dangerous/unattached errors
> - cross reference error
> - one use in each of pe.em, pep.em, pe-dll.c
> - two uses in each of elf64-ppc.c, elf32-ppc.c, elf32-sh.c
>
> I'd say that some of these existing uses of %C would benefit from the
> extra information, particularly the reloc and cross ref errors.  Also,
> it's not as if emitting section+offset is entirely new:  You get that
> for all of these errors if debug info is missing.  However, the main
> reason I want the section+offset is for replacing uses of
> _bfd_error_handler with info->callbacks->einfo in BFD back-end linker
> support functions.  Some of these already report section+offset.  I
> don't like to idea of removing information..
>
> einfo is attractive for the source function and line info, and %v for
> offset doesn't truncate like %lx for 32-bit host, 64-bit target.

It's specifically the multiple definition error and the undefined symbol
error where I think we should tread carefully.  Those are the cases
which people will see routinely, and the information about be presented
in a way that makes sense and is easy to use for people who know nothing
about linkers.  I agree that it is somewhat odd to remove information,
but I've gotten complaints about verbose linker error messages.  And, of
course, it's a very common complaint about g++'s error messages.  It's
hard to know what the right balance is, but I'm pretty sure that
presenting all information by default is not it.

But I won't continue this conversation farther; you should proceed as
you see best.

Ian

  reply	other threads:[~2011-05-20  0:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 15:48 Alan Modra
2011-05-18 15:51 ` H.J. Lu
2011-05-18 16:04 ` Jason Duerstock
2011-05-18 16:19   ` Andreas Schwab
2011-05-18 23:33   ` Alan Modra
2011-05-19  0:10     ` Jason Duerstock
2011-05-18 23:59 ` Ian Lance Taylor
2011-05-20  0:00   ` Alan Modra
2011-05-20  0:24     ` Ian Lance Taylor [this message]
2011-05-23  6:13       ` Alan Modra
2011-05-24  1:24         ` Ian Lance Taylor

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=mcrr57ujk28.fsf@coign.corp.google.com \
    --to=iant@google.com \
    --cc=binutils@sourceware.org \
    /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).