gas: blackfin: handle multibyte symbols
[deliverable/binutils-gdb.git] / gdb / gcore.c
index d8e7ed44f16bff01aacb19350cc820bdf49d721d..9fc0a7f35579af67c712601cd03431fba848d6ed 100644 (file)
@@ -52,6 +52,7 @@ bfd *
 create_gcore_bfd (char *filename)
 {
   bfd *obfd = bfd_openw (filename, default_gcore_target ());
+
   if (!obfd)
     error (_("Failed to open '%s' for output."), filename);
   bfd_set_format (obfd, bfd_core);
@@ -300,7 +301,6 @@ call_target_sbrk (int sbrk_arg)
 static int
 derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
 {
-  struct gdbarch *gdbarch;
   bfd_vma top_of_data_memory = 0;
   bfd_vma top_of_heap = 0;
   bfd_size_type sec_size;
@@ -414,6 +414,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
                                                                    asec);
          bfd_vma start = obj_section_addr (objsec) & -align;
          bfd_vma end = (obj_section_endaddr (objsec) + align - 1) & -align;
+
          /* Match if either the entire memory region lies inside the
             section (i.e. a mapping covering some pages of a large
             segment) or the entire section lies inside the memory region
@@ -425,8 +426,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
               || (start >= vaddr && end <= vaddr + size))
              && !(bfd_get_file_flags (abfd) & BFD_IN_MEMORY))
            {
-             flags &= ~SEC_LOAD;
-             flags |= SEC_NEVER_LOAD;
+             flags &= ~(SEC_LOAD | SEC_HAS_CONTENTS);
              goto keep;        /* break out of two nested for loops */
            }
        }
@@ -461,9 +461,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
 }
 
 static int
-objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
-                                         int, int, int, void *),
-                            void *obfd)
+objfile_find_memory_regions (find_memory_region_ftype func, void *obfd)
 {
   /* Use objfile data to create memory sections.  */
   struct objfile *objfile;
@@ -476,14 +474,13 @@ objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
       bfd *ibfd = objfile->obfd;
       asection *isec = objsec->the_bfd_section;
       flagword flags = bfd_get_section_flags (ibfd, isec);
-      int ret;
 
       if ((flags & SEC_ALLOC) || (flags & SEC_LOAD))
        {
          int size = bfd_section_size (ibfd, isec);
          int ret;
 
-         ret = (*func) (obj_section_addr (objsec), bfd_section_size (ibfd, isec),
+         ret = (*func) (obj_section_addr (objsec), size, 
                         1, /* All sections will be readable.  */
                         (flags & SEC_READONLY) == 0, /* Writable.  */
                         (flags & SEC_CODE) != 0, /* Executable.  */
This page took 0.024083 seconds and 4 git commands to generate.