2007-08-01 Jan Kratochvil * exec.c (add_to_section_table): Ignore the BFD_CORE `loadXb' segments. --- ./gdb/exec.c 31 Jul 2007 21:49:21 -0000 1.67 +++ ./gdb/exec.c 1 Aug 2007 14:24:51 -0000 @@ -354,6 +354,13 @@ add_to_section_table (bfd *abfd, struct if (!(aflag & SEC_ALLOC)) return; + /* Core files with 0 < p_filesz < p_memsz have the p_filesz..p_memsz section + without these flags. It would be considered as .bss otherwise. It would + mask out the real EXEC_BFD loaded code by its zeroes. */ + if (bfd_get_format (abfd) == bfd_core + && !(aflag & (SEC_LOAD | SEC_HAS_CONTENTS))) + return; + (*table_pp)->bfd = abfd; (*table_pp)->the_bfd_section = asect; (*table_pp)->addr = bfd_section_vma (abfd, asect);