PR gdb/14704:
* gdb_bfd.c (gdb_bfd_ref): Set BFD_DECOMPRESS. (zlib_decompress_section): Remove. (gdb_bfd_map_section): Only check for compressed section in mmap case. Use bfd_get_full_section_contents. * osabi.c (check_note): Add 'sectsize' argument. Read section data. (generic_elf_osabi_sniff_abi_tag_sections): Don't read section data. Update for check_note change. * xcoffread.c (xcoff_initial_scan): Use bfd_get_full_section_contents. * py-auto-load.c (auto_load_section_scripts): Use bfd_get_full_section_contents. * contrib/cc-with-tweaks.sh: Add -Z option. testsuite * gdb.base/comprdebug.exp: New file.
This commit is contained in:
parent
d071a26bbc
commit
ea9f10bb87
8 changed files with 150 additions and 164 deletions
|
@ -197,26 +197,25 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
|
|||
{
|
||||
bfd *abfd = objfile->obfd;
|
||||
asection *scripts_sect;
|
||||
bfd_size_type size;
|
||||
char *p;
|
||||
struct cleanup *cleanups;
|
||||
bfd_byte *data = NULL;
|
||||
|
||||
scripts_sect = bfd_get_section_by_name (abfd, section_name);
|
||||
if (scripts_sect == NULL)
|
||||
return;
|
||||
|
||||
size = bfd_get_section_size (scripts_sect);
|
||||
p = xmalloc (size);
|
||||
|
||||
cleanups = make_cleanup (xfree, p);
|
||||
|
||||
if (bfd_get_section_contents (abfd, scripts_sect, p, (file_ptr) 0, size))
|
||||
source_section_scripts (objfile, section_name, p, p + size);
|
||||
else
|
||||
if (!bfd_get_full_section_contents (abfd, scripts_sect, &data))
|
||||
warning (_("Couldn't read %s section of %s"),
|
||||
section_name, bfd_get_filename (abfd));
|
||||
else
|
||||
{
|
||||
struct cleanup *cleanups;
|
||||
char *p = (char *) data;
|
||||
|
||||
do_cleanups (cleanups);
|
||||
cleanups = make_cleanup (xfree, p);
|
||||
source_section_scripts (objfile, section_name, p,
|
||||
p + bfd_get_section_size (scripts_sect));
|
||||
do_cleanups (cleanups);
|
||||
}
|
||||
}
|
||||
|
||||
/* Load any Python auto-loaded scripts for OBJFILE. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue