aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmisc.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-14 17:08:37 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-14 17:08:37 +0000
commitcc23cc69c56ce199eb6505c8b3e5e704f3795d04 (patch)
treed232dcfa0532b44c52177784309603a8cb495acd /ld/ldmisc.c
parent8bff41c1b7ca7abcf4b971ff4f7bf0e83f20477d (diff)
downloadgdb-cc23cc69c56ce199eb6505c8b3e5e704f3795d04.zip
gdb-cc23cc69c56ce199eb6505c8b3e5e704f3795d04.tar.gz
gdb-cc23cc69c56ce199eb6505c8b3e5e704f3795d04.tar.bz2
* ldmisc.c (vfinfo): Handle %D as %C, but never print the function
name. For %C, print the function name on a separate line, to keep the length of error messages under control. * ldmain.c (multiple_definition): Use %D for ``first defined here.'' (undefined_symbol): Use %D for ``more undefined references follow''. PR 3770.
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r--ld/ldmisc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 52dee61..9b3047b 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -50,7 +50,8 @@ static const char *demangle PARAMS ((const char *string,
%X no object output, fail return
%V hex bfd_vma
%v hex bfd_vma, no leading zeros
- %C Clever filename:linenumber
+ %C clever filename:linenumber with function
+ %D like %C, but no function name
%R info about a relent
%s arbitrary string, like printf
%d integer, like printf
@@ -208,6 +209,7 @@ vfinfo(fp, fmt, arg)
break;
case 'C':
+ case 'D':
/* Clever filename:linenumber with function name if possible,
or section name as a last resort. The arguments are a BFD,
a section, and an offset. */
@@ -254,9 +256,12 @@ vfinfo(fp, fmt, arg)
if (filename == (char *) NULL)
filename = abfd->filename;
- if (functionname != (char *)NULL)
- fprintf (fp, "%s:%u: %s", filename, linenumber,
- demangle (functionname, 1));
+ if (functionname != NULL && fmt[-1] == 'C')
+ {
+ fprintf (fp, "%s: In function `%s':\n", filename,
+ demangle (functionname, 1));
+ fprintf (fp, "%s:%u", filename, linenumber);
+ }
else if (linenumber != 0)
fprintf (fp, "%s:%u", filename, linenumber);
else