summaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index a8c7d05f1e..22e5ad66d8 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -3406,9 +3406,16 @@ display_any_bfd (bfd *file, int level)
{
bfd *arfile = NULL;
bfd *last_arfile = NULL;
-
+
if (level == 0)
printf (_("In archive %s:\n"), bfd_get_filename (file));
+ else if (level > 100)
+ {
+ /* Prevent corrupted files from spinning us into an
+ infinite loop. 100 is an arbitrary heuristic. */
+ non_fatal (_("Archive nesting is too deep"));
+ return;
+ }
else
printf (_("In nested archive %s:\n"), bfd_get_filename (file));