]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorDaniel Jacobowitz <drow@false.org>
Tue, 11 Jul 2006 20:37:02 +0000 (20:37 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 11 Jul 2006 20:37:02 +0000 (20:37 +0000)
        * symfile.c (symfile_section_offset_from_segment): Correct
        last change.

        * solib.c (solib_open): Always set errno.

ChangeLog.csl
gdb/solib.c
gdb/symfile.c

index be6a54630749279be9cb69b239f518a40381b4f6..c892b22aa41e10ae6ddcfbe93a1a59b06badbe03 100644 (file)
@@ -1,3 +1,11 @@
+2006-07-11  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       gdb/
+       * symfile.c (symfile_section_offset_from_segment): Correct
+       last change.
+
+       * solib.c (solib_open): Always set errno.
+
 2006-07-11  Daniel Jacobowitz  <dan@codesourcery.com>
 
        gdb/
index f55837694b2b78e9c71ee38988a7ee90dcd30a2c..d2b7b9979b8f1312f92eb6cce9a077f2a7c562ff 100644 (file)
@@ -153,6 +153,12 @@ solib_open (char *in_pathname, char **found_pathname)
   char *temp_pathname = NULL;
   char *p;
 
+  /* By default, return ENOENT.  We must set this explicitly because
+     we don't know whether any of the various calls to open or openp
+     below will actually be made; if none of them are, return this
+     instead of whatever errno was on entry.  */
+  errno = ENOENT;
+
   /* If solib-symbols-extension is set, replace the file's extension.  */
   if (solib_symbols_extension && *solib_symbols_extension)
     {
index 469867bcbdc760422a9385acd974ca8ccab0759c..3279ec00d7c20766003900aad615aef66c2716d1 100644 (file)
@@ -3882,10 +3882,11 @@ symfile_section_offset_from_segment (bfd *abfd, asection *sect,
           && vma < data_segment.p_vaddr + data_segment.p_memsz)
     return data_offset;
 
-  else if (bfd_get_section_size (sect) > 0)
+  else
     {
-      warning (_("Loadable segment \"%s\" outside of ELF segments"),
-              bfd_section_name (abfd, sect));
+      if (bfd_get_section_size (sect) > 0)
+       warning (_("Loadable segment \"%s\" outside of ELF segments"),
+                bfd_section_name (abfd, sect));
       return 0;
     }
 }