forked from Imagelibrary/binutils-gdb
Add bfd_free_cached_info support to a.out backends.
* aoutx.h (aout_get_external_symbols): Renamed from aout_link_get_symbols. Read strings even if symbols have been read. Store string size in obj_aout_string_size. (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to read the symbols. Allocate the cached symbols with malloc, not bfd_alloc. (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with malloc, not bfd_alloc. (NAME(aout,bfd_free_cached_info)): New function; free cached symbols and relocs. * libaout.h (struct aoutdata): Add external_string_size field. (obj_aout_external_string_size): New accessor macro. (NAME(aout,close_and_cleanup)): Don't declare. (NAME(aout,bfd_free_cached_info)): Declare. (aout_32_close_and_cleanup): Don't define. (aout_64_close_and_cleanup): Don't define. * aout-target.h (MY_bfd_free_cached_info): If not already defined, define as NAME(aout,free_cached_info). (MY_close_and_cleanup): If not already defined, define as MY_bfd_free_cached_info. * aout-adobe.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define. * bout.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define. * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true. (MY_close_and_cleanup): Don't define. * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached relocs with malloc, not bfd_alloc. * i386os9k.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define.
This commit is contained in:
@@ -119,7 +119,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#define DEFAULT_ARCH bfd_arch_m68k
|
||||
|
||||
#define MY_get_section_contents aout_32_get_section_contents
|
||||
#define MY_close_and_cleanup aout_32_close_and_cleanup
|
||||
#define MY_slurp_armap bfd_slurp_bsd_armap_f2
|
||||
|
||||
/***********************************************/
|
||||
@@ -137,6 +136,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
||||
#define MY_bfd_final_link _bfd_generic_final_link
|
||||
|
||||
/* Until and unless we convert the slurp_reloc and slurp_symtab
|
||||
routines in this file, we can not use the default aout
|
||||
free_cached_info routine which assumes that the relocs and symtabs
|
||||
were allocated using malloc. */
|
||||
#define MY_bfd_free_cached_info bfd_true
|
||||
|
||||
#define hp300hpux_write_syms aout_32_write_syms
|
||||
|
||||
#define MY_callback MY(callback)
|
||||
|
||||
Reference in New Issue
Block a user