summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-06 10:42:59 +1030
committerAlan Modra <amodra@gmail.com>2023-03-06 13:11:22 +1030
commit5db0367e1b0bcbe22b987501ae1c77d7e890e6c8 (patch)
tree99bad37d95e7452ac264c26a3986f23c25eb5444 /binutils
parent86a2562b0958ed988e20a8b3a1b0029ff91dda3e (diff)
downloadbinutils-gdb-5db0367e1b0bcbe22b987501ae1c77d7e890e6c8.tar.gz
Downgrade addr2line fatal errors to non-fatal
* addr2line.c (slurp_symtab): Don't exit on errors. (process_file): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/addr2line.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index 1fe9ce2a780..afe116a235c 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -130,7 +130,10 @@ slurp_symtab (bfd *abfd)
dynamic = true;
}
if (storage < 0)
- bfd_fatal (bfd_get_filename (abfd));
+ {
+ bfd_nonfatal (bfd_get_filename (abfd));
+ return;
+ }
syms = (asymbol **) xmalloc (storage);
if (dynamic)
@@ -138,7 +141,7 @@ slurp_symtab (bfd *abfd)
else
symcount = bfd_canonicalize_symtab (abfd, syms);
if (symcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
+ bfd_nonfatal (bfd_get_filename (abfd));
/* If there are no symbols left after canonicalization and
we have not tried the dynamic symbols then give them a go. */
@@ -446,21 +449,27 @@ process_file (const char *file_name, const char *section_name,
abfd->flags |= BFD_DECOMPRESS;
if (bfd_check_format (abfd, bfd_archive))
- fatal (_("%s: cannot get addresses from archive"), file_name);
+ {
+ non_fatal (_("%s: cannot get addresses from archive"), file_name);
+ return 1;
+ }
if (! bfd_check_format_matches (abfd, bfd_object, &matching))
{
bfd_nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
list_matching_formats (matching);
- xexit (1);
+ return 1;
}
if (section_name != NULL)
{
section = bfd_get_section_by_name (abfd, section_name);
if (section == NULL)
- fatal (_("%s: cannot find section %s"), file_name, section_name);
+ {
+ non_fatal (_("%s: cannot find section %s"), file_name, section_name);
+ return 1;
+ }
}
else
section = NULL;