From a2266bed50d57a83943ad02bce2c7ba50a68e74a Mon Sep 17 00:00:00 2001 From: Ron Unrau Date: Mon, 8 Jun 1998 22:10:37 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 6 ++++++ gdb/objfiles.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5ffd08b6caf..e684a0c4e1c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Mon Jun 8 16:08:10 1998 Ron Unrau + + * 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. + Fri Jun 5 13:56:19 1998 Doug Evans * dbxread.c (read_dbx_symtab): Don't lower texthigh for last psymtab. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 31873d77c3a..8a64b6461a4 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; -- 2.30.2