aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-05-07 04:14:57 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-05-07 04:14:57 +0000
commit8aae64e67e5c1f9c371c1da643052c5efcf8d280 (patch)
treef4e38876edc6afdd77481054d3435dc6ee93f32f
parenta5d63722abbd36361494765da515902c47b2bc99 (diff)
downloadgdb-8aae64e67e5c1f9c371c1da643052c5efcf8d280.zip
gdb-8aae64e67e5c1f9c371c1da643052c5efcf8d280.tar.gz
gdb-8aae64e67e5c1f9c371c1da643052c5efcf8d280.tar.bz2
* ldmain.h (overflow_cutoff_limit): Declare.
* ldmain.c (overflow_cutoff_limit): Define, initialized to 10. (reloc_overflow): Limit error messages based on it. * lexsup.c (parse_args) <OPTION_VERBOSE>: Set cutoff to unlimited.
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/ldmain.c20
-rw-r--r--ld/ldmain.h1
-rw-r--r--ld/lexsup.c1
4 files changed, 30 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 404d98f..60f9e39 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2003-05-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * ldmain.h (overflow_cutoff_limit): Declare.
+ * ldmain.c (overflow_cutoff_limit): Define, initialized to 10.
+ (reloc_overflow): Limit error messages based on it.
+ * lexsup.c (parse_args) <OPTION_VERBOSE>: Set cutoff to
+ unlimited.
+
2003-05-05 Alan Modra <amodra@bigpond.net.au>
* ldlex.l: Accept C style comments in version scripts.
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 0b0b038..91818e0 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -1362,6 +1362,15 @@ undefined_symbol (info, name, abfd, section, address, fatal)
return TRUE;
}
+/* Counter to limit the number of relocation overflow error messages
+ to print. Errors are printed as it is decremented. When it's
+ called and the counter is zero, a final message is printed
+ indicating more relocations were omitted. When it gets to -1, no
+ such errors are printed. If it's initially set to a value less
+ than -1, all such errors will be printed (--verbose does this). */
+
+int overflow_cutoff_limit = 10;
+
/* This is called when a reloc overflows. */
static bfd_boolean
@@ -1374,10 +1383,21 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
asection *section;
bfd_vma address;
{
+ if (overflow_cutoff_limit == -1)
+ return TRUE;
+
if (abfd == (bfd *) NULL)
einfo (_("%P%X: generated"));
else
einfo ("%X%C:", abfd, section, address);
+
+ if (overflow_cutoff_limit >= 0
+ && overflow_cutoff_limit-- == 0)
+ {
+ einfo (_(" additional relocation overflows omitted from the output\n"));
+ return TRUE;
+ }
+
einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name);
if (addend != 0)
einfo ("+%v", addend);
diff --git a/ld/ldmain.h b/ld/ldmain.h
index d21b3fd..500a4c7 100644
--- a/ld/ldmain.h
+++ b/ld/ldmain.h
@@ -36,6 +36,7 @@ extern bfd_boolean demangling;
extern int g_switch_value;
extern const char *output_filename;
extern struct bfd_link_info link_info;
+extern int overflow_cutoff_limit;
extern void add_ysym PARAMS ((const char *));
extern void add_wrap PARAMS ((const char *));
diff --git a/ld/lexsup.c b/ld/lexsup.c
index e8c2eba..b2f94f1 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -1047,6 +1047,7 @@ parse_args (argc, argv)
ldversion (1);
version_printed = TRUE;
trace_file_tries = TRUE;
+ overflow_cutoff_limit = -2;
break;
case 'v':
ldversion (0);