diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 00e0f5442f7..35b9e90a1bb 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -2868,6 +2868,17 @@ _bfd_xcoff_sizeof_headers (bfd *abfd, return size; } + +bool +_bfd_xcoff_bfd_free_cached_info (bfd *abfd) +{ + /* xcoff bfd_core does not have a coff_tdata. */ + if (bfd_get_format (abfd) == bfd_object) + return _bfd_coff_free_cached_info (abfd); + + return _bfd_generic_bfd_free_cached_info (abfd); +} + /* Routines to swap information in the XCOFF .loader section. If we ever need to write an XCOFF loader, this stuff will need to be @@ -4462,7 +4473,6 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { /* For generic entry points. */ #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 diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index f6a60433e62..50de9a04476 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2623,7 +2623,7 @@ const bfd_target rs6000_xcoff64_vec = /* Generic */ coff_close_and_cleanup, - coff_bfd_free_cached_info, + _bfd_xcoff_bfd_free_cached_info, coff_new_section_hook, _bfd_generic_get_section_contents, @@ -2893,7 +2893,7 @@ const bfd_target rs6000_xcoff64_aix_vec = /* Generic */ coff_close_and_cleanup, - coff_bfd_free_cached_info, + _bfd_xcoff_bfd_free_cached_info, coff_new_section_hook, _bfd_generic_get_section_contents, diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h index e6b87975ff6..370991c80de 100644 --- a/bfd/libxcoff.h +++ b/bfd/libxcoff.h @@ -315,4 +315,6 @@ extern enum xcoff_stub_type bfd_xcoff_type_of_stub extern struct xcoff_stub_hash_entry *bfd_xcoff_get_stub_entry (asection *, struct xcoff_link_hash_entry *, struct bfd_link_info *); +extern bool _bfd_xcoff_bfd_free_cached_info (bfd *) ;//ATTRIBUTE_HIDDEN; + #endif /* LIBXCOFF_H */ diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index c2e6b6d2bd6..5469ddca4f7 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -884,7 +884,11 @@ pd_update (pid_t pid) if (status != PTHDB_SUCCESS) return ptid_t (pid); - sync_threadlists (pid); + /* Attempt to sync_threadlists () only when debugging object files + and not core files since list of threads never change for core + files. */ + if (target_has_execution ()) + sync_threadlists (pid); /* Define "current thread" as one that just received a trap signal. */