summaryrefslogtreecommitdiff
path: root/bfd/libbfd-in.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-09-24 18:14:14 +0930
committerAlan Modra <amodra@gmail.com>2022-09-26 14:23:29 +0930
commitf3bc603561c993cdb8811c361ec5e9e484628cdc (patch)
treea9f086c40f78834907e209df7bb55700a27455ae /bfd/libbfd-in.h
parent544c5619574318a6f9044c6aace524a9808ed1d6 (diff)
downloadbinutils-gdb-f3bc603561c993cdb8811c361ec5e9e484628cdc.tar.gz
stab nearest_line bfd_malloc_and_get_section
bfd_malloc_and_get_section performs some sanity checks on the section size before allocating memory. This patch avails the stab nearest_line code of that sanity checking, and tidies up memory afterward. * coffgen.c (_bfd_coff_close_and_cleanup): Call _bfd_stab_cleanup. * elf.c (_bfd_elf_close_and_cleanup): Likewise. * syms.c (_bfd_stab_section_find_nearest_line): Set *pinfo earlier. Use bfd_malloc_and_get_section. Free malloc'd buffers on failure. Malloc indextable. (_bfd_stab_cleanup): New function. * libbfd-in.h (_bfd_stab_cleanup): Declare. * libbfd.h: Regnerate.
Diffstat (limited to 'bfd/libbfd-in.h')
-rw-r--r--bfd/libbfd-in.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 04f343b051b..6d9d15f3409 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -615,6 +615,9 @@ extern bool _bfd_dwarf2_slurp_debug_info
extern void _bfd_dwarf2_cleanup_debug_info
(bfd *, void **) ATTRIBUTE_HIDDEN;
+extern void _bfd_stab_cleanup
+ (bfd *, void **) ATTRIBUTE_HIDDEN;
+
/* Create a new section entry. */
extern struct bfd_hash_entry *bfd_section_hash_newfunc
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *)