aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-aarch64.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-05-31 21:17:48 +0930
committerAlan Modra <amodra@gmail.com>2023-06-01 09:51:59 +0930
commit8261abd51344cb4c454514fba1389a9292f9652b (patch)
treee2a43836533c31389d177a41f81a955b23015352 /bfd/elfnn-aarch64.c
parent90fd5049bde965ad217a013398ffc722f298de82 (diff)
downloadgdb-8261abd51344cb4c454514fba1389a9292f9652b.zip
gdb-8261abd51344cb4c454514fba1389a9292f9652b.tar.gz
gdb-8261abd51344cb4c454514fba1389a9292f9652b.tar.bz2
bfd_close and target free_cached_memory
bfd_free_cached_info is used in just one place in archive.c, which means most times we reach bfd_close the function isn't called. On the other hand, if bfd_free_cached_info is called we can't do much on the bfd since it loses all its obj_alloc memory. This restricts what can be done in a target _close_and_cleanup. In particular you can't look at sections, which leads to duplication of code in target close_and_cleanup and free_cached_info, eg. elfnn-aarch64.c. * opncls.c (_bfd_delete_bfd): Call bfd_free_cached_info. * elfnn-aarch64.c (elfNN_aarch64_close_and_cleanup): Delete. (bfd_elfNN_close_and_cleanup): Don't define. * som.c (som_bfd_free_cached_info): Don't call _bfd_generic_close_and_cleanup here. (som_close_and_cleanup): Define as _bfd_generic_close_and_cleanup.
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r--bfd/elfnn-aarch64.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 32799b6..3ad5cb9 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -8736,16 +8736,6 @@ unrecord_section_via_map_over_sections (bfd *abfd ATTRIBUTE_UNUSED,
}
static bool
-elfNN_aarch64_close_and_cleanup (bfd *abfd)
-{
- if (abfd->sections)
- bfd_map_over_sections (abfd,
- unrecord_section_via_map_over_sections, NULL);
-
- return _bfd_elf_close_and_cleanup (abfd);
-}
-
-static bool
elfNN_aarch64_bfd_free_cached_info (bfd *abfd)
{
if (abfd->sections)
@@ -10263,9 +10253,6 @@ const struct elf_size_info elfNN_aarch64_size_info =
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
-#define bfd_elfNN_close_and_cleanup \
- elfNN_aarch64_close_and_cleanup
-
#define bfd_elfNN_bfd_free_cached_info \
elfNN_aarch64_bfd_free_cached_info