mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
Fix warning: Invalid entry in .debug_gdb_scripts section
$ gdb rustc Reading symbols from rustc...Reading symbols from /usr/lib/debug/usr/bin/rustc.debug...done. done. warning: Invalid entry in .debug_gdb_scripts section /usr/bin/rustc Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts PROGBITS 00000000000008ed 0008ed 000022 00 AMS 0 0 1 /usr/lib/debug/usr/bin/rustc.debug Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts NOBITS 00000000000008ed 000280 000022 00 AMS 0 0 1 There remains questionable whether bfd_get_section_by_name() should not return an error for !SEC_LOAD but I haven't investigated that. gdb/ChangeLog 2017-03-29 Jan Kratochvil <jan.kratochvil@redhat.com> * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS. gdb/testsuite/ChangeLog 2017-03-29 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.python/py-section-script.exp (sepdebug): New testcases.
This commit is contained in:
@ -1174,7 +1174,8 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
|
||||
bfd_byte *data = NULL;
|
||||
|
||||
scripts_sect = bfd_get_section_by_name (abfd, section_name);
|
||||
if (scripts_sect == NULL)
|
||||
if (scripts_sect == NULL
|
||||
|| (bfd_get_section_flags (abfd, scripts_sect) & SEC_HAS_CONTENTS) == 0)
|
||||
return;
|
||||
|
||||
if (!bfd_get_full_section_contents (abfd, scripts_sect, &data))
|
||||
|
Reference in New Issue
Block a user