diff options
author | Alan Modra <amodra@gmail.com> | 2023-06-07 14:16:06 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-06-07 14:16:06 +0930 |
commit | ba75d1c55cb42114e3bb5c8abe37e5c2bd657a02 (patch) | |
tree | 7e5342433baeaf8305f7a9b08ab58cfc521b4dd4 /bfd/coff-rs6000.c | |
parent | 0a22a8f27df7d092620dfa1f0135a2dd7b44528a (diff) | |
download | binutils-ba75d1c55cb42114e3bb5c8abe37e5c2bd657a02.zip binutils-ba75d1c55cb42114e3bb5c8abe37e5c2bd657a02.tar.gz binutils-ba75d1c55cb42114e3bb5c8abe37e5c2bd657a02.tar.bz2 |
_bfd_free_cached_info
doc/bfdint.texi and comments in the aout and som code about this
function are just wrong, and its name is not very apt. Better would
be _bfd_mostly_destroy, and we certainly should not be saying anything
about the possibility of later recreating anything lost by this
function. What's more, if _bfd_free_cached_info is called when
creating an archive map to reduce memory usage by throwing away
symbols, the target _close_and_cleanup function won't have access to
tdata or section bfd_user_data to tidy memory. This means most of the
target _close_and_cleanup function won't do anything, and therefore
sometimes will result in memory leaks.
This patch fixes the documentation problems and moves most of the
target _close_and_cleanup code to target _bfd_free_cached_info.
Another notable change is that bfd_generic_bfd_free_cached_info is now
defined as _bfd_free_cached_info rather than _bfd_bool_bfd_true,
ie. the default now frees objalloc memory.
Diffstat (limited to 'bfd/coff-rs6000.c')
-rw-r--r-- | bfd/coff-rs6000.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 421dc8f..271a24f 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4436,8 +4436,8 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { }; /* For generic entry points. */ -#define _bfd_xcoff_close_and_cleanup _bfd_coff_close_and_cleanup -#define _bfd_xcoff_bfd_free_cached_info _bfd_bool_bfd_true +#define _bfd_xcoff_close_and_cleanup coff_close_and_cleanup +#define _bfd_xcoff_bfd_free_cached_info coff_bfd_free_cached_info #define _bfd_xcoff_new_section_hook coff_new_section_hook #define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents #define _bfd_xcoff_get_section_contents_in_window \ |