aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2007-02-09 20:11:47 +0000
committerJoel Brobecker <brobecker@gnat.com>2007-02-09 20:11:47 +0000
commit0f5d55d8c4b3bc46db59117233cfa1697415c3d0 (patch)
tree7c5966f893756dc901638824ee5c0665673e91da /gdb
parent25502bfe00dc9d1e115967cd549a09a4f32534c0 (diff)
downloadgdb-0f5d55d8c4b3bc46db59117233cfa1697415c3d0.zip
gdb-0f5d55d8c4b3bc46db59117233cfa1697415c3d0.tar.gz
gdb-0f5d55d8c4b3bc46db59117233cfa1697415c3d0.tar.bz2
* exec.c (add_to_section_table): Do not discard empty sections.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/exec.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6ec59a4..e911748 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2007-02-09 Joel Brobecker <brobecker@adacore.com>
+
+ * exec.c (add_to_section_table): Do not discard empty sections.
+
2007-02-08 Daniel Jacobowitz <dan@codesourcery.com>
* features/Makefile, features/arm-with-iwmmxt.xml,
diff --git a/gdb/exec.c b/gdb/exec.c
index fde35eb..e2d6b99 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -345,11 +345,15 @@ add_to_section_table (bfd *abfd, struct bfd_section *asect,
struct section_table **table_pp = (struct section_table **) table_pp_char;
flagword aflag;
+ /* Check the section flags, but do not discard zero-length sections, since
+ some symbols may still be attached to this section. For instance, we
+ encountered on sparc-solaris 2.10 a shared library with an empty .bss
+ section to which a symbol named "_end" was attached. The address
+ of this symbol still needs to be relocated. */
aflag = bfd_get_section_flags (abfd, asect);
if (!(aflag & SEC_ALLOC))
return;
- if (0 == bfd_section_size (abfd, asect))
- return;
+
(*table_pp)->bfd = abfd;
(*table_pp)->the_bfd_section = asect;
(*table_pp)->addr = bfd_section_vma (abfd, asect);