2007-06-20 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Jun 2007 18:32:10 +0000 (18:32 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Jun 2007 18:32:10 +0000 (18:32 +0000)
PR 4606
* gcore.c (gcore_command): Use bfd_make_section_anyway_with_flags
instead of bfd_make_section_anyway.
(gcore_create_callback): Likewise.  Also set SEC_NEVER_LOAD
when clearing SEC_LOAD.

gdb/ChangeLog
gdb/gcore.c

index d3f42de3dfcea61f61390a4378f34ebd0bd80ec0..ef274fa5566a6102995fa689ffa26e8676938632 100644 (file)
@@ -1,3 +1,11 @@
+2007-06-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 4606
+       * gcore.c (gcore_command): Use bfd_make_section_anyway_with_flags
+       instead of bfd_make_section_anyway.
+       (gcore_create_callback): Likewise.  Also set SEC_NEVER_LOAD
+       when clearing SEC_LOAD.
+
 2007-06-19  Joseph Myers  <joseph@codesourcery.com>
 
        * arm-tdep.c (arm_push_dummy_call): Correct padding of partial
index 3ab9f9615d4ca5f9a8164044cdf0d247baf75e54..b4c2635afe7e33087a16b86453d01e1b9115d654 100644 (file)
@@ -88,14 +88,15 @@ gcore_command (char *args, int from_tty)
   /* Create the note section.  */
   if (note_data != NULL && note_size != 0)
     {
-      note_sec = bfd_make_section_anyway (obfd, "note0");
+      note_sec = bfd_make_section_anyway_with_flags (obfd, "note0",
+                                                    SEC_HAS_CONTENTS
+                                                    | SEC_READONLY
+                                                    | SEC_ALLOC);
       if (note_sec == NULL)
        error (_("Failed to create 'note' section for corefile: %s"),
               bfd_errmsg (bfd_get_error ()));
 
       bfd_set_section_vma (obfd, note_sec, 0);
-      bfd_set_section_flags (obfd, note_sec,
-                            SEC_HAS_CONTENTS | SEC_READONLY | SEC_ALLOC);
       bfd_set_section_alignment (obfd, note_sec, 0);
       bfd_set_section_size (obfd, note_sec, note_size);
     }
@@ -359,6 +360,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
              && !(bfd_get_file_flags (abfd) & BFD_IN_MEMORY))
            {
              flags &= ~SEC_LOAD;
+             flags |= SEC_NEVER_LOAD;
              goto keep;        /* break out of two nested for loops */
            }
        }
@@ -372,7 +374,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
   else
     flags |= SEC_DATA;
 
-  osec = bfd_make_section_anyway (obfd, "load");
+  osec = bfd_make_section_anyway_with_flags (obfd, "load", flags);
   if (osec == NULL)
     {
       warning (_("Couldn't make gcore segment: %s"),
@@ -389,7 +391,6 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
   bfd_set_section_size (obfd, osec, size);
   bfd_set_section_vma (obfd, osec, vaddr);
   bfd_section_lma (obfd, osec) = 0; /* ??? bfd_set_section_lma?  */
-  bfd_set_section_flags (obfd, osec, flags);
   return 0;
 }
 
This page took 0.02914 seconds and 4 git commands to generate.