diff options
author | Alan Modra <amodra@gmail.com> | 2022-10-26 16:34:19 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-10-26 17:27:45 +1030 |
commit | 4d664d5711b297ca6666f529e83bb624f587df77 (patch) | |
tree | 9bfb192fa9cc4234e7334ce4524366836f435e79 | |
parent | b8d97d38574639d539aa4dfecc2fb5b532c32c5d (diff) | |
download | gdb-4d664d5711b297ca6666f529e83bb624f587df77.zip gdb-4d664d5711b297ca6666f529e83bb624f587df77.tar.gz gdb-4d664d5711b297ca6666f529e83bb624f587df77.tar.bz2 |
segfault in objdump.c reloc_at
bfd_canonicalize_reloc returns -1L on errors.
* objdump.c (load_specific_debug_section): Properly handle
error return from bfd_canonicalize_reloc.
-rw-r--r-- | binutils/objdump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c index a4ab0db..0825e05 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4212,13 +4212,13 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, if (reloc_size > 0) { - unsigned long reloc_count; + long reloc_count; arelent **relocs; relocs = (arelent **) xmalloc (reloc_size); reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, NULL); - if (reloc_count == 0) + if (reloc_count <= 0) free (relocs); else { |