aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorRon Unrau <runrau@cygnus>1998-06-08 22:10:37 +0000
committerRon Unrau <runrau@cygnus>1998-06-08 22:10:37 +0000
commita2266bed50d57a83943ad02bce2c7ba50a68e74a (patch)
treebe422541a2f64c7db5530e6b5849dc3e88d8c42f /gdb/objfiles.c
parent3d64946dedee2fdf2a6b11528b79469f6f6f8e4e (diff)
downloadgdb-a2266bed50d57a83943ad02bce2c7ba50a68e74a.zip
gdb-a2266bed50d57a83943ad02bce2c7ba50a68e74a.tar.gz
gdb-a2266bed50d57a83943ad02bce2c7ba50a68e74a.tar.bz2
* objfiles.c (add_to_objfile_sections): All targets to define
TARGET_KEEP_SECTION to permit them to retain bfd sections that GDB would otherwise have discarded.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 31873d7..8a64b64 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -67,6 +67,10 @@ int mapped_symbol_files; /* Try to use mapped symbol files */
objfile_p_char is a char * to get it through
bfd_map_over_sections; we cast it back to its proper type. */
+#ifndef TARGET_KEEP_SECTION
+#define TARGET_KEEP_SECTION(ASECT) 0
+#endif
+
static void
add_to_objfile_sections (abfd, asect, objfile_p_char)
bfd *abfd;
@@ -78,8 +82,10 @@ add_to_objfile_sections (abfd, asect, objfile_p_char)
flagword aflag;
aflag = bfd_get_section_flags (abfd, asect);
- if (!(aflag & SEC_ALLOC))
+
+ if (!(aflag & SEC_ALLOC) && !(TARGET_KEEP_SECTION(asect)))
return;
+
if (0 == bfd_section_size (abfd, asect))
return;
section.offset = 0;